PHP error on replace_editor filter
-
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 thereplace_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 aWP_Post
instance.A plugin of ours adds a callback to that
replace_editor
filter, and of course, expects that its second parameter is a properWP_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 aWP_Post
object before running it over the filter, and avoiding using the filter as a source of truth if that check fails.
- The topic ‘PHP error on replace_editor filter’ is closed to new replies.