For adding the ID at the end of the URL being generated in yout filter_post_thumbnail
function you would use concatenation to append the variable to the end of the URL in the return statement.
return'<img src="https://eur02b.sheltermanager.com/service?account=bp****&method=animal_image&animalid="' . $animalID_REF . '"/>';
Also you’ll need to upload the image to the media library and then set it as a featured image or create a ACF field and add it to that field somehow. The filter post_thumbnail_html
isn’t going to set the posts featured image for you. You can read more about the post_thumbnail_html
in the docs here: https://developer.wordpress.org/reference/hooks/post_thumbnail_html/
There is a answer/question thread that touches on that topic here: How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
Regarding the tags, pj_tags
is not a parameter of wp_insert_post the parameter for inserting tags through wp_insert_post
would be tags_input
You can read more about that function on the WP docs: https://developer.wordpress.org/reference/functions/wp_insert_post/
Check out the docs to better understand what the filters and functions you’re using are doing and what is available to you within them.