Conversation
multi-post-thumbnails.php
Outdated
| public static function get_post_thumbnail_title($post_type, $id) { | ||
| $post_id = get_the_ID(); | ||
| $post_thumbnail_id = self::get_post_thumbnail_id($post_type, $id, $post_id); | ||
| $attachment_meta = get_post($post_thumbnail_id); |
There was a problem hiding this comment.
Thanks for the PR! Can you check to make sure $post_thumbnail_id is valid here before doing get_post()? Making sure it is an int greater than zero should cover it. If it isn't valid, returning a blank string seems appropriate.
|
Looks good? |
multi-post-thumbnails.php
Outdated
| * @param string $id The id used to register the thumbnail. | ||
| * @return thumbnail title. | ||
| */ | ||
| public static function get_post_thumbnail_title($post_type, $id, $post_id) { |
There was a problem hiding this comment.
Sorry I didn't notice this earlier, but can you default $post_id to null so that it is an optional arg and makes sense w/the below conditional? e.g. similar to get_post_thumnail_url()
|
Defaults updated... |
|
Good? |
|
Thanks, let me get this tested and merged. I have one other issue to address and will do a release soon here and on the .org plugins repo. |
|
Awesome, thanks! |
|
Hello! Any progress here? Just want to update plugin from WP interface on my projects. |
I've updated my request with post_id check.