Yoast\WP\SEO\Context
Meta_Tags_Context::generate_site_represents()
Determines what our site represents, and grabs their values.
Метод класса: Meta_Tags_Context{}
Хуков нет.
Возвращает
Строку|false
. Person or company. False if invalid value.
Использование
$Meta_Tags_Context = new Meta_Tags_Context(); $Meta_Tags_Context->generate_site_represents();
Код Meta_Tags_Context::generate_site_represents() Meta Tags Context::generate site represents Yoast 24.4
public function generate_site_represents() { switch ( $this->options->get( 'company_or_person', false ) ) { case 'company': // Do not use a non-named company. if ( empty( $this->company_name ) ) { return false; } /* * Do not use a company without a logo. * The logic check is on `< 1` instead of `false` due to how `get_attachment_id_from_settings` works. */ if ( $this->company_logo_id < 1 ) { return false; } return 'company'; case 'person': // Do not use a non-existing user. if ( $this->site_user_id !== false && \get_user_by( 'id', $this->site_user_id ) === false ) { return false; } return 'person'; } return false; }