WPSEO_Sitemap_Image_Parser::get_image_item()
Get image item array with filters applied.
Метод класса: WPSEO_Sitemap_Image_Parser{}
Хуки из метода
Возвращает
Массив
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_image_item( $post, $src );
- $post(WP_Post) (обязательный)
- Post object for the context.
- $src(строка) (обязательный)
- Image URL.
Код WPSEO_Sitemap_Image_Parser::get_image_item() WPSEO Sitemap Image Parser::get image item Yoast 24.3
protected function get_image_item( $post, $src ) { $image = []; /** * Filter image URL to be included in XML sitemap for the post. * * @param string $src Image URL. * @param object $post Post object. */ $image['src'] = apply_filters( 'wpseo_xml_sitemap_img_src', $src, $post ); /** * Filter image data to be included in XML sitemap for the post. * * @param array $image { * Array of image data. * * @type string $src Image URL. * } * * @param object $post Post object. */ return apply_filters( 'wpseo_xml_sitemap_img', $image, $post ); }