Support » Plugin: Post Content Shortcodes » Shortcode inside post is filtered out

  • Hi,

    I´m trying to use your plugin in a multisite environment. The content of my posts use shortcodes to display certain kinds of content (gallery, form…). When I try to include this post via this plugin the text of the post is shown but all content from within the shortcodes is filtered out.

    I also tried to change the default argument for “shortcodes” to true. I tried this via shortcode [post-content blog_id=2 id=11 shortcodes=1] and also in the file (class-post-content-shortcodes.php) itself.

    Am I using this in a wrong way? Or is this issue related to my WordPress version (4.5.2)?

    Thanks a lot!

    https://wordpress.org/plugins/post-content-shortcodes/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Instead of “blog_id” try the “blog” attribute as explained in the FAQ section;

    How do I pull posts from another blog in the network?

    Use the blog attribute to specify which site/blog the post should be pulled from. The blog attribute can accept a blog ID (numeric) or a blog name (the slug of the blog).

    Will this plugin work in a multisite environment?
    Yes. You can safely network-activate this plugin, or even use it as a mu-plugin. To pull a post with a slug of ‘this-is-my-cool-post’ from a blog with an ID of 10 and a slug of ‘mycoolsite’, the usage would look something like:

    [post-content post_name=”this-is-my-cool-post” blog=10]

    or

    [post-content post_name=”this-is-my-cool-post” blog=”mycoolsite”]

    ————————-

    And of course you’ve to enable the shortcode attribute as well. It’s working in my network.

    Hey rwnfrnnd,

    thanks a lot for your help. Unfortunately it doesn´t work for me. When trying to use the names/slug instead of the ids I get the following message:
    “No posts could be found that matched the specified criteria.”

    If I use the blog id and the post name the content is shown but still without the content of the shortcodes.

    I already tried different variations of the blog name/slug. But maybe I don´t have the right one. Can you please specify where to get the exact blog slug. I tried the name of the blog which sonsists of three words with big and small letters, with and without whitespaces and also with and without “-“.

    Furthermore I also tried the network name in different variations.

    Thanks again.

    Plugin Author Curtiss Grymala

    (@cgrymala)

    It looks like this is a bug in the plugin. The shortcodes attribute should work with the post-list shortcode, but the code that makes it work within post-content has a bug in it.

    I’ll look into this issue.

    In the meantime, if you want to search for if ( true !== $shortcodes ) { within the post_content function, and replace it with the following, that should fix the issue (hopefully).

    if ( true !== $this->shortcode_atts['shortcodes'] ) {

    @kolks
    Have you tried using the blog ID with the blog attribute (not with the blog_id)?
    Something like this (here #5 is the blog id);
    [post-content shortcodes=true post_name=”your-post-name” blog=5]

    At least for me, shortcodes work that way. But I agree blog name (slug) doesn’t work for me as well (tried different variations). I’ve to give the ID of the blog.

    I was giving you a solution only to make shortcodes working.

    So hopefully Curtiss could come up with solutions for these issues in the next update.

    It’s still a great plugin. Thanks.

    @rwnfrnnd:
    Thanks again for trying to help me find a solution. Unfortunately this still doesn´t work for me. When using the blog ID with the “blog” attribute I again can see the post content itself but unfortunately without the content of the shortcodes.

    @curtiss:
    Thanks a lot for your quick suggestion to solve the problem. I changed the code in the class-post-content-shortcodes-php file in line 347 but unfortunately that didn´t do the trick.

    Thanks a lot for your support. I really appreciate that.

    Plugin Author Curtiss Grymala

    (@cgrymala)

    If you’re still using this plugin, would you mind downloading the latest development/test copy at https://github.com/cgrymala/post-content-shortcodes and let me know if it works (and if it fixes the issue you’re running into)? I’m just about ready to release that new version, but I’d like to test it more widely and make sure it’s fixing the issues people have raised in the past few months. Thanks.

    Hey Curtiss

    thanks for the big update to the plugin. Sorry for the late answer. As far as the plugin wasn´t working for me I haven´t used it…but I installed it again in a multisite environment via WordPress backend (version 1.0) with WordPress 4.7.4. Now the result is a bit strange: When using the post-content shortcode with a page from the network that has two shortcodes in it the content of the first shortcode (Envira Gallery) doesn´t appear at all and the content of the second shortcode (Gwolle guestbook) appears in parts/not correct. The button for creating a new guestbook entry appears (which is good) but though the guestbook has entries only the message “no entries” appears on the page like when the guestbook is empty. Does that make any sense to you?

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.