Wordpress 4.4 update breaks existing shortcodes

I have noted that Wordpress 4.4 update seems to break some of the existing shortcodes.

On the site I manage, we use shortcodes in lieu of BBCode support. The offending shortcode is typically:

[url="http://google.com/"]Google it[/url]

This used to render perfectly in all WP versions up to 4.3, in 4.4 it is not being recognized as shortcode.

Can anyone advise me what has been changed in shortcode support and how to fix/patch that. Its this a bug in WP version, or intentional change?

  • Adam Czajczyk

    Hello Martino,

    I hope you're well today and thank you for your question!

    It seems that all the shortcodes in form of

    [shortcode=value] and [shortcode:value]

    are no longer supported by WordPress core. Actually, this form was deprecated some time ago but was still handled by WP core until 4.4 release. Proper shortcode form is either

    [shortcode] (without any values)

    or

    [shortcode attribute="value"]

    This unfortunately is fixable only by changing shortcode code so in most cases it would require updatiding/changing plugin's code so I think you may want to report this to the plugin developer.

    Alternatively (especially in case when developer is unreachable) custom coding may be a solution. This would require finding shortcode PHP code in plugin's code e.g. wrapping it in your own template function or new shortcode.

    As in relation to 3rd-party plugins this is way outside the scope of this forum, you may want to ask a question on our "Jobs & Pros" job board (please note: no WPMU DEV staff involved!) here:

    https://premium.wpmudev.org/wordpress-development/

    However, if you feel like custom coding a try yourself, please feel free to ask me any questions related to this and I'll do my best to advise you as much as I can.

    Best regards,
    Adam

  • Adam Czajczyk

    Hey Martino!

    I reckon that I should be able to locate that deprecated shortcode functionality in WP 4.3, and then copy the relevant code to my theme/functions.php ?

    This will work in many cases so it's worth a try. The procedure would be to:

    - locate shortcode function for this "broken shortcode" in plugin's code
    - move copy it to functions.php file
    - rename the function, e.g

    if it's currently

    function my_shortcode() {

    change it to

    function my_shortcode_fixed() {

    - copy relevant "add_shortcode()" call to functons.php and then: fix shortcode scheme and adjust function name

    As I said, in many cases it will work as expected though you will need to update shortcodes all around your site. In some cases however this will not work and instead produce errors. Mostly this will happen in case of more complex plugins that use complex object-oriented code with some strict classes dependencies.

    This cases will most likely require action from plugin developer.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.