Yoast\WP\SEO\Bulk_Editor\Infrastructure\Posts
Default_Template_Resolver::resolve_social_title
Returns the raw social title template for a post, falling back to the post type's configured template when empty.
Returns the unresolved template string so the caller can display it in a replacement-variable editor. Only resolves a template when OpenGraph is enabled. Priority: stored value → user-configured post type template (social-title-{post_type}) → installation default.
Метод класса: Default_Template_Resolver{}
Хуков нет.
Возвращает
string. The raw template string, or an empty string when no template is configured.
Использование
$Default_Template_Resolver = new Default_Template_Resolver(); $Default_Template_Resolver->resolve_social_title( $post_id, $post_type, $stored_value ): string;
- $post_id(int) (обязательный)
- The post ID (unused; kept for a consistent method signature).
- $post_type(строка) (обязательный)
- The post type slug.
- $stored_value(строка) (обязательный)
- The raw stored social title (empty string when never explicitly saved).
Код Default_Template_Resolver::resolve_social_title() Default Template Resolver::resolve social title Yoast 28.4
public function resolve_social_title( int $post_id, string $post_type, string $stored_value ): string {
if ( $stored_value !== '' ) {
return $stored_value;
}
if ( $this->options_helper->get( 'opengraph', false ) !== true ) {
return '';
}
return $this->resolve( $post_type, '', 'social-title-', true );
}