PHP error on replace_editor filter
-
Hi there
In
\ProDevign\BlockMeister\Context::is_block_editorthere 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_editorfilter.This method is used wildly along the plugin, even on pages where the global
$postis not set. However, as stated in the docs, that$postparameter must indeed be aWP_Postinstance.A plugin of ours adds a callback to that
replace_editorfilter, and of course, expects that its second parameter is a properWP_Postinstance. As a result, we get a PHP error when both ours and your plugin are active.I would suggest checking that the global
$POSTis indeed aWP_Postobject 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.