WordPress.org

Support

Support » Plugins and Hacks » SubHeading » [Resolved] Span classes being stripped.

[Resolved] Span classes being stripped.

  • I added the following to allow for br and span tags with classes, but the classes keep getting stripped.

    add_filter( 'subheading_tags', function( $tags ) {
     	$tags['span'] = array('class');
     	$tags['br'] = array();
        return $tags;
    } );

    Did I do it wrong?

    Also, should class names be in quotes? I tried with single, with double and none. All got stripped.

    Just trying to do something like this:

    <span class=”home1st”>Lorem ipsum dolor sit amet,</span><span class=”home2nd”>consectetuer adipiscing elit.</span>

    But I get this after saving:

    <span>Lorem ipsum dolor sit amet,</span><span>consectetuer adipiscing elit.</span>

    http://wordpress.org/extend/plugins/subheading/

Viewing 1 replies (of 1 total)
  • Plugin Author Steve

    @stvwhtly

    Hi,

    Referring back to the WordPress documentation, it looks as though I may have including some slightly incorrect / misleading information in the Frequently Asked Questions relating to this topic.

    It should be possible to adjust your snippet to use ‘class’ as an array key rather than value, therefore something along the lines of this should help:

    add_filter( 'subheading_tags', function( $tags ) {
     	$tags['span'] = array('class' => array());
     	$tags['br'] = array();
        return $tags;
    } );

    I have also adjusted the readme file for the next release to reflect this – hope it helps.

    – Steve

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Span classes being stripped.’ is closed to new replies.
Skip to toolbar