WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 14 months ago

Last modified 11 months ago

#44691 closed defect (bug) (fixed)

Comment variable is wrong for shortcode tags

Reported by: uttam007 Owned by: SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Shortcodes Keywords: has-patch
Focuses: Cc:

Description

Filters the list of shortcode tags to remove from the content comment variable is not correct. It should be $tags_to_remove instead of $tag_array.

Attachments (2)

strip_shortcode_comment.7361.diff (574 bytes) - added by uttam007 14 months ago.
Updated the comment parameter name in the comment.
44691.diff (572 bytes) - added by uttam007 14 months ago.

Download all attachments as: .zip

Change History (7)

@uttam007
14 months ago

Updated the comment parameter name in the comment.

#1 @netweb
14 months ago

  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 5.0

Hi @uttam007, welcome to Trac and thanks for creating his ticket :)

Could you refresh the patch please so that the @param's descriptions are aligned:

  • src/wp-includes/shortcodes.php

    function strip_shortcodes( $content ) { 
    609609         *
    610610         * @since 4.7.0
    611611         *
    612          * @param array  $tag_array Array of shortcode tags to remove.
    613          * @param string $content   Content shortcodes are being removed from.
     612         * @param array  $tags_to_remove Array of shortcode tags to remove.
     613         * @param string $content        Content shortcodes are being removed from.
    614614         */
    615615        $tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );}}}

#2 follow-up: @subrataemfluence
14 months ago

  • Component changed from General to Shortcodes

Please mention your version of WordPress where you found the issue. And curious to know about the name of your diff file. It has 7361 in it. Usually the diffs are created with the ticket number like 44691.diff. Any specific reason?

Last edited 14 months ago by subrataemfluence (previous) (diff)

@uttam007
14 months ago

#3 in reply to: ↑ 2 @uttam007
14 months ago

Replying to subrataemfluence:

I have uploaded another attachment with the ticket number and the Wordpress version is 4.9.7.

#4 @SergeyBiryukov
14 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 43549:

Docs: Correct parameter name in strip_shortcodes_tagnames filter DocBlock.

Props uttam007.
Fixes #44691.

#5 @SergeyBiryukov
11 months ago

  • Keywords needs-refresh removed
  • Milestone changed from 5.0 to 5.1

Switching milestone due to the focus on the new editor (Gutenberg) for WordPress 5.0.

Note: See TracTickets for help on using tickets.