WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast\WP\SEO\Actions\Wincher

Wincher_Keyphrases_Action::get_tracked_keyphrases() public Yoast 1.0

Gets the keyphrase data for the passed keyphrases. Retrieves all available data if no keyphrases are provided.

{} Это метод класса: Wincher_Keyphrases_Action{}

Хуков нет.

Возвращает

Объект. The keyphrase chart data.

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

$Wincher_Keyphrases_Action = new Wincher_Keyphrases_Action();
$Wincher_Keyphrases_Action->get_tracked_keyphrases( $used_keyphrases, $permalink );
$used_keyphrases(массив)
The currently used keyphrases. Optional.
По умолчанию: null
$permalink(строка)
The current permalink. Optional.
По умолчанию: null

Код Wincher_Keyphrases_Action::get_tracked_keyphrases() Yoast 17.9

public function get_tracked_keyphrases( $used_keyphrases = null, $permalink = null ) {
	try {
		if ( $used_keyphrases === null ) {
			$used_keyphrases = $this->collect_all_keyphrases();
		}

		$endpoint = \sprintf(
			self::KEYPHRASES_URL,
			$this->options_helper->get( 'wincher_website_id' )
		);

		$results = $this->client->post(
			$endpoint,
			\WPSEO_Utils::format_json_encode(
				[
					'keywords' => $used_keyphrases,
					'url'      => $permalink,
				]
			),
			[
				'timeout' => 60,
			]
		);

		if ( ! \array_key_exists( 'data', $results ) ) {
			return $this->to_result_object( $results );
		}

		if ( ! empty( $used_keyphrases ) ) {
			$results['data'] = $this->filter_results_by_used_keyphrases( $results['data'], $used_keyphrases );
		}

		// Extract the positional data and assign it to the keyphrase.
		$results['data'] = \array_combine(
			\array_column( $results['data'], 'keyword' ),
			\array_values( $results['data'] )
		);

		return $this->to_result_object( $results );
	} catch ( Exception $e ) {
		return (object) [
			'error'  => $e->getMessage(),
			'status' => $e->getCode(),
		];
	}
}