Open stuajnht opened 5 years ago
Second this behavior. Noticed all featured images in multisite configuration disappeared after install. Using any theme (currently using Astra) even with Blog Designer plugin enabled or disabled.
The only current fix is to install Classic Editor as OP stated.
Wordpress 5.2.2 Network Media Library 1.5.0
I have also encountered this issue.
The problem is that when trying to set the thumbnail it first does a check to get_post()
in web/wp/wp-includes/post.php on line 7143:
if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
This returns false because the media site's thumbnail ID doesn't exist in the network site. I'm gonna have a look at a workaround today but unfortunately hooks are light in this area.
Wordpress: 5.5 Network Media Library: 1.5.0
Expected Behaviour
Using the Gutenberg editor, when setting or updating a featured image, it should be saved with the post.
Current Behaviour
Occasionally the featured image does not get saved with the post. This depends on if the value of the post ID of the image on the media site exists in the non-media site that the featured image is being applied to (for example, a post on the non-media site has been deleted).
This does not happen if the classic editor plugin is being used - the featured image is saved correctly.
Steps to Reproduce
Detailed Description
When a featured image is added from the Gutenberg editor, and the publish / update button is pressed, the editor fires off a REST request to
/wp-json/wp/v2/posts/<id>
, with a request payload containingfeatured_media
with the ID of the featured image.The WordPress REST controller passes this request to the WordPress REST post controller. The featured image is passed to the
handle_featured_media()
function. This function calls theset_post_thumbnail()
function. Theset_post_thumbnail()
function attemps to get the ID of the featured image, but as it doesn't exist on the non-media siteset_post_thumbnail()
returns false, which then causeshandle_featured_media()
to return aWP_Error
. As the ID of the featured image has not been updated in the posts meta_thumbnail_id
, it either doesn't exist or still points to the previous ID.Additional Information
Wordpress 5.1 Network Media Library 1.4.1 This may or may not be related to issues #11 and #45