Yoast\WP\SEO\Helpers
Image_Helper::get_post_content_image()
Gets the image url from the content.
Метод класса: Image_Helper{}
Хуков нет.
Возвращает
Строку
. The image url or an empty string when not found.
Использование
$Image_Helper = new Image_Helper(); $Image_Helper->get_post_content_image( $post_id );
- $post_id(int) (обязательный)
- The post id to extract the images from.
Код Image_Helper::get_post_content_image() Image Helper::get post content image Yoast 24.7
public function get_post_content_image( $post_id ) { $image_url = $this->get_first_usable_content_image_for_post( $post_id ); if ( $image_url === null ) { return ''; } return $image_url; }