Not able to retrieve image id from sibling site within a switch_to_blog
Here is how I am trying to grab the image id for 'white_logo'.
switch_to_blog($site-blog_id);
echo attachment_url_to_postid( get_theme_mod('white_logo'));
restore_current_blog();
The echo is printing '0'. It seems that when I use 'attachment_url_to_postid' for grabbing IDs of images that are within the current site's media library that it works. But when I try to grab IDs of images within other sites media libraries I'm not getting the desired response. Is there an alternative way to achieve this? Thank you!
EDIT NOTE: I should add that I do know the 'switch_to_blog' is working properly as I am able to get the image url with 'get_theme_mod()'. I'm just unable to retrieve the ID with 'attachment_url_to_postid()'.
Topic switch-to-blog images Wordpress
Category Web