Yoast\WP\SEO\Bulk_Editor\Infrastructure\Posts

Default_Template_Resolver::resolve_social_description │ public │ Yoast 1.0

Returns the raw social description 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. Unlike social title there is no installation-level 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_description( $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 description (empty string when never explicitly saved).

Код Default_Template_Resolver::resolve_social_description() Yoast 28.9

public function resolve_social_description( 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-description-', false );
}