wpseo_image_attribute_containing_id
Filter wpseo_image_attribute_containing_id Allows filtering what attribute will be used to extract image IDs from.
Defaults to "class", which is where WP natively stores the image IDs, in a wp-image-<ID> format.
Использование
add_filter( 'wpseo_image_attribute_containing_id', 'wp_kama_wpseo_image_attribute_containing_id_filter' ); /** * Function for `wpseo_image_attribute_containing_id` filter-hook. * * @param string $string The attribute to be used to extract image IDs from. * * @return string */ function wp_kama_wpseo_image_attribute_containing_id_filter( $string ){ // filter... return $string; }
- $string(строка)
- The attribute to be used to extract image IDs from.
Где вызывается хук
wpseo_image_attribute_containing_id
wpseo_image_attribute_containing_id
yoast/src/images/Application/image-content-extractor.php 89
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );
yoast/src/images/Application/image-content-extractor.php 119
$attribute = \apply_filters( 'wpseo_image_attribute_containing_id', 'class' );