WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#28773 closed defect (bug) (invalid)

add_filter not working as expected with 'no_texturize_shortcodes'

Reported by: pgn4web Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: Formatting Keywords:
Focuses: Cc:

Description

Hello I have a plugin that created a shortcode, for example [my] ... my

In the plugin code, in order to avoid text in-between the shortcode tags to be changed, I added this code:

function my_no_texurize( $shortcodes ) {
        $shortcodes[] = 'my';
        return $shortcodes;
}

add_filter( 'no_texturize_shortcodes', 'my_no_texturize' );

Using this code actually stops the texturization of the tag, however this applies to all tags (not only for my tag). With a bit of investigation, I discovered that replacing the code above with the following also works for all tags:

add_filter( 'no_texturize_shortcodes', 'function_that_does_not_exist' );

I also found that the following code restores the expected behavior of disabling texturization for only the intended tags (note that I'm passing to add_filter a function pointer not a function name):

function my_no_texurize( $shortcodes ) {
        $shortcodes[] = 'my';
        return $shortcodes;
}

add_filter( 'no_texturize_shortcodes', my_no_texturize );

The above works but it's not consistent with the documentation at http://codex.wordpress.org/Plugin_API/Filter_Reference/no_texturize_shortcodes

Change History (2)

#1 @miqrogroove
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Your function name is misspelled. Please see the support forums if you need additional assistance.

#2 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.