Yoast\WP\SEO\Actions\Wincher

Wincher_Keyphrases_Action::untrack_keyphrase()publicYoast 1.0

Sends an untrack request for the passed keyword ID.

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

Хуков нет.

Возвращает

Объект. The response object.

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

$Wincher_Keyphrases_Action = new Wincher_Keyphrases_Action();
$Wincher_Keyphrases_Action->untrack_keyphrase( $keyphrase_id );
$keyphrase_id(int) (обязательный)
The ID of the keyphrase to untrack.

Код Wincher_Keyphrases_Action::untrack_keyphrase() Yoast 24.0

public function untrack_keyphrase( $keyphrase_id ) {
	try {
		$endpoint = \sprintf(
			self::KEYPHRASE_DELETE_URL,
			$this->options_helper->get( 'wincher_website_id' ),
			$keyphrase_id
		);

		$this->client->delete( $endpoint );

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