Aioseo_Posts_Importing_Action::keyphrase_import()publicYoast 1.0

Plucks the keyphrase to be imported from the AIOSEO array of keyphrase meta data.

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

Хуков нет.


Строку|null. The plucked keyphrase.


$Aioseo_Posts_Importing_Action = new Aioseo_Posts_Importing_Action();
$Aioseo_Posts_Importing_Action->keyphrase_import( $aioseo_data, $aioseo_key );
$aioseo_data(массив) (обязательный)
All of the AIOSEO data to be imported.
$aioseo_key(строка) (обязательный)
The AIOSEO key that contains the setting we're working with, aka keyphrases.

Код Aioseo_Posts_Importing_Action::keyphrase_import() Yoast 22.0

public function keyphrase_import( $aioseo_data, $aioseo_key ) {
	$meta_data = \json_decode( $aioseo_data[ $aioseo_key ], true );
	if ( ! isset( $meta_data['focus']['keyphrase'] ) ) {
		return null;

	return $this->sanitization->sanitize_text_field( $meta_data['focus']['keyphrase'] );