PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / helpers / schema / id-helper.php

id-helper.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.5, at src/helpers/schema/id-helper.php

30 lines 691 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Helpers\Schema;
4
5 use Yoast\WP\SEO\Config\Schema_IDs;
6 use Yoast\WP\SEO\Context\Meta_Tags_Context;
7
8 /**
9 * Schema utility functions.
10 */
11 class ID_Helper {
12
13 /**
14 * Retrieve a users Schema ID.
15 *
16 * @param int $user_id The ID of the User you need a Schema ID for.
17 * @param Meta_Tags_Context $context A value object with context variables.
18 *
19 * @return string The user's schema ID.
20 */
21 public function get_user_schema_id( $user_id, $context ) {
22 $user = \get_userdata( $user_id );
23 if ( \is_a( $user, 'WP_User' ) ) {
24 return $context->site_url . Schema_IDs::PERSON_HASH . \wp_hash( $user->user_login . $user_id );
25 }
26
27 return '';
28 }
29 }
30