Yoast\WP\SEO\Helpers

Indexable_To_Postmeta_Helper::map_column_to_postmeta │ public │ Yoast 1.0

Creates postmeta from a single indexable column.

Метод класса: Indexable_To_Postmeta_Helper{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

$Indexable_To_Postmeta_Helper = new Indexable_To_Postmeta_Helper();
$Indexable_To_Postmeta_Helper->map_column_to_postmeta( $indexable, $indexable_column, $delete_empty );
$indexable(Indexable) (обязательный)
The Yoast indexable.
$indexable_column(строка) (обязательный)
The indexable column to map.
$delete_empty(true|false)
Whether an empty value should delete the post meta key.
По умолчанию: false

Код Indexable_To_Postmeta_Helper::map_column_to_postmeta() Yoast 28.7

public function map_column_to_postmeta( $indexable, $indexable_column, $delete_empty = false ) {
	// The advanced-robots flags are persisted together under one meta key, so they cascade through it.
	if ( \in_array( $indexable_column, [ 'is_robots_noimageindex', 'is_robots_noarchive', 'is_robots_nosnippet' ], true ) ) {
		$indexable_column = 'meta_robots_adv';
	}

	if ( ! isset( $this->yoast_to_postmeta[ $indexable_column ] ) ) {
		return;
	}

	$map_info = $this->yoast_to_postmeta[ $indexable_column ];
	\call_user_func( [ $this, $map_info['map_method'] ], $indexable, $map_info['post_meta_key'], $indexable_column, $delete_empty );
}