Support » Plugin: BlockMeister - Block Pattern Builder » PHP error on replace_editor filter

  • Resolved jadpm

    (@jadpm)


    Hi there

    In \ProDevign\BlockMeister\Context::is_block_editor there is a check on whether we are currently on the block editor. The first check does the following:
    – Gather the global $post.
    – Use it to gather the result of the replace_editor filter.

    This method is used wildly along the plugin, even on pages where the global $post is not set. However, as stated in the docs, that $post parameter must indeed be a WP_Post instance.

    A plugin of ours adds a callback to that replace_editor filter, and of course, expects that its second parameter is a proper WP_Post instance. As a result, we get a PHP error when both ours and your plugin are active.

    I would suggest checking that the global $POST is indeed a WP_Post object before running it over the filter, and avoiding using the filter as a source of truth if that check fails.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author BlockMeister

    (@blockmeister)

    Thank you for making us aware of this.
    We have added this to our TODO list.

    Plugin Author BlockMeister

    (@blockmeister)

    I just uploaded a new release (3.1.7) with a fix for the issue you reported.
    Could you please confirm that the issue is indeed fixed?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP error on replace_editor filter’ is closed to new replies.