Skip to content

Editor: Widget Ignores Page Builder's Keep-Shortcodes Opt-Out Filter During the Post Content Mirror Render #2365

Description

@Misplon

Summary

Once #2364 ships, the Editor widget skips do_shortcode() whenever SITEORIGIN_PANELS_POST_CONTENT_RENDER is set. That guard is unconditional. It does not consult Page Builder's siteorigin_panels_post_content_keep_shortcodes filter, so a site that returns false from that filter to opt back into baked shortcode output gets it for core Text widgets but not for Editor widgets.

Steps to reproduce

  1. Page Builder with Copy Content: keep shortcodes intact in the post content mirror siteorigin-panels#1372 and Widgets Bundle with Editor: only run shortcodes when rendering for the front end #2364. Copy Content enabled.
  2. add_filter( 'siteorigin_panels_post_content_keep_shortcodes', '__return_false' );
  3. Save a page with an Editor widget containing a shortcode.
  4. Inspect post_content.

Expected: the shortcode output is baked into the mirror, matching the filter's contract and the core Text widget's behaviour.

Actual: the raw shortcode is kept. The same page with a core Text widget bakes correctly.

Verified locally against both fix branches: Text widget honours the filter, Editor widget does not.

Suggested fix

In widgets/editor/editor.php, when SITEORIGIN_PANELS_POST_CONTENT_RENDER is set, run do_shortcode() anyway if apply_filters( 'siteorigin_panels_post_content_keep_shortcodes', true ) returns false. Keep the legacy SITEORIGIN_PANELS_CACHE_RENDER guard as is.

Low impact: the filter is new and opt-in, and the default behaviour is correct in both plugins.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions