PATH:
home
/
letacommog
/
laperouse
/
wp-content
/
plugins
/
wordpress-seo
/
inc
<?php /** * WPSEO plugin file. * * @package WPSEO\Internals * @since 5.9.0 */ /** * Group of language utility methods for use by WPSEO. * All methods are static, this is just a sort of namespacing class wrapper. */ class WPSEO_Language_Utils { /** * Returns the language part of a given locale, defaults to english when the $locale is empty. * * @param string $locale The locale to get the language of. * * @return string The language part of the locale. */ public static function get_language( $locale = null ) { $language = 'en'; if ( empty( $locale ) || ! is_string( $locale ) ) { return $language; } $locale_parts = explode( '_', $locale ); if ( ! empty( $locale_parts[0] ) && ( strlen( $locale_parts[0] ) === 2 || strlen( $locale_parts[0] ) === 3 ) ) { $language = $locale_parts[0]; } return $language; } /** * Returns the user locale for the language to be used in the admin. * * WordPress 4.7 introduced the ability for users to specify an Admin language * different from the language used on the front end. This checks if the feature * is available and returns the user's language, with a fallback to the site's language. * Can be removed when support for WordPress 4.6 will be dropped, in favor * of WordPress get_user_locale() that already fallbacks to the site's locale. * * @return string The locale. */ public static function get_user_locale() { if ( function_exists( 'get_user_locale' ) ) { return get_user_locale(); } return get_locale(); } /** * Returns the full name for the sites' language. * * @return string The language name. */ public static function get_site_language_name() { require_once ABSPATH . 'wp-admin/includes/translation-install.php'; $translations = wp_get_available_translations(); $locale = get_locale(); $language = isset( $translations[ $locale ] ) ? $translations[ $locale ]['native_name'] : 'English (US)'; return $language; } /** * Returns the l10n array for the knowledge graph company info missing. * * @return array The l10n array. */ public static function get_knowledge_graph_company_info_missing_l10n() { return [ 'URL' => esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/3r3' ) ), /* translators: 1: expands to a link opening tag; 2: expands to a link closing tag */ 'message' => esc_html__( 'A company name and logo need to be set for structured data to work properly. %1$sLearn more about the importance of structured data.%2$s', 'wordpress-seo' ), ]; } }
[+]
..
[-] class-wpseo-utils.php
[edit]
[-] index.php
[edit]
[-] wpseo-functions-deprecated.php
[edit]
[+]
exceptions
[-] health-check-links-table-not-accessible.php
[edit]
[-] class-wpseo-image-utils.php
[edit]
[-] class-post-type.php
[edit]
[-] language-utils.php
[edit]
[-] class-wpseo-statistics.php
[edit]
[-] class-wpseo-primary-term.php
[edit]
[-] interface-wpseo-wordpress-integration.php
[edit]
[+]
sitemaps
[-] wpseo-non-ajax-functions.php
[edit]
[-] class-my-yoast-api-request.php
[edit]
[-] health-check-default-tagline.php
[edit]
[-] health-check-page-comments.php
[edit]
[-] class-wpseo-custom-fields.php
[edit]
[-] class-wpseo-custom-taxonomies.php
[edit]
[-] class-wpseo-content-images.php
[edit]
[-] health-check-postname-permalink.php
[edit]
[-] class-wpseo-shortlinker.php
[edit]
[-] class-rewrite.php
[edit]
[-] class-wpseo-rank.php
[edit]
[-] class-wpseo-replace-vars.php
[edit]
[-] interface-wpseo-wordpress-ajax-integration.php
[edit]
[-] class-wpseo-validator.php
[edit]
[-] date-helper.php
[edit]
[-] wpseo-functions.php
[edit]
[+]
options
[-] health-check-ryte.php
[edit]
[-] class-upgrade.php
[edit]
[-] class-wpseo-features.php
[edit]
[-] class-wpseo-installation.php
[edit]
[-] class-upgrade-history.php
[edit]
[-] class-wpseo-meta.php
[edit]
[-] class-wpseo-admin-bar-menu.php
[edit]
[-] health-check.php
[edit]
[-] class-addon-manager.php
[edit]
[-] health-check-curl-version.php
[edit]
[-] class-wpseo-replacement-variable.php
[edit]