Version Description
- ADDED:
- Vendor/ACF: support ACF repeater field in builder mode.
- REVISED:
- Vendor/Yoast:
get_post_metadata
filter.
- Vendor/Yoast:
Download this release
Release Info
Developer | tivnet |
Plugin | WPGlobus – Multilingual Everything! |
Version | 2.1.3 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.1.3
- data/wpglobus-product-info.json +1 -1
- includes/admin/debug/class-wpglobus-admin-debug.php +17 -20
- includes/builders/class-wpglobus-config-builder.php +3 -0
- includes/class-wpglobus-config-vendor.php +12 -8
- includes/vendor/acf/class-wpglobus-acf.php +92 -11
- includes/vendor/yoast-seo/class-wpglobus-yoastseo80.php +15 -13
- languages/wpglobus.pot +1 -1
- readme.txt +8 -1
- 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-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.6"},"wpglobus-for-
|
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-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.6"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"1.2.2","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus 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":"4.9.8"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.0","_api_tested_up_to":"5.0.0"},"wpglobus-for-slider-revolution":{"title":"{:en}WPGlobus for Slider Revolution{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Slider Revolution{:}","_api_new_version":"1.6.0","_api_tested_up_to":"5.0.2"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.1.54","_api_tested_up_to":"5.0.3"}}
|
includes/admin/debug/class-wpglobus-admin-debug.php
CHANGED
@@ -117,7 +117,7 @@ if ( ! class_exists( 'WPGlobus_Admin_Debug' ) ) :
|
|
117 |
*/
|
118 |
public function on__admin_footer() {
|
119 |
|
120 |
-
global $post;
|
121 |
|
122 |
if ( ! is_object( $post ) ) {
|
123 |
return;
|
@@ -132,48 +132,45 @@ if ( ! class_exists( 'WPGlobus_Admin_Debug' ) ) :
|
|
132 |
*
|
133 |
* @var array $metas
|
134 |
*/
|
135 |
-
$
|
|
|
136 |
|
137 |
?>
|
138 |
<div id="wpglobus-admin-debug-box" class="" style="display:none;">
|
139 |
<h4>WPGlobus debug box</h4>
|
140 |
<?php
|
141 |
/**
|
142 |
-
*
|
143 |
*/
|
144 |
?>
|
145 |
<table class="table1" cellspacing="0">
|
146 |
-
<caption><?php echo '
|
147 |
<thead>
|
148 |
<tr>
|
149 |
-
<th>№</th>
|
150 |
-
<th>meta</th>
|
151 |
-
<th>value</th>
|
152 |
</tr>
|
153 |
</thead>
|
154 |
<tbody>
|
155 |
<?php
|
156 |
$order = 1;
|
157 |
|
158 |
-
foreach ( $metas as $
|
159 |
$code = false;
|
160 |
if ( is_array( $meta ) ) {
|
161 |
-
|
162 |
-
$meta[ $key ] = htmlspecialchars( $val );
|
163 |
-
}
|
164 |
-
} elseif ( is_string( $meta ) ) {
|
165 |
-
$meta = htmlspecialchars( $meta );
|
166 |
}
|
167 |
?>
|
168 |
<tr>
|
169 |
<td><?php echo esc_html( $order ); ?></td>
|
170 |
-
<td><?php echo esc_html( print_r( $meta_key, true ) ); ?></td>
|
171 |
<?php if ( $code ) { ?>
|
172 |
<td>
|
173 |
-
<pre><?php echo esc_html( print_r( $meta, true ) ); ?></pre>
|
174 |
</td>
|
175 |
<?php } else { ?>
|
176 |
-
<td><?php echo esc_html( print_r( $meta, true ) ); ?></td>
|
177 |
<?php } ?>
|
178 |
</tr>
|
179 |
<?php $order ++; ?>
|
@@ -189,13 +186,13 @@ if ( ! class_exists( 'WPGlobus_Admin_Debug' ) ) :
|
|
189 |
$results = $wpdb->get_results( $query );
|
190 |
?>
|
191 |
<table class="table2" cellspacing="0">
|
192 |
-
<caption><?php echo '"SELECT * FROM $wpdb->options WHERE option_name LIKE \'%wpglobus%\'"'; ?></caption>
|
193 |
<caption><?php echo 'Option count: ' . count( $results ); ?></caption>
|
194 |
<thead>
|
195 |
<tr>
|
196 |
-
<th>Option ID</th>
|
197 |
-
<th>Option Name</th>
|
198 |
-
<th>Option Value</th>
|
199 |
</tr>
|
200 |
</thead>
|
201 |
<tbody>
|
117 |
*/
|
118 |
public function on__admin_footer() {
|
119 |
|
120 |
+
global $wpdb, $post;
|
121 |
|
122 |
if ( ! is_object( $post ) ) {
|
123 |
return;
|
132 |
*
|
133 |
* @var array $metas
|
134 |
*/
|
135 |
+
$query = $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d", $post->ID );
|
136 |
+
$metas = $wpdb->get_results( $query, ARRAY_A );
|
137 |
|
138 |
?>
|
139 |
<div id="wpglobus-admin-debug-box" class="" style="display:none;">
|
140 |
<h4>WPGlobus debug box</h4>
|
141 |
<?php
|
142 |
/**
|
143 |
+
* Output metadata.
|
144 |
*/
|
145 |
?>
|
146 |
<table class="table1" cellspacing="0">
|
147 |
+
<caption><strong><?php echo '"' . $query . '"'; ?></strong></caption>
|
148 |
<thead>
|
149 |
<tr>
|
150 |
+
<th><strong>№</strong></th>
|
151 |
+
<th><strong>meta</strong></th>
|
152 |
+
<th><strong>value</strong></th>
|
153 |
</tr>
|
154 |
</thead>
|
155 |
<tbody>
|
156 |
<?php
|
157 |
$order = 1;
|
158 |
|
159 |
+
foreach ( $metas as $key=>$meta ) {
|
160 |
$code = false;
|
161 |
if ( is_array( $meta ) ) {
|
162 |
+
$metas[$key]['meta_key'] = htmlspecialchars( $meta['meta_value'] );
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
?>
|
165 |
<tr>
|
166 |
<td><?php echo esc_html( $order ); ?></td>
|
167 |
+
<td><?php echo esc_html( print_r( $meta[ 'meta_key' ], true ) ); ?></td>
|
168 |
<?php if ( $code ) { ?>
|
169 |
<td>
|
170 |
+
<pre><?php echo esc_html( print_r( $meta[ 'meta_value' ], true ) ); ?></pre>
|
171 |
</td>
|
172 |
<?php } else { ?>
|
173 |
+
<td><?php echo esc_html( print_r( $meta[ 'meta_value' ], true ) ); ?></td>
|
174 |
<?php } ?>
|
175 |
</tr>
|
176 |
<?php $order ++; ?>
|
186 |
$results = $wpdb->get_results( $query );
|
187 |
?>
|
188 |
<table class="table2" cellspacing="0">
|
189 |
+
<caption><strong><?php echo '"SELECT * FROM $wpdb->options WHERE option_name LIKE \'%wpglobus%\'"'; ?></strong></caption>
|
190 |
<caption><?php echo 'Option count: ' . count( $results ); ?></caption>
|
191 |
<thead>
|
192 |
<tr>
|
193 |
+
<th><strong>Option ID</strong></th>
|
194 |
+
<th><strong>Option Name</strong></th>
|
195 |
+
<th><strong>Option Value</strong></th>
|
196 |
</tr>
|
197 |
</thead>
|
198 |
<tbody>
|
includes/builders/class-wpglobus-config-builder.php
CHANGED
@@ -10,6 +10,9 @@ if ( ! class_exists( 'WPGlobus_Config_Builder' ) ) :
|
|
10 |
|
11 |
class WPGlobus_Config_Builder {
|
12 |
|
|
|
|
|
|
|
13 |
protected $id = false;
|
14 |
|
15 |
protected $is_run = false;
|
10 |
|
11 |
class WPGlobus_Config_Builder {
|
12 |
|
13 |
+
/**
|
14 |
+
* @var string|false
|
15 |
+
*/
|
16 |
protected $id = false;
|
17 |
|
18 |
protected $is_run = false;
|
includes/class-wpglobus-config-vendor.php
CHANGED
@@ -192,23 +192,24 @@ if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
|
|
192 |
// if ( defined('SITEORIGIN_PANELS_VERSION') ) {
|
193 |
// self::$vendors[] = 'siteorigin-panels.json';
|
194 |
// }
|
195 |
-
|
|
|
|
|
196 |
if ( self::$builder->get_id() != '' && self::$builder->is_builder_page() ) {
|
197 |
|
198 |
$addons = WPGlobus_Builders::get_addons();
|
199 |
-
|
200 |
-
if ( ! empty($addons) ) {
|
201 |
-
foreach( $addons as $id
|
202 |
-
if ( 'add-on'
|
203 |
if ( ! empty( $addon['const'] ) && defined( $addon['const'] ) ) {
|
204 |
self::$vendors[] = $addon['config_file'];
|
205 |
}
|
206 |
}
|
207 |
}
|
208 |
}
|
|
|
209 |
|
210 |
-
}
|
211 |
-
|
212 |
/**
|
213 |
* Now handle with config files.
|
214 |
*/
|
@@ -282,7 +283,10 @@ if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
|
|
282 |
/** @noinspection PhpIncludeInspection */
|
283 |
include_once $file;
|
284 |
if ( ! empty( $class ) && class_exists( $class ) ) {
|
285 |
-
|
|
|
|
|
|
|
286 |
}
|
287 |
}
|
288 |
|
192 |
// if ( defined('SITEORIGIN_PANELS_VERSION') ) {
|
193 |
// self::$vendors[] = 'siteorigin-panels.json';
|
194 |
// }
|
195 |
+
|
196 |
+
// TODO: builder ID can be a string or `false`. Need to refactor this condition or the `get_id` method.
|
197 |
+
// phpcs:ignore WordPress.PHP.StrictComparisons
|
198 |
if ( self::$builder->get_id() != '' && self::$builder->is_builder_page() ) {
|
199 |
|
200 |
$addons = WPGlobus_Builders::get_addons();
|
201 |
+
|
202 |
+
if ( ! empty( $addons ) ) {
|
203 |
+
foreach ( $addons as $id => $addon ) {
|
204 |
+
if ( 'add-on' === $addon['role'] ) {
|
205 |
if ( ! empty( $addon['const'] ) && defined( $addon['const'] ) ) {
|
206 |
self::$vendors[] = $addon['config_file'];
|
207 |
}
|
208 |
}
|
209 |
}
|
210 |
}
|
211 |
+
}
|
212 |
|
|
|
|
|
213 |
/**
|
214 |
* Now handle with config files.
|
215 |
*/
|
283 |
/** @noinspection PhpIncludeInspection */
|
284 |
include_once $file;
|
285 |
if ( ! empty( $class ) && class_exists( $class ) ) {
|
286 |
+
/**
|
287 |
+
* @since 2.1.3 Added post type parameter.
|
288 |
+
*/
|
289 |
+
$_post_meta_fields = $class::get_post_meta_fields( self::$builder->get( 'post_id' ), self::$builder->get( 'post_type' ) );
|
290 |
}
|
291 |
}
|
292 |
|
includes/vendor/acf/class-wpglobus-acf.php
CHANGED
@@ -63,18 +63,30 @@ class WPGlobus_Acf_2 {
|
|
63 |
}
|
64 |
return false;
|
65 |
}
|
66 |
-
|
67 |
/**
|
68 |
* Get post meta.
|
69 |
*
|
70 |
* Don't use get_field_objects() to get ACF fields @see advanced-custom-fields\includes\api\api-template.php
|
71 |
* to prevent incorrect behavior on post page.
|
|
|
|
|
|
|
|
|
72 |
*/
|
73 |
-
public static function get_post_meta_fields( $post_id ) {
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
global $wpdb;
|
76 |
|
77 |
-
$_post_meta_fields
|
|
|
78 |
|
79 |
$post_id = (int) $post_id;
|
80 |
|
@@ -88,10 +100,10 @@ class WPGlobus_Acf_2 {
|
|
88 |
* @todo Check the case when DB has many records with 'acf-field' post type.
|
89 |
*/
|
90 |
$fields = $wpdb->get_results($wpdb->prepare(
|
91 |
-
"SELECT post_excerpt, post_name FROM $wpdb->posts WHERE post_type = '%s'",
|
92 |
'acf-field'
|
93 |
) );
|
94 |
-
|
95 |
if ( ! empty($fields) ) {
|
96 |
|
97 |
/**
|
@@ -106,23 +118,92 @@ class WPGlobus_Acf_2 {
|
|
106 |
|
107 |
self::$post_multilingual_fields = array();
|
108 |
|
|
|
|
|
109 |
foreach( $fields as $key=>$field ) :
|
110 |
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
if ( empty($_acf_field['type']) ) {
|
114 |
continue;
|
115 |
}
|
116 |
|
117 |
-
if ( $_acf_field['type']
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
} else {
|
120 |
-
|
|
|
121 |
self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $field->post_name;
|
|
|
122 |
}
|
123 |
self::$acf_fields[$field->post_excerpt] = $_acf_field;
|
124 |
|
125 |
endforeach;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
}
|
127 |
}
|
128 |
}
|
63 |
}
|
64 |
return false;
|
65 |
}
|
66 |
+
|
67 |
/**
|
68 |
* Get post meta.
|
69 |
*
|
70 |
* Don't use get_field_objects() to get ACF fields @see advanced-custom-fields\includes\api\api-template.php
|
71 |
* to prevent incorrect behavior on post page.
|
72 |
+
* Don't call WPGlobus::Config() inside function to prevent the resetting of `meta` property.
|
73 |
+
*
|
74 |
+
* @param $post_id
|
75 |
+
* @param string $post_type @since 2.1.3
|
76 |
*/
|
77 |
+
public static function get_post_meta_fields( $post_id, $post_type = 'post' ) {
|
78 |
+
|
79 |
+
if ( in_array( $post_type, array('acf-field-group', 'acf-field') ) ) {
|
80 |
+
/**
|
81 |
+
* Prevent working with own post type.
|
82 |
+
*/
|
83 |
+
return array();
|
84 |
+
}
|
85 |
+
|
86 |
global $wpdb;
|
87 |
|
88 |
+
$_post_meta_fields = array();
|
89 |
+
$_post_meta_fields_temp = array();
|
90 |
|
91 |
$post_id = (int) $post_id;
|
92 |
|
100 |
* @todo Check the case when DB has many records with 'acf-field' post type.
|
101 |
*/
|
102 |
$fields = $wpdb->get_results($wpdb->prepare(
|
103 |
+
"SELECT ID, post_excerpt, post_name, post_parent FROM $wpdb->posts WHERE post_type = '%s'",
|
104 |
'acf-field'
|
105 |
) );
|
106 |
+
|
107 |
if ( ! empty($fields) ) {
|
108 |
|
109 |
/**
|
118 |
|
119 |
self::$post_multilingual_fields = array();
|
120 |
|
121 |
+
$repeaters = array();
|
122 |
+
|
123 |
foreach( $fields as $key=>$field ) :
|
124 |
|
125 |
+
/**
|
126 |
+
* Because incorrect behaviour don't use
|
127 |
+
* $_acf_field = acf_maybe_get_field( $field->post_name, $post_id );
|
128 |
+
* and
|
129 |
+
* $_acf_field = acf_get_field($field->post_name);
|
130 |
+
*/
|
131 |
+
$_acf_field = _acf_get_field_by_key( $field->post_name );
|
132 |
+
|
133 |
if ( empty($_acf_field['type']) ) {
|
134 |
continue;
|
135 |
}
|
136 |
|
137 |
+
if ( 'wysiwyg' == $_acf_field['type'] && ! $field_wysiwyg_enabled ) {
|
138 |
+
/**
|
139 |
+
* do nothing.
|
140 |
+
*/
|
141 |
+
} else if( 'repeater' == $_acf_field['type'] ) {
|
142 |
+
/**
|
143 |
+
* Get repeater to process it later.
|
144 |
+
*/
|
145 |
+
$repeaters[ $_acf_field['name'] ] = $_acf_field;
|
146 |
} else {
|
147 |
+
|
148 |
+
$_post_meta_fields_temp[$field->post_excerpt] = $field->post_excerpt;
|
149 |
self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $field->post_name;
|
150 |
+
|
151 |
}
|
152 |
self::$acf_fields[$field->post_excerpt] = $_acf_field;
|
153 |
|
154 |
endforeach;
|
155 |
+
|
156 |
+
if ( empty( $repeaters ) ) {
|
157 |
+
|
158 |
+
$_post_meta_fields = $_post_meta_fields_temp;
|
159 |
+
|
160 |
+
} else {
|
161 |
+
|
162 |
+
$meta_data = get_metadata( 'post', $post_id );
|
163 |
+
|
164 |
+
foreach( $repeaters as $key=>$repeater ) :
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Get fields that the repeater contains.
|
168 |
+
* @see advanced-custom-fields\includes\api\api-field.php
|
169 |
+
* @see advanced-custom-fields-pro\includes\api\api-field.php
|
170 |
+
*/
|
171 |
+
$repeater_fields = acf_get_fields_by_id( $repeater['ID'] );
|
172 |
+
|
173 |
+
if ( ! empty($repeater_fields) ) {
|
174 |
+
|
175 |
+
foreach( $repeater_fields as $_key=>$_field ) {
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Unset unneeded field.
|
179 |
+
*/
|
180 |
+
unset( $_post_meta_fields_temp[ $_field['name'] ] );
|
181 |
+
|
182 |
+
foreach( $meta_data as $meta=>$data ) {
|
183 |
+
|
184 |
+
if ( 0 == strpos( $meta, $repeater['name'] ) && false !== strpos( $meta, $_field['name'] ) ) {
|
185 |
+
$_post_meta_fields_temp[$meta] = $meta;
|
186 |
+
|
187 |
+
/**
|
188 |
+
* @todo W.I.P.
|
189 |
+
*/
|
190 |
+
//self::$acf_fields[ $_field['name'] ]['wpglobus'] = array();
|
191 |
+
|
192 |
+
$_key = str_replace( array($repeater['name'] . '_', '_' . $_field['name']), '', $meta );
|
193 |
+
self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $repeater['key'] . '-' . $_key . '-' . $_field['key'];
|
194 |
+
}
|
195 |
+
|
196 |
+
}
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
}
|
201 |
+
|
202 |
+
endforeach;
|
203 |
+
|
204 |
+
$_post_meta_fields = $_post_meta_fields_temp;
|
205 |
+
|
206 |
+
}
|
207 |
}
|
208 |
}
|
209 |
}
|
includes/vendor/yoast-seo/class-wpglobus-yoastseo80.php
CHANGED
@@ -122,8 +122,8 @@ class WPGlobus_YoastSEO {
|
|
122 |
|
123 |
/**
|
124 |
* @todo check for '_yoast_wpseo_title' meta
|
125 |
-
* @see <title> view-source:http://
|
126 |
-
* @see <title> view-source:http://
|
127 |
*/
|
128 |
add_filter( 'get_post_metadata', array( __CLASS__, 'filter__get_post_metadata' ), 6, 4 );
|
129 |
|
@@ -161,10 +161,11 @@ class WPGlobus_YoastSEO {
|
|
161 |
* Filter post meta.
|
162 |
*
|
163 |
* @since 1.9.21
|
|
|
164 |
* @see function function get_value() in wordpress-seo\inc\class-wpseo-meta.php
|
165 |
*/
|
166 |
public static function filter__get_post_metadata( $check, $object_id, $meta_key, $single ) {
|
167 |
-
|
168 |
global $post;
|
169 |
|
170 |
if ( $single ) {
|
@@ -179,25 +180,26 @@ class WPGlobus_YoastSEO {
|
|
179 |
return $check;
|
180 |
}
|
181 |
|
182 |
-
$meta_type = 'post';
|
183 |
-
|
184 |
/**
|
185 |
* May be called many times on one page. Let's cache.
|
186 |
*/
|
187 |
-
static $
|
188 |
-
if (
|
189 |
-
return $
|
190 |
-
}
|
|
|
|
|
191 |
|
192 |
$meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
|
193 |
-
|
194 |
if ( ! empty($meta_cache['_yoast_wpseo_title'][0]) ) {
|
195 |
$meta_cache['_yoast_wpseo_title'][0] = WPGlobus_Core::text_filter( $meta_cache['_yoast_wpseo_title'][0], WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY );
|
|
|
196 |
}
|
197 |
-
|
198 |
-
$_cache[ $meta_type ][ $object_id ] = $meta_cache;
|
199 |
|
200 |
-
|
|
|
|
|
201 |
|
202 |
}
|
203 |
|
122 |
|
123 |
/**
|
124 |
* @todo check for '_yoast_wpseo_title' meta
|
125 |
+
* @see <title> view-source:http://test/test-post-seo/
|
126 |
+
* @see <title> view-source:http://test/ru/test-post-seo/
|
127 |
*/
|
128 |
add_filter( 'get_post_metadata', array( __CLASS__, 'filter__get_post_metadata' ), 6, 4 );
|
129 |
|
161 |
* Filter post meta.
|
162 |
*
|
163 |
* @since 1.9.21
|
164 |
+
* @since 2.1.3
|
165 |
* @see function function get_value() in wordpress-seo\inc\class-wpseo-meta.php
|
166 |
*/
|
167 |
public static function filter__get_post_metadata( $check, $object_id, $meta_key, $single ) {
|
168 |
+
|
169 |
global $post;
|
170 |
|
171 |
if ( $single ) {
|
180 |
return $check;
|
181 |
}
|
182 |
|
|
|
|
|
183 |
/**
|
184 |
* May be called many times on one page. Let's cache.
|
185 |
*/
|
186 |
+
static $_done = null;
|
187 |
+
if ( ! is_null($_done) ) {
|
188 |
+
return $check;
|
189 |
+
}
|
190 |
+
|
191 |
+
$meta_type = 'post';
|
192 |
|
193 |
$meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
|
194 |
+
|
195 |
if ( ! empty($meta_cache['_yoast_wpseo_title'][0]) ) {
|
196 |
$meta_cache['_yoast_wpseo_title'][0] = WPGlobus_Core::text_filter( $meta_cache['_yoast_wpseo_title'][0], WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY );
|
197 |
+
wp_cache_replace( $object_id, $meta_cache, $meta_type . '_meta' );
|
198 |
}
|
|
|
|
|
199 |
|
200 |
+
$_done = true;
|
201 |
+
|
202 |
+
return $check;
|
203 |
|
204 |
}
|
205 |
|
languages/wpglobus.pot
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the WPGlobus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
1 |
+
# Copyright (C) 2019 WPGlobus
|
2 |
# This file is distributed under the same license as the WPGlobus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: tivnetinc, alexgff, tivnet
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
|
4 |
Tags: WPGlobus, localization, multilanguage, multilingual, translate
|
5 |
Requires at least: 4.9
|
6 |
-
Tested up to: 5.0.
|
7 |
Requires PHP: 5.6
|
8 |
Stable tag: trunk
|
9 |
License: GPL-3.0-or-later
|
@@ -216,6 +216,13 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
|
|
216 |
|
217 |
== Changelog ==
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
= 2.1.2 =
|
220 |
|
221 |
* FIXED:
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
|
4 |
Tags: WPGlobus, localization, multilanguage, multilingual, translate
|
5 |
Requires at least: 4.9
|
6 |
+
Tested up to: 5.0.3
|
7 |
Requires PHP: 5.6
|
8 |
Stable tag: trunk
|
9 |
License: GPL-3.0-or-later
|
216 |
|
217 |
== Changelog ==
|
218 |
|
219 |
+
= 2.1.3 =
|
220 |
+
|
221 |
+
* ADDED:
|
222 |
+
* Vendor/ACF: support ACF repeater field in builder mode.
|
223 |
+
* REVISED:
|
224 |
+
* Vendor/Yoast: `get_post_metadata` filter.
|
225 |
+
|
226 |
= 2.1.2 =
|
227 |
|
228 |
* FIXED:
|
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.1.
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
42 |
exit;
|
43 |
}
|
44 |
|
45 |
-
define( 'WPGLOBUS_VERSION', '2.1.
|
46 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
47 |
|
48 |
/**
|
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.1.3
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
42 |
exit;
|
43 |
}
|
44 |
|
45 |
+
define( 'WPGLOBUS_VERSION', '2.1.3' );
|
46 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
47 |
|
48 |
/**
|