• Resolved mordisko

    (@mordisko)


    Hello,

    I’ve seen reports around these forums which say that their shortcodes recently stopped working.

    In one of the threads the author advices to check if your shortcode is followed by two spaces as it will stop your shortcode from working.

    Well that wasn’t my case and after a few minutes I figured it out.

    If you use a “tag” modifier before a “category” modifier your shortcode won’t work and you will see the raw code on your web page.

    To illustrate the error, the following code doesn’t work:

    [display-posts tag="instalación" category="ayuda" posts_per_page=5]

    The following code, which does exactly the same thing, does work as expected:

    [display-posts category="ayuda" tag="instalación" posts_per_page=5]

    To make things more bizarre, the following code (which has improper syntax) works correctly:

    [display-posts tag="instalación" category="ayuda" posts_per_page=5
    [display-posts tag="instalación" category="ayuda" posts_per_page=5]

    * Note that the code above is missing a ] symbol on the first line. It is intentional. If you type the code like that it will work.

    I guess that this is some minor bug which should be documented or fixed. I just hope to help anyone else who is affected by it.

    Cheers,
    Héctor

    https://ww.wp.xz.cn/plugins/display-posts-shortcode/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Are you sure it isn’t caused by the special character in your tag: ó

    WordPress 4.4.2 and later fixed a large security hole by increasingly strict interpretations of what is in a shortcode. So things that worked before might no longer work.

    Display Posts Shortcode doesn’t actually have any known bugs in it. The issue is if you formatted your shortcode in a way that is no longer supported in WordPress, but did work in previous versions.

    Thread Starter mordisko

    (@mordisko)

    Hey Bill,

    I’m completely sure. The snippet that I’ve posted is just one of the shortcodes which isn’t working.

    This other shortcode -which doesn’t have any special characters on it- doesn’t work either:

    [display-posts tag="clientes" category="ayuda" posts_per_page=5]

    This, on the other side, is working properly. Notice that it is the same code moving the tag attribute to the second position.

    [display-posts category="ayuda" tag="clientes" posts_per_page=5]

    Whether this should considered a bug or not is up to you, but obviously that behaviour is very confusing and is not documented anywhere.

    Cheers,

    Plugin Author Bill Erickson

    (@billerickson)

    Why haven’t you used quotes on the posts_per_page parameter? It doesn’t explain the issue you’re seeing though.

    I just created a new WordPress installation with WordPress 4.4.2 and Display Posts Shortcode. I created a category called ‘ayuda’, and the tags ‘clientes’ and ‘instalación’. Note, when I gave the tag name of ‘instalación’ WordPress converted the slug to ‘instalacion’. Display posts shortcode uses the slug, not the name, so make sure you’re using the correct slug.

    Here’s the page I set up using all of your shortcodes: http://cl.ly/3Z121i3x2F31

    And here’s the results: http://cl.ly/180F2f420K33

    You can see that, either way the category and tag parameters are arranged in the shortcode, the result is the same.

    This is not a bug in Display Posts Shortcode, since it cannot be replicated using the exact same content structure you described.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Bug report: WordPress 4.4.2 and’ is closed to new replies.