• Resolved Gahapati

    (@gahapati)


    Thank you, Scott, for another great plugin. I have been using this without any known problem since WP 3.0.1, I think.

    I have just now noticed one case where it won’t catch on, though:

    FD Footnotes Plugin uses a shortcode whose identifier consists of any ordinal number:

    [1. This is a footnote.]

    It would be much appreciated if you could come up with a solution for this.

    While I’m at it:
    Have you ever thought of adding an option to hide whatever is located in between broken shortcodes? I’m seeing so many plugins that assume they will be around forever, and which, when broken, will display the exact thing they were meant never to give away.
    [hideaway]My Secret[/hideaway]
    This inherent leakiness renders most conditional shortcode plugins I’ve seen essentially unfit for their intended use.

    https://www.ads-software.com/plugins/hide-broken-shortcodes/

Viewing 1 replies (of 1 total)
  • Plugin Author Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    @gahapati: Hi,

    Thanks for the suggestions!

    As for the issue with FD Footnotes, I just looked over its code and it doesn’t actually use shortcodes. It just uses a syntax that has square brackets around it, like shortcodes. But they aren’t officially registered or handled as shortcodes by WP. That plugin does custom scans and handling to do its thing. Unfortunately, that prevents it from being something Hide Broken Shortcodes can affect.

    To your second request, there is indeed a way to hide the text between broken shortcodes, but it’s via code. There’s an example in the readme, which I’ll reproduce here:

    /**
     * Don't show broken shortcodes or the content they wrap.
     *
     * @param string $default The output the plugin would normally show.
     * @param string $shortcode The name of the shortcode.
     * @param string $content The text between the opening and closing "tags" of the shortcode, if any.
     * @return string
     */
    function hbs_handler( $default, $shortcode, $content ) {
    	return ''; // Don't show the shortcode or text bookended by the shortcode
    }
    add_filter( 'hide_broken_shortcode', 'hbs_handler', 10, 3 );

    That would hide all broken shortcodes as well as the text they wrap. If you wanted only certain broken shortcodes to be handled this way, the function can be modified to check $shortcode for the desired shortcode names.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Does not catch FD Footnotes shortcode’ is closed to new replies.