[Fix] Featured images not broadcasting
-
We had an incredibly difficult to diagnose issue where featured images weren’t broadcasting. The Media post itself broadcast and created correctly the file was copied on disk correctly, it just wasn’t being attached to the broadcasted post. The problem only occurred when broadcasting via cron job – broadcasting with the Efficiency Pack’s Network Queue page worked fine.
The problem turned out to be an incompatibility with the PublishPress Revisions plugin – specifically this action hook.
I’m guessing the agp_user_can line returns true from the Network Queue page but false when a broadcast is triggered via cron – because cron jobs have no logged in user. As a result the _thumbnail_id meta is never attached to the broadcasted post.
I added the following code in my functions.php file to fix the issue:
add_action('threewp_broadcast_broadcasting_started', function(\threewp_broadcast\actions\broadcasting_started $action) { // This action will stop featured images being attached to broadcasted // posts when the broadcast is handled via cron. remove_action('update_post_metadata', '_rvy_limit_postmeta_update', 10); });
After that, featured images broadcasted perfectly.
- The topic ‘[Fix] Featured images not broadcasting’ is closed to new replies.