Yoast\WP\SEO\Routes
Yoast_Head_REST_Field::for_post()
Returns the head for a post.
Метод класса: Yoast_Head_REST_Field{}
Хуков нет.
Возвращает
Строку|null
. The head.
Использование
$Yoast_Head_REST_Field = new Yoast_Head_REST_Field(); $Yoast_Head_REST_Field->for_post( $params, $format );
- $params(массив) (обязательный)
- The rest request params.
- $format(строка)
- The desired output format.
По умолчанию: self::YOAST_HEAD_ATTRIBUTE_NAME
Код Yoast_Head_REST_Field::for_post() Yoast Head REST Field::for post Yoast 23.4
public function for_post( $params, $format = self::YOAST_HEAD_ATTRIBUTE_NAME ) { if ( ! isset( $params['id'] ) ) { return null; } if ( ! $this->post_helper->is_post_indexable( $params['id'] ) ) { return null; } $obj = $this->head_action->for_post( $params['id'] ); return $this->render_object( $obj, $format ); }