• Resolved mmwbadmin

    (@mmwbadmin)


    Hi,
    Get the impression that not only the [wiki] shortcodes are stripped from the_excerpt, but also the text in between.
    I’m using WP 5.3.2 with WP WT 1.9.1 on PHP 7.4. Happens with themes like Blocksy, Astra and Weaver Xtreme.
    Can create an example.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Nico Danneberg

    (@nida78)

    I am not sure if this is not a bug of the plugin but a standard behavior of WordPress. I will figure out and coming back soon!

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Hi Nico,
    I guess so. Before WP 5.0 image caption worked in a similar way by design. Enclosed in [ ] they were filtered from the excerpt with the text in between. Figcaption is now in < >.

    Similar plugin Wikilookup shows same behaviour. Shortcodes + text is stripped from excerpt.

    Hope you can find a solution or workaround.

    Plugin Author Nico Danneberg

    (@nida78)

    Ok, I just tested this scenario in my local deveopment setup once with “Twenty Twenty” and once with “Blocksy”. I found out that your problem is caused by the theme!

    In “Twenty Twenty” everything work fine. All shortcodes are displayed even in excerpts pretty well. But if I switched to Blocksy the shortcodes were filtered out! And if I used the extra excerpt-field of a post that the shortcode was printed out as plain-text (the [] are shown).

    So, my plugin has no chance to steer the behavior of the theme! I think the only solution is override the get_excerpt-function of the theme…

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Hi, 2020 shows same behaviour. Thanks for your investigation.
    Did you work with excerpts instead of the full text?
    (See attached screenshots of both)
    Through the customizer I adjusted Theme Options to show excerpts on archive pages.
    Leaves the possibility that it can be theme behavior, but if even 2020 works this way ….
    Will use some kind of workaround for the time being.

    • This reply was modified 4 years, 8 months ago by mmwbadmin.
    • This reply was modified 4 years, 8 months ago by mmwbadmin.
    Plugin Author Nico Danneberg

    (@nida78)

    I made this small setup that works with 2020 really fine:

    1) I created a post with a shortcode within the first 100 characters.

    2) I created a page where I used the “Latest Posts”-Gutenberg Block with option “show excerpt” enabled.

    3) If I visited this page online everything looks good!

    All this is done with 2020! So, I do not see the problem :/

    Thread Starter mmwbadmin

    (@mmwbadmin)

    OK. Doesn’t work in my setup with 2020 on Archive pages with excerpt selected (as illustrated). Will not use shortcode in excerpt.

    Plugin Author Nico Danneberg

    (@nida78)

    It’s a pitty that it doesn’t work!

    I will hold my eyes open to perhaps see a solution later…

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Hi Nico,
    I replicated your setup and created a page where I used the Latest-Posts-Block. Looks good on the frontend in the way that the text between [wiki] and [/wiki] is visible. But what strikes me, is that the tooltip even works. That’s not what happens in a normal WP setup where you show excerpts of posts on a blog/archive/category/tag/author-page.

    For that reason I made a few words italic and bold. These styles are not shown, even in your setup (using new-posts-block). So, the markup is removed and text stays. That’s what I would expect from the wiki tooltip as well.

    Hope you can find a few minutes to test my setup as well. Display a blog page with one or several post excepts.

    It would be great if the wiki-tagged text remains in the excerpt, but without the functionality itself. Just stripped of shortcode and html tags.

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Hi,
    from a similar issue on Gutenberg latest-posts-block in combination with a plugin (see last post by plugin author).

    “The latest posts block does not apply any filters to the excerpt output so there’s unfortunately no way to modify it.

    Which is a bit weird, WordPress generally has a filter/action that developers can use to modify almost anything.”

    Plugin Author Nico Danneberg

    (@nida78)

    Are you able to modify my plugin on your server?

    If yes please look for the file class.wp-wiki-tooltip.php and add this line of code at line 18: add_filter( 'get_the_excerpt', 'do_shortcode' );

    Please tell me if this leads to the right result!

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Sorry, but this doesn’t solve the issue. Thanks for the suggestion. I get a sense of what you were trying to accomplish (I’m not a developer).
    I raised the issue at Github as well.

    Plugin Author Nico Danneberg

    (@nida78)

    OK, I will wait for answers to your posts at Stackoverflow an Github!

    Thread Starter mmwbadmin

    (@mmwbadmin)

    Issue #20702 on Github is now closed. Excerpts on a blog page are identical to excerpts in a latest-posts-block with WP 5.4 (or WP 5.3 + GB 7.7)

    In my case without a manually created excerpt, an excerpt is created and stripped from its shortcodes.

    I’m not sure whether this works OK for enclosing shortcode tags as the enclosed content is also stripped.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Shortcode & Excerpt’ is closed to new replies.