Closed kwisatz closed 7 months ago
$this->is_post_type_enabled()
is returning false in our case, despite the settings now having been touched and showing that the functionality is enabled for Posts.
I've added debug statements and can see that at some point, while the array of enabled post types has been 'post' and 'page' for a while, 'post' suddenly gets dropped. (Just before the closing </head>
, which is where the variable would be output).
So I'm guessing the coauthors_supported_post_types
filter runs at some point and removes the post
post type from the list of supported types.
I will stop here for lack of time. IMHO, even if there is a reason for the filter to remove 'post' from the supported types, the javascript code should make sure that the variable is defined before using it and/or the file should only be enqueued if the post type is supported. The former is probably easier to achieve than the latter.
I'll add more information here as I find any. After the 3.6.0 update, we're seeing this error on the posts list, preventing any other scripts from running:
Code in question is this:
I can see the variable gets defined here https://github.com/Automattic/Co-Authors-Plus/blob/586e803589a5d3f86de6f04a8391385529b3fbbe/php/class-coauthors-plus.php#L1460 but this code doesn't seem to run for the posts list, at least not in our case.