Yoast\WP\SEO\Schema_Aggregator\Application\Enhancement

Person_Schema_Enhancer::get_person_job_titleprivateYoast 1.0

Get person job title

Retrieves job title from user meta.

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

Хуков нет.

Возвращает

Строку|null. Job title or null if unavailable.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_person_job_title( $user_id ): ?string;
$user_id(int) (обязательный)
User ID.

Код Person_Schema_Enhancer::get_person_job_title() Yoast 27.8

private function get_person_job_title( int $user_id ): ?string {
	$job_title = \get_user_meta( $user_id, 'job_title', true );

	if ( empty( $job_title ) ) {
		return null;
	}

	return \trim( $job_title );
}