Version Description
- (Vendor/Yoast) Added filters for the taxonomy title, description, Open Graph title and description.
- (Vendor/Yoast) Fixed filter for the post title.
Download this release
Release Info
Developer | tivnet |
Plugin | WPGlobus – Multilingual Everything! |
Version | 2.5.22 |
Comparing to | |
See all releases |
Code changes from version 2.5.21 to 2.5.22
- data/wpglobus-product-info.json +1 -1
- includes/vendor/yoast-seo/class-wpglobus-yoastseo140.php +164 -94
- languages/wpglobus.pot +3 -3
- readme.txt +5 -0
- wpglobus.php +2 -2
data/wpglobus-product-info.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.4.0"},"wpglobus-
|
1 |
+
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.4.0"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5.1"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.5.1","_api_tested_up_to":"5.5.1"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.3.0","_api_tested_up_to":"5.5"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"4.1.0","_api_tested_up_to":"5.5.3"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.5"}}
|
includes/vendor/yoast-seo/class-wpglobus-yoastseo140.php
CHANGED
@@ -138,7 +138,12 @@ class WPGlobus_YoastSEO {
|
|
138 |
* Filter SEO title and meta description on front only, when the page header HTML tags are generated.
|
139 |
* AJAX is probably not required (waiting for a case).
|
140 |
*/
|
141 |
-
add_filter( 'wpseo_title', array( __CLASS__, 'filter__title' ), PHP_INT_MAX );
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
/**
|
144 |
* Filter meta description.
|
@@ -212,6 +217,7 @@ class WPGlobus_YoastSEO {
|
|
212 |
}
|
213 |
|
214 |
/**
|
|
|
215 |
* Filter Yoast post meta title.
|
216 |
*
|
217 |
* @scope front
|
@@ -223,7 +229,7 @@ class WPGlobus_YoastSEO {
|
|
223 |
* @return string.
|
224 |
*/
|
225 |
public static function filter__title( $title ) {
|
226 |
-
|
227 |
/**
|
228 |
* In some cases we can get $title like {:en}En title{:}{:ru}Ru title{:}{:fr}Fr title{:} - SiteTitle
|
229 |
* so, let's filter.
|
@@ -305,6 +311,28 @@ class WPGlobus_YoastSEO {
|
|
305 |
$description = wpseo_replace_vars( $description, $presentation->source );
|
306 |
}
|
307 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
}
|
309 |
|
310 |
return $description;
|
@@ -500,8 +528,21 @@ class WPGlobus_YoastSEO {
|
|
500 |
$title = wpseo_replace_vars( $title, $presentation->source );
|
501 |
}
|
502 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
}
|
504 |
-
|
505 |
return $title;
|
506 |
}
|
507 |
|
@@ -575,54 +616,6 @@ class WPGlobus_YoastSEO {
|
|
575 |
return WPGlobus_Core::text_filter($keywords, WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY);
|
576 |
}
|
577 |
|
578 |
-
/**
|
579 |
-
* @obsolete
|
580 |
-
*
|
581 |
-
* Fix empty yoast_wpseo_focuskw while saving/updating post with active extra language.
|
582 |
-
*
|
583 |
-
* @since 1.6.3
|
584 |
-
* @since 1.7.7
|
585 |
-
* @see filter 'wpseo_save_compare_data' wordpress-seo\admin\metabox\class-metabox.php
|
586 |
-
*
|
587 |
-
* @param WP_Post Object $post Current post.
|
588 |
-
*/
|
589 |
-
public static function action__save_compare_data( $post ) {
|
590 |
-
// @see wpglobus\includes\vendor\yoast-seo\class-wpglobus-yoastseo120.php
|
591 |
-
}
|
592 |
-
|
593 |
-
/**
|
594 |
-
* @obsolete
|
595 |
-
*
|
596 |
-
* Filter to get yoast seo separator.
|
597 |
-
*
|
598 |
-
* @since 1.5.3
|
599 |
-
*
|
600 |
-
* @param array $sep Contains separator.
|
601 |
-
*
|
602 |
-
* @return string
|
603 |
-
*/
|
604 |
-
public static function filter__get_separator( $sep ) {
|
605 |
-
// @see wpglobus\includes\vendor\yoast-seo\class-wpglobus-yoastseo120.php
|
606 |
-
}
|
607 |
-
|
608 |
-
/**
|
609 |
-
* @obsolete
|
610 |
-
*
|
611 |
-
* Filter which editor should be displayed by default.
|
612 |
-
*
|
613 |
-
* @since 1.4.8
|
614 |
-
*
|
615 |
-
* @param array $editors An array of editors. Accepts 'tinymce', 'html', 'test'.
|
616 |
-
*
|
617 |
-
* @return string
|
618 |
-
*/
|
619 |
-
public static function set_default_editor(
|
620 |
-
/** @noinspection PhpUnusedParameterInspection */
|
621 |
-
$editors
|
622 |
-
) {
|
623 |
-
// @see wpglobus\includes\vendor\yoast-seo\class-wpglobus-yoastseo120.php
|
624 |
-
}
|
625 |
-
|
626 |
/**
|
627 |
* Filter wpseo meta description.
|
628 |
*
|
@@ -694,9 +687,15 @@ class WPGlobus_YoastSEO {
|
|
694 |
|
695 |
} else {
|
696 |
|
697 |
-
|
|
|
|
|
|
|
|
|
698 |
if ( empty($description) ) {
|
699 |
$meta_description_presenter_was_fired = true;
|
|
|
|
|
700 |
}
|
701 |
}
|
702 |
}
|
@@ -805,7 +804,7 @@ class WPGlobus_YoastSEO {
|
|
805 |
* @param $output The HTML output
|
806 |
* @param Indexable_Presentation $presentation The presentation of an indexable.
|
807 |
*
|
808 |
-
* @api string $output The HTML output.
|
809 |
*
|
810 |
* @return string
|
811 |
*/
|
@@ -847,16 +846,16 @@ class WPGlobus_YoastSEO {
|
|
847 |
foreach( $presentation->breadcrumbs as $order=>$piece ) {
|
848 |
|
849 |
if ( $order == 0 ) {
|
|
|
|
|
850 |
|
851 |
if ( empty( $piece['id'] ) ) {
|
852 |
/**
|
853 |
* If homepage displays as latest posts, then we should force the setting of `Home` for all languages.
|
854 |
*/
|
855 |
-
$output =
|
856 |
} else {
|
857 |
-
|
858 |
-
$output = str_replace( $piece['url'], home_url('/'), $output );
|
859 |
-
}
|
860 |
}
|
861 |
|
862 |
if ( WPGlobus_Core::has_translations($piece['text']) ) {
|
@@ -1082,10 +1081,17 @@ class WPGlobus_YoastSEO {
|
|
1082 |
/**
|
1083 |
* Get taxonomy meta from `wpseo_taxonomy_meta` option.
|
1084 |
*
|
1085 |
-
* @scope front
|
1086 |
* @since 2.5.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1087 |
*/
|
1088 |
-
protected static function get_taxonomy_meta( $object_sub_type, $object_id, $
|
1089 |
|
1090 |
if ( is_null( self::$wpseo_taxonomy_meta ) ) {
|
1091 |
self::$wpseo_taxonomy_meta = get_option( 'wpseo_taxonomy_meta' );
|
@@ -1095,34 +1101,21 @@ class WPGlobus_YoastSEO {
|
|
1095 |
return '';
|
1096 |
}
|
1097 |
|
1098 |
-
if ( empty(
|
1099 |
-
return
|
1100 |
}
|
1101 |
|
1102 |
-
|
1103 |
-
|
|
|
|
|
|
|
|
|
1104 |
WPGlobus::Config()->language,
|
1105 |
WPGlobus::RETURN_EMPTY
|
1106 |
-
);
|
1107 |
-
|
1108 |
-
return $
|
1109 |
-
}
|
1110 |
-
|
1111 |
-
/**
|
1112 |
-
* @obsolete
|
1113 |
-
*
|
1114 |
-
* To translate Yoast columns
|
1115 |
-
* @see WPSEO_Meta_Columns::column_content
|
1116 |
-
* @scope admin
|
1117 |
-
*
|
1118 |
-
* @param string $text
|
1119 |
-
*
|
1120 |
-
* @return string
|
1121 |
-
* @todo Yoast said things might change in the next version. See the pull request
|
1122 |
-
* @link https://github.com/Yoast/wordpress-seo/pull/1946
|
1123 |
-
*/
|
1124 |
-
public static function filter__wpseo_columns( $text ) {
|
1125 |
-
// @see wpglobus\includes\vendor\yoast-seo\class-wpglobus-yoastseo120.php
|
1126 |
}
|
1127 |
|
1128 |
/**
|
@@ -1378,15 +1371,6 @@ class WPGlobus_YoastSEO {
|
|
1378 |
}
|
1379 |
}
|
1380 |
|
1381 |
-
/**
|
1382 |
-
* @obsolete
|
1383 |
-
*
|
1384 |
-
* Add language tabs to wpseo metabox ( .wpseo-metabox-tabs-div )
|
1385 |
-
*/
|
1386 |
-
public static function action__wpseo_tab_content() {
|
1387 |
-
// @see wpglobus\includes\vendor\yoast-seo\class-wpglobus-yoastseo120.php
|
1388 |
-
}
|
1389 |
-
|
1390 |
/**
|
1391 |
* Check disabled entity.
|
1392 |
*
|
@@ -1482,7 +1466,7 @@ class WPGlobus_YoastSEO {
|
|
1482 |
* Taxonomy.
|
1483 |
* @since 2.5.1
|
1484 |
*/
|
1485 |
-
$graph_piece['description'] = self::get_taxonomy_meta( $context->indexable->object_sub_type, $context->indexable->object_id );
|
1486 |
$graph_piece['url'] = WPGlobus_Utils::localize_url( $graph_piece['url'], WPGlobus::Config()->language );
|
1487 |
$graph_piece['@id'] = WPGlobus_Utils::localize_url( $graph_piece['@id'], WPGlobus::Config()->language );
|
1488 |
$graph_piece['breadcrumb']['@id'] = WPGlobus_Utils::localize_url( $graph_piece['breadcrumb']['@id'], WPGlobus::Config()->language );
|
@@ -1490,7 +1474,93 @@ class WPGlobus_YoastSEO {
|
|
1490 |
|
1491 |
return $graph_piece;
|
1492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1493 |
|
1494 |
} // class WPGlobus_YoastSEO.
|
1495 |
|
1496 |
-
# --- EOF
|
138 |
* Filter SEO title and meta description on front only, when the page header HTML tags are generated.
|
139 |
* AJAX is probably not required (waiting for a case).
|
140 |
*/
|
141 |
+
// add_filter( 'wpseo_title', array( __CLASS__, 'filter__title' ), PHP_INT_MAX );
|
142 |
+
/**
|
143 |
+
* Filter title description.
|
144 |
+
* @since 2.5.22
|
145 |
+
*/
|
146 |
+
add_filter( 'wpseo_title', array( __CLASS__, 'filter_front__title' ), PHP_INT_MAX, 2 );
|
147 |
|
148 |
/**
|
149 |
* Filter meta description.
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
+
* obsolete @since 2.5.22
|
221 |
* Filter Yoast post meta title.
|
222 |
*
|
223 |
* @scope front
|
229 |
* @return string.
|
230 |
*/
|
231 |
public static function filter__title( $title ) {
|
232 |
+
|
233 |
/**
|
234 |
* In some cases we can get $title like {:en}En title{:}{:ru}Ru title{:}{:fr}Fr title{:} - SiteTitle
|
235 |
* so, let's filter.
|
311 |
$description = wpseo_replace_vars( $description, $presentation->source );
|
312 |
}
|
313 |
}
|
314 |
+
|
315 |
+
} elseif ( 'term' == $presentation->model->object_type ) {
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Taxonomy.
|
319 |
+
*/
|
320 |
+
$__desc = self::get_taxonomy_meta( $presentation->model->object_sub_type, $presentation->model->object_id, 'wpseo_desc' );
|
321 |
+
|
322 |
+
if ( empty( $__desc ) ) {
|
323 |
+
|
324 |
+
$__template = self::get_option( 'wpseo_titles', 'metadesc-tax-' . $presentation->model->object_sub_type );
|
325 |
+
|
326 |
+
if ( ! empty( $__template ) ) {
|
327 |
+
$__desc = $__template;
|
328 |
+
} else {
|
329 |
+
// @W.I.P if empty `Meta description` from Yoast, then we need output `Description` from Edit taxonomy page.
|
330 |
+
$__desc = $presentation->source->description;
|
331 |
+
}
|
332 |
+
|
333 |
+
}
|
334 |
+
|
335 |
+
$description = wpseo_replace_vars( $__desc, $presentation->source );
|
336 |
}
|
337 |
|
338 |
return $description;
|
528 |
$title = wpseo_replace_vars( $title, $presentation->source );
|
529 |
}
|
530 |
}
|
531 |
+
|
532 |
+
} elseif ( 'term' == $presentation->model->object_type ) {
|
533 |
+
|
534 |
+
/**
|
535 |
+
* Taxonomy.
|
536 |
+
*/
|
537 |
+
$__title = self::get_taxonomy_meta( $presentation->model->object_sub_type, $presentation->model->object_id, 'wpseo_title' );
|
538 |
+
|
539 |
+
if ( empty( $__title ) ) {
|
540 |
+
$__title = self::get_option( 'wpseo_titles', 'title-tax-' . $presentation->model->object_sub_type );
|
541 |
+
}
|
542 |
+
|
543 |
+
$title = wpseo_replace_vars( $__title, $presentation->source );
|
544 |
}
|
545 |
+
|
546 |
return $title;
|
547 |
}
|
548 |
|
616 |
return WPGlobus_Core::text_filter($keywords, WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY);
|
617 |
}
|
618 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
/**
|
620 |
* Filter wpseo meta description.
|
621 |
*
|
687 |
|
688 |
} else {
|
689 |
|
690 |
+
/**
|
691 |
+
* @since 2.5.22
|
692 |
+
*/
|
693 |
+
$description = self::get_taxonomy_meta( $presentation->model->object_sub_type, $presentation->model->object_id, 'wpseo_desc' );
|
694 |
+
|
695 |
if ( empty($description) ) {
|
696 |
$meta_description_presenter_was_fired = true;
|
697 |
+
} else {
|
698 |
+
$description = wpseo_replace_vars( $description, $presentation->source );
|
699 |
}
|
700 |
}
|
701 |
}
|
804 |
* @param $output The HTML output
|
805 |
* @param Indexable_Presentation $presentation The presentation of an indexable.
|
806 |
*
|
807 |
+
* @api string $output The HTML output.
|
808 |
*
|
809 |
* @return string
|
810 |
*/
|
846 |
foreach( $presentation->breadcrumbs as $order=>$piece ) {
|
847 |
|
848 |
if ( $order == 0 ) {
|
849 |
+
|
850 |
+
$_piece = '/' . preg_quote($piece['url'], '/') . '/';
|
851 |
|
852 |
if ( empty( $piece['id'] ) ) {
|
853 |
/**
|
854 |
* If homepage displays as latest posts, then we should force the setting of `Home` for all languages.
|
855 |
*/
|
856 |
+
$output = preg_replace( $_piece, home_url('/'), $output, 1 );
|
857 |
} else {
|
858 |
+
$output = preg_replace( $_piece, home_url('/'), $output, 1 );
|
|
|
|
|
859 |
}
|
860 |
|
861 |
if ( WPGlobus_Core::has_translations($piece['text']) ) {
|
1081 |
/**
|
1082 |
* Get taxonomy meta from `wpseo_taxonomy_meta` option.
|
1083 |
*
|
|
|
1084 |
* @since 2.5.1
|
1085 |
+
* @since 2.5.22 Added $meta_key parameter to the `get_taxonomy_meta` function.
|
1086 |
+
* @scope front
|
1087 |
+
*
|
1088 |
+
* @param string $object_sub_type The Indexable Object sub type.
|
1089 |
+
* @param string $object_id The object ID.
|
1090 |
+
* @param Indexable_Presentation $meta_key The WPSEO meta key.
|
1091 |
+
*
|
1092 |
+
* return string | array
|
1093 |
*/
|
1094 |
+
protected static function get_taxonomy_meta( $object_sub_type, $object_id, $meta_key = '' ) {
|
1095 |
|
1096 |
if ( is_null( self::$wpseo_taxonomy_meta ) ) {
|
1097 |
self::$wpseo_taxonomy_meta = get_option( 'wpseo_taxonomy_meta' );
|
1101 |
return '';
|
1102 |
}
|
1103 |
|
1104 |
+
if ( empty( $meta_key ) ) {
|
1105 |
+
return self::$wpseo_taxonomy_meta[ $object_sub_type ][ $object_id ];
|
1106 |
}
|
1107 |
|
1108 |
+
if ( empty( self::$wpseo_taxonomy_meta[ $object_sub_type ][ $object_id ][ $meta_key ] ) ) {
|
1109 |
+
return '';
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
$meta_value = WPGlobus_Core::text_filter(
|
1113 |
+
self::$wpseo_taxonomy_meta[ $object_sub_type ][ $object_id ][ $meta_key ],
|
1114 |
WPGlobus::Config()->language,
|
1115 |
WPGlobus::RETURN_EMPTY
|
1116 |
+
);
|
1117 |
+
|
1118 |
+
return $meta_value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1119 |
}
|
1120 |
|
1121 |
/**
|
1371 |
}
|
1372 |
}
|
1373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1374 |
/**
|
1375 |
* Check disabled entity.
|
1376 |
*
|
1466 |
* Taxonomy.
|
1467 |
* @since 2.5.1
|
1468 |
*/
|
1469 |
+
$graph_piece['description'] = self::get_taxonomy_meta( $context->indexable->object_sub_type, $context->indexable->object_id, 'wpseo_desc' );
|
1470 |
$graph_piece['url'] = WPGlobus_Utils::localize_url( $graph_piece['url'], WPGlobus::Config()->language );
|
1471 |
$graph_piece['@id'] = WPGlobus_Utils::localize_url( $graph_piece['@id'], WPGlobus::Config()->language );
|
1472 |
$graph_piece['breadcrumb']['@id'] = WPGlobus_Utils::localize_url( $graph_piece['breadcrumb']['@id'], WPGlobus::Config()->language );
|
1474 |
|
1475 |
return $graph_piece;
|
1476 |
}
|
1477 |
+
|
1478 |
+
/**
|
1479 |
+
* Filter for changing the Yoast SEO generated title.
|
1480 |
+
*
|
1481 |
+
* @see wordpress-seo\src\presenters\title-presenter.php
|
1482 |
+
*
|
1483 |
+
* @since 2.5.22
|
1484 |
+
*
|
1485 |
+
* @scope front
|
1486 |
+
*
|
1487 |
+
* @param string $title The title.
|
1488 |
+
* @param Indexable_Presentation $presentation The presentation of an indexable.
|
1489 |
+
*
|
1490 |
+
* @return string
|
1491 |
+
*/
|
1492 |
+
public static function filter_front__title( $title, $presentation ) {
|
1493 |
+
|
1494 |
+
if ( 'post' == $presentation->model->object_type ) {
|
1495 |
+
|
1496 |
+
/**
|
1497 |
+
* Post.
|
1498 |
+
*/
|
1499 |
+
$meta_cache = wp_cache_get( $presentation->model->object_id, 'post_meta' );
|
1500 |
+
|
1501 |
+
if ( ! empty( $meta_cache['_yoast_wpseo_title'][0] ) ) {
|
1502 |
+
|
1503 |
+
$__title = WPGlobus_Core::text_filter( $meta_cache['_yoast_wpseo_title'][0], WPGlobus::Config()->language );
|
1504 |
+
|
1505 |
+
if ( $presentation->source instanceof WP_Post ) {
|
1506 |
+
|
1507 |
+
if ( WPGlobus_Core::has_translations( $presentation->source->post_title ) ) {
|
1508 |
+
$presentation->source->post_title = WPGlobus_Core::text_filter( $presentation->source->post_title, WPGlobus::Config()->language );
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
/**
|
1512 |
+
* @see wordpress-seo\inc\wpseo-functions.php
|
1513 |
+
*/
|
1514 |
+
$title = wpseo_replace_vars( $__title, $presentation->source );
|
1515 |
+
}
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
} elseif ( 'term' == $presentation->model->object_type ) {
|
1519 |
+
|
1520 |
+
/**
|
1521 |
+
* Taxonomy.
|
1522 |
+
*/
|
1523 |
+
$__title = self::get_taxonomy_meta( $presentation->model->object_sub_type, $presentation->model->object_id, 'wpseo_title' );
|
1524 |
+
|
1525 |
+
if ( empty( $__title ) ) {
|
1526 |
+
$__title = self::get_option( 'wpseo_titles', 'title-tax-' . $presentation->model->object_sub_type );
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
$title = wpseo_replace_vars( $__title, $presentation->source );
|
1530 |
+
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
return $title;
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
/**
|
1537 |
+
* Get wpseo options.
|
1538 |
+
*
|
1539 |
+
* @since 2.5.22
|
1540 |
+
*
|
1541 |
+
* @return array|string
|
1542 |
+
*/
|
1543 |
+
public static function get_option( $option = 'wpseo_titles', $key = '' ) {
|
1544 |
+
|
1545 |
+
/**
|
1546 |
+
* @todo Maybe to use WPSEO_Options.
|
1547 |
+
* @see wordpress-seo\inc\options\class-wpseo-options.php
|
1548 |
+
* @since 2.5.22
|
1549 |
+
*/
|
1550 |
+
|
1551 |
+
$options = get_option( $option );
|
1552 |
+
|
1553 |
+
if ( empty( $key ) ) {
|
1554 |
+
return $options;
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
if ( ! isset( $options[$key] ) ) {
|
1558 |
+
return null;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
return $options[$key];
|
1562 |
+
}
|
1563 |
|
1564 |
} // class WPGlobus_YoastSEO.
|
1565 |
|
1566 |
+
# --- EOF
|
languages/wpglobus.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2020 WPGlobus 2.5.
|
2 |
-
# This file is distributed under the same license as the WPGlobus 2.5.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WPGlobus 2.5.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
1 |
+
# Copyright (C) 2020 WPGlobus 2.5.22
|
2 |
+
# This file is distributed under the same license as the WPGlobus 2.5.22 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WPGlobus 2.5.22\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
readme.txt
CHANGED
@@ -217,6 +217,11 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
|
|
217 |
|
218 |
== Changelog ==
|
219 |
|
|
|
|
|
|
|
|
|
|
|
220 |
= 2.5.21 =
|
221 |
|
222 |
* (Customizer) WPGlobus Customizer is switched off for the `NewYork City` theme.
|
217 |
|
218 |
== Changelog ==
|
219 |
|
220 |
+
= 2.5.22 =
|
221 |
+
|
222 |
+
* (Vendor/Yoast) Added filters for the taxonomy title, description, Open Graph title and description.
|
223 |
+
* (Vendor/Yoast) Fixed filter for the post title.
|
224 |
+
|
225 |
= 2.5.21 =
|
226 |
|
227 |
* (Customizer) WPGlobus Customizer is switched off for the `NewYork City` theme.
|
wpglobus.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
|
16 |
* Text Domain: wpglobus
|
17 |
* Domain Path: /languages/
|
18 |
-
* Version: 2.5.
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
-
define( 'WPGLOBUS_VERSION', '2.5.
|
48 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
49 |
define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
|
50 |
|
15 |
* Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
|
16 |
* Text Domain: wpglobus
|
17 |
* Domain Path: /languages/
|
18 |
+
* Version: 2.5.22
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
+
define( 'WPGLOBUS_VERSION', '2.5.22' );
|
48 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
49 |
define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
|
50 |
|