Skip to content

tags with attributes #30

Description

@stereonom

I created the following shortcode:

[tab title="I am the titel"]I'm the content[/tab]

The plugins tries to escape the quotation marks like this:

[tab title=\"I am the titel\"]I'm the content[/tab]

But it even renders the backslashes in the wysiwyg-editor and in the text-editor.

My shortcode than fails, because it can't find the title correctly and the fallback title is used.

function add_tab( $atts , $content = null ) {
    // Attributes
    extract( shortcode_atts(
        array(
            'title' => 'Tab',
        ), $atts )
    );
    $markup = '<div class="tabheadline">'.$title.'</div><div class="tabbody">'.apply_filters( 'box_content', $content ).'</div>';
    return $markup;
}
add_shortcode( 'tab', 'add_tab' );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo