• Resolved virtualgeo

    (@virtualgeo)


    Hi,
    I’m having a problem with the latest version 2.29.6 of Page Builder (everything works fine with the previous 2.29.5).
    If I insert shortcodes from my theme or other plugins inside a page builder text widget, the shortcodes no longer work, what I see is the shortcode text not executing.
    Putting back the previous version or saving the shortcodes on a page without page builder everything works fine. I don’t see any PHP errors but the shortcodes don’t work.
    Can you help me?
    Thank you

    • This topic was modified 8 months, 2 weeks ago by virtualgeo.
Viewing 15 replies - 1 through 15 (of 35 total)
  • Thread Starter virtualgeo

    (@virtualgeo)

    I did some tests and it seems to me that the problem occurs when using page builders on pages that use the wordpress block editor.

    Plugin Support Andrew Misplon

    (@misplon)

    Hi, thanks for getting in touch.

    Shortcodes are working normally in all of our testing environments using the latest Page Builder and Widgets Bundle releases. Please try confirming the issue by clearing any caching/optimzation plugins and then temporarily deactivate all plugins except for the Widgets Bundle and Page Builder. Does the issue persist?

    Plugin Support Andrew Misplon

    (@misplon)

    A quick correction. In addition to the Widgets Bundle and Page Builder, one shortcode authoring plugin will need to be left activated to have something to test.

    Plugin Support Andrew Misplon

    (@misplon)

    Thanks. I can mock that up on our end. What widget and shortcode is inserted into a SiteOrigin Layout Block?

    Thread Starter virtualgeo

    (@virtualgeo)

    I tried disabling all plugins except “Page Builder by SiteOrigin” and “SiteOrigin Widgets Bundle” and the problem persists.
    If I only activate “Page Builder by SiteOrigin” without “SiteOrigin Widgets Bundle” the problem persists but I don’t sell the shortcode text.
    I am a developer, they are shortcodes that I write on the function.php of the theme or on the plugins that I develop with my colleagues, in this case the plugins do not do anything complex, they write text and links by applying a certain graphic style or showing some Images.
    Thank you

    Plugin Support Andrew Misplon

    (@misplon)

    Thanks. Which widget is being used in the SiteOrigin Layout Block in the Block Editor to insert the shortcode?

    Plugin Support Andrew Misplon

    (@misplon)

    Here is an example of a shortcode being output in the SiteOrigin Layout Block via a SiteOrigin Editor Widget in the Block Editor. If possible, please upload your shortcode function to PasteBin.com or similar, send the link, and we’ll test it and go from there. If you could also let us know which widget to test in the SiteOrigin Layout Block, that’ll be great.

    Thread Starter virtualgeo

    (@virtualgeo)

    Hi,
    the widget I’m using to insert shortcodes is “SiteOrigin Editor”.

    I have prepared an example where you can see the problem, there are two pages with the exact same code, what changes is only that one uses the classic wordpress editor and the other uses the block editor. As you can see the one with the block editor has problems executing shortcodes. I can’t send you the code of all the shortcodes but I have attached in a “Pastebin” the code of the first shortcode of the “[div]” page which as you can see presents the problem.
    Furthermore, I have also attached the content that I inserted into the widget in a “Pastebin”.

    Block Editor Page:
    https://www.geomaticscube-experiments.com/wp-test/block-editor/
    Classic Editor Page:
    https://www.geomaticscube-experiments.com/wp-test/classic-editor/
    Widget Content:
    https://pastebin.com/T4mADtbD
    DIV Shortcode:
    https://pastebin.com/Ar280Lde

    Thanks for your help!

    • This reply was modified 8 months, 2 weeks ago by virtualgeo.
    Plugin Contributor alexgso

    (@alexgso)

    Hi virtualgeo,

    Thank you for a copy of your shortcode. I’ve run a few tests using it, and I can’t seem to get it to work in any context. Looking over the code, it’s not set to output the content of the shortcode and instead only set to output an element. I’ve made some code changes to output the content, and the widget content is now working as expected for me. You can find the altered code here.

    I suspect we’ve resolved a bug that was allowing this shortcode to function as it was. I recommend giving it a try and seeing how it looks on your end. I also recommend giving the escaping data for output a read in the developer handbook.

    Kind regards,
    Alex

    Thread Starter virtualgeo

    (@virtualgeo)

    The shortcode I sent you in the example is very simple, it works by inserting data, in the example ( [div tag=”h1″ class=”ic_intro” cont=”Cloud Applications”] ), creates an h1 element with class ” ic_intro” and text “Cloud Applications” , this is its task nothing complex and has no problem. The problem I want to point out is that if I save [div tag=”h1″ class=”ic_intro” cont=”Cloud Applications”] in a “SiteOrigin Editor” widget, if the wordpress page uses the block editor the shortcode it is not executed, while if the page uses the classic editor it is executed. If I save [div tag=”h1″ class=”ic_intro” cont=”Cloud Applications”] in a block editor page that doesn’t use page builder the shortcode works, the problem only occurs with Page Builder.
    Thank you

    • This reply was modified 8 months, 2 weeks ago by virtualgeo.
    Thread Starter virtualgeo

    (@virtualgeo)

    I compared version 2.29.5 with the latest version 2.29.6 of “siteorigin-panels” and found changes in the compat/layout-block.php file,
    so I did various tests and noticed that my problem can be traced back to the render_layout_block() function.
    My problem seems to be solved by commenting out line 125 ( // $GLOBALS[ ‘SITEORIGIN_PANELS_POST_CONTENT_RENDER’ ] = true; ).
    Doing this ensures all my shortcodes run correctly.

    Plugin Contributor alexgso

    (@alexgso)

    Hi,

    With the modified shortcode, I’m having trouble replicating the described issue while using the Block Editor (or Classic Editor). Can you please try the provided snippet to see if that works for you?

    If it doesn’t, can you please provide me with an export of the layout you’re working on? This will allow me to run some tests directly against that page. Please upload the export to Pastebin.

    My problem seems to be solved by commenting out line 125 ( // $GLOBALS[ ‘SITEORIGIN_PANELS_POST_CONTENT_RENDER’ ] = true; ).

    This line was intentionally added to help with rendering things more consistently overall with the Classic Editor. In other words, it brings it in line with how we typically render pages.

    Kind regards,
    Alex

    Thread Starter virtualgeo

    (@virtualgeo)

    HI,
    I did further tests,
    unfortunately I can’t provide you with my code but I exported the shortcodes I’m using (which work on any theme) for you into a small plugin, I put the plugin on Pastebin (https://pastebin.com/Ar280Lde).
    I also simplified the contents of the widget to display my problem and put that in the Pastebin too (https://pastebin.com/T4mADtbD).
    So now to recreate my problem you just need to activate my plugin and paste the content I sent you into the “Siteorigin Editor” widget.
    At this point you should see on the pages that use the “Block Editor” with “SiteOrigin Editor” widget that only one of the two shortcodes is executed,
    while if you use “Classic Editor” with the “SiteOrigin Editor” widget both shortcodes are executed (correctly).

    By commenting on the line I reported to you, I confirm that the problem is solved.
    I await your feedback.
    Thank you

    • This reply was modified 8 months, 2 weeks ago by virtualgeo.
    Plugin Support Andrew Misplon

    (@misplon)

    Hi, please can you confirm the expected output in the following situation:

    Plugins Activated: Classic Editor and VirtualGeo DIV. Nothing else.
    Editor: Classic Editor
    Contents: https://pastebin.com/T4mADtbD

    Thread Starter virtualgeo

    (@virtualgeo)

    Ok,
    in this case both shortcodes are executed correctly.
    This is the resulting html “<div class=”ic_box”><h1 class=”ic_intro”>Cloud Applications</h1></div>”

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Shortcode issue in textwidget on Page Buider 2.29.6’ is closed to new replies.