wpseo_social_template_post_type
Filters the social template value for a given post type.
Использование
add_filter( 'wpseo_social_template_post_type', 'wp_kama_wpseo_social_template_post_type_filter', 10, 3 ); /** * Function for `wpseo_social_template_post_type` filter-hook. * * @param string $template The social template value. * @param string $template_option_name The subname of the option in which the template you want to get is saved. * @param string $post_type The name of the post type. * * @return string */ function wp_kama_wpseo_social_template_post_type_filter( $template, $template_option_name, $post_type ){ // filter... return $template; }
- $template(строка)
- The social template value.
По умолчанию: empty string - $template_option_name(строка)
- The subname of the option in which the template you want to get is saved.
- $post_type(строка)
- The name of the post type.
Где вызывается хук
yoast/src/editors/framework/seo/posts/social-data-provider.php 122
return \apply_filters( 'wpseo_social_template_post_type', '', $template_option_name, $this->post->post_type );