| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Frontend\Schema |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Schema utility functions. |
| 10 |
* |
| 11 |
* @since 11.6 |
| 12 |
* @deprecated 14.0 |
| 13 |
*/ |
| 14 |
class WPSEO_Schema_Utils { |
| 15 |
|
| 16 |
/** |
| 17 |
* Retrieves a user's Schema ID. |
| 18 |
* |
| 19 |
* @deprecated 14.0 |
| 20 |
* @codeCoverageIgnore |
| 21 |
* |
| 22 |
* @param int $user_id The ID of the User you need a Schema ID for. |
| 23 |
* @param WPSEO_Schema_Context $context A value object with context variables. |
| 24 |
* |
| 25 |
* @return string The user's schema ID. |
| 26 |
*/ |
| 27 |
public static function get_user_schema_id( $user_id, $context ) { |
| 28 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->id->get_user_schema_id' ); |
| 29 |
return YoastSEO()->helpers->schema->id->get_user_schema_id( $user_id, $context ); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Retrieves the post title with fallback to `No title`. |
| 34 |
* |
| 35 |
* @deprecated 14.0 |
| 36 |
* @codeCoverageIgnore |
| 37 |
* |
| 38 |
* @param int $post_id Optional. Post ID. |
| 39 |
* |
| 40 |
* @return string The post title with fallback to `No title`. |
| 41 |
*/ |
| 42 |
public static function get_post_title_with_fallback( $post_id = 0 ) { |
| 43 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', ' YoastSEO()->helpers->post->get_post_title_with_fallback' ); |
| 44 |
return YoastSEO()->helpers->post->get_post_title_with_fallback( $post_id ); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Adds the `inLanguage` property to a Schema piece. |
| 49 |
* |
| 50 |
* Must use one of the language codes from the IETF BCP 47 standard. The |
| 51 |
* language tag syntax is made of one or more subtags separated by a hyphen |
| 52 |
* e.g. "en", "en-US", "zh-Hant-CN". |
| 53 |
* |
| 54 |
* @deprecated 14.0 |
| 55 |
* @codeCoverageIgnore |
| 56 |
* |
| 57 |
* @param array $data The Schema piece data. |
| 58 |
* |
| 59 |
* @return array The Schema piece data with added language property. |
| 60 |
*/ |
| 61 |
public static function add_piece_language( $data ) { |
| 62 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->language->add_piece_language' ); |
| 63 |
return YoastSEO()->helpers->schema->language->add_piece_language( $data ); |
| 64 |
} |
| 65 |
} |
| 66 |
|