Version Description
- Diligence =
Release date:
- December 6th, 2017
Summarized:
- This update implements a workaround for an issue with bbPress, and various UI bugs have been fixed as well.
View the detailed log.
Download this release
Release Info
Developer | Cybr |
Plugin | The SEO Framework |
Version | 3.0.3 |
Comparing to | |
See all releases |
Code changes from version 3.0.2 to 3.0.3
- autodescription.php +2 -2
- inc/classes/admin-pages.class.php +13 -7
- inc/classes/deprecated.class.php +2012 -2012
- inc/classes/feed.class.php +184 -184
- inc/classes/site-options.class.php +1 -0
- inc/compat/plugin-bbpress.php +27 -0
- inc/views/inpost/seo-settings-tt.php +55 -45
- inc/views/metaboxes/title-metabox.php +26 -31
- lib/css/tsf-rtl.css +12 -6
- lib/css/tsf-rtl.min.css +1 -1
- lib/css/tsf.css +12 -6
- lib/css/tsf.min.css +1 -1
- lib/js/tsf.js +86 -31
- lib/js/tsf.min.js +1 -1
- readme.txt +24 -10
autodescription.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: The SEO Framework
|
4 |
* Plugin URI: https://theseoframework.com/
|
5 |
* Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.
|
6 |
-
* Version: 3.0.
|
7 |
* Author: Sybre Waaijer
|
8 |
* Author URI: https://theseoframework.com/
|
9 |
* License: GPLv3
|
@@ -51,7 +51,7 @@ defined( 'ABSPATH' ) or die;
|
|
51 |
*
|
52 |
* @since 1.0.0
|
53 |
*/
|
54 |
-
define( 'THE_SEO_FRAMEWORK_VERSION', '3.0.
|
55 |
|
56 |
/**
|
57 |
* The plugin Database version.
|
3 |
* Plugin Name: The SEO Framework
|
4 |
* Plugin URI: https://theseoframework.com/
|
5 |
* Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.
|
6 |
+
* Version: 3.0.3
|
7 |
* Author: Sybre Waaijer
|
8 |
* Author URI: https://theseoframework.com/
|
9 |
* License: GPLv3
|
51 |
*
|
52 |
* @since 1.0.0
|
53 |
*/
|
54 |
+
define( 'THE_SEO_FRAMEWORK_VERSION', '3.0.3' );
|
55 |
|
56 |
/**
|
57 |
* The plugin Database version.
|
inc/classes/admin-pages.class.php
CHANGED
@@ -471,18 +471,20 @@ class Admin_Pages extends Inpost {
|
|
471 |
}
|
472 |
|
473 |
/**
|
474 |
-
*
|
475 |
*
|
476 |
* @since 2.6.0
|
477 |
* @since 2.7.0 Added escape parameter. Defaults to true.
|
|
|
478 |
*
|
479 |
-
* @param string $field_id
|
480 |
-
* @param string $label
|
481 |
* @param string $description Addition description to place beneath the checkbox.
|
482 |
-
* @param bool
|
|
|
483 |
* @return string HTML checkbox output.
|
484 |
*/
|
485 |
-
public function make_checkbox( $field_id = '', $label = '', $description = '', $escape = true ) {
|
486 |
|
487 |
if ( $escape ) {
|
488 |
$description = \esc_html( $description );
|
@@ -492,12 +494,16 @@ class Admin_Pages extends Inpost {
|
|
492 |
$description = $description ? '<p class="description tsf-option-spacer">' . $description . '</p>' : '';
|
493 |
|
494 |
$output = '<span class="tsf-toblock">'
|
495 |
-
. '<label for="'
|
|
|
|
|
|
|
496 |
. '<input '
|
497 |
. 'type="checkbox" '
|
|
|
498 |
. 'name="' . $this->get_field_name( $field_id ) . '" '
|
499 |
. 'id="' . $this->get_field_id( $field_id ) . '" '
|
500 |
-
. $this->get_is_conditional_checked( $field_id ) . ' '
|
501 |
. 'value="1" '
|
502 |
. \checked( $this->get_field_value( $field_id ), true, false ) .
|
503 |
' />'
|
471 |
}
|
472 |
|
473 |
/**
|
474 |
+
* Returns a chechbox wrapper.
|
475 |
*
|
476 |
* @since 2.6.0
|
477 |
* @since 2.7.0 Added escape parameter. Defaults to true.
|
478 |
+
* @since 3.0.3 Added $disabled parameter. Defaults to false.
|
479 |
*
|
480 |
+
* @param string $field_id The option ID. Must be within the Autodescription settings.
|
481 |
+
* @param string $label The checkbox description label.
|
482 |
* @param string $description Addition description to place beneath the checkbox.
|
483 |
+
* @param bool $escape Whether to escape the label and description.
|
484 |
+
* @param bool $disabled Whether to disable the input.
|
485 |
* @return string HTML checkbox output.
|
486 |
*/
|
487 |
+
public function make_checkbox( $field_id = '', $label = '', $description = '', $escape = true, $disabled = false ) {
|
488 |
|
489 |
if ( $escape ) {
|
490 |
$description = \esc_html( $description );
|
494 |
$description = $description ? '<p class="description tsf-option-spacer">' . $description . '</p>' : '';
|
495 |
|
496 |
$output = '<span class="tsf-toblock">'
|
497 |
+
. '<label for="'
|
498 |
+
. $this->get_field_id( $field_id ) . '" '
|
499 |
+
. ( $disabled ? 'class=tsf-disabled ' : '' )
|
500 |
+
. '>'
|
501 |
. '<input '
|
502 |
. 'type="checkbox" '
|
503 |
+
. ( $disabled ? 'class=tsf-disabled disabled ' : '' )
|
504 |
. 'name="' . $this->get_field_name( $field_id ) . '" '
|
505 |
. 'id="' . $this->get_field_id( $field_id ) . '" '
|
506 |
+
. ( $disabled ? '' : $this->get_is_conditional_checked( $field_id ) . ' ' )
|
507 |
. 'value="1" '
|
508 |
. \checked( $this->get_field_value( $field_id ), true, false ) .
|
509 |
' />'
|
inc/classes/deprecated.class.php
CHANGED
@@ -1,2012 +1,2012 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package The_SEO_Framework\Classes\Deprecated
|
4 |
-
*/
|
5 |
-
namespace The_SEO_Framework;
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* The SEO Framework plugin
|
11 |
-
* Copyright (C) 2015 - 2017 Sybre Waaijer, CyberWire (https://cyberwire.nl/)
|
12 |
-
*
|
13 |
-
* This program is free software: you can redistribute it and/or modify
|
14 |
-
* it under the terms of the GNU General Public License version 3 as published
|
15 |
-
* by the Free Software Foundation.
|
16 |
-
*
|
17 |
-
* This program is distributed in the hope that it will be useful,
|
18 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
-
* GNU General Public License for more details.
|
21 |
-
*
|
22 |
-
* You should have received a copy of the GNU General Public License
|
23 |
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
-
*/
|
25 |
-
|
26 |
-
defined( 'ABSPATH' ) or die;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Class The_SEO_Framework\Deprecated
|
30 |
-
*
|
31 |
-
* Contains all deprecated functions.
|
32 |
-
*
|
33 |
-
* @since 2.8.0
|
34 |
-
*/
|
35 |
-
final class Deprecated {
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Constructor. Does nothing.
|
39 |
-
*/
|
40 |
-
public function __construct() { }
|
41 |
-
|
42 |
-
/**
|
43 |
-
* HomePage Metabox General Tab Output.
|
44 |
-
*
|
45 |
-
* @since 2.6.0
|
46 |
-
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
47 |
-
*
|
48 |
-
* @deprecated
|
49 |
-
* @since 2.7.0
|
50 |
-
*/
|
51 |
-
public function homepage_metabox_general() {
|
52 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_general_tab()' );
|
53 |
-
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'general' );
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* HomePage Metabox Additions Tab Output.
|
58 |
-
*
|
59 |
-
* @since 2.6.0
|
60 |
-
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
61 |
-
*
|
62 |
-
* @deprecated
|
63 |
-
* @since 2.7.0
|
64 |
-
*/
|
65 |
-
public function homepage_metabox_additions() {
|
66 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_additions_tab()' );
|
67 |
-
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'additions' );
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* HomePage Metabox Robots Tab Output
|
72 |
-
*
|
73 |
-
* @since 2.6.0
|
74 |
-
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
75 |
-
*
|
76 |
-
* @deprecated
|
77 |
-
* @since 2.7.0
|
78 |
-
*/
|
79 |
-
public function homepage_metabox_robots() {
|
80 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_robots_tab()' );
|
81 |
-
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'robots' );
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Delete transient for the automatic description for blog on save request.
|
86 |
-
* Returns old option, since that's passed for sanitation within WP Core.
|
87 |
-
*
|
88 |
-
* @since 2.3.3
|
89 |
-
*
|
90 |
-
* @deprecated
|
91 |
-
* @since 2.7.0
|
92 |
-
*
|
93 |
-
* @param string $old_option The previous blog description option.
|
94 |
-
* @return string Previous option.
|
95 |
-
*/
|
96 |
-
public function delete_auto_description_blog_transient( $old_option ) {
|
97 |
-
|
98 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Transients::delete_auto_description_frontpage_transient()' );
|
99 |
-
|
100 |
-
\the_seo_framework()->delete_auto_description_transient( \the_seo_framework()->get_the_front_page_ID(), '', 'frontpage' );
|
101 |
-
|
102 |
-
return $old_option;
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Add term meta data into options table of the term.
|
107 |
-
* Adds separated database options for terms, as the terms table doesn't allow for addition.
|
108 |
-
*
|
109 |
-
* Applies filters array the_seo_framework_term_meta_defaults : Array of default term SEO options
|
110 |
-
* Applies filters mixed the_seo_framework_term_meta_{field} : Override filter for specifics.
|
111 |
-
* Applies filters array the_seo_framework_term_meta : Override output for term or taxonomy.
|
112 |
-
*
|
113 |
-
* @since 2.1.8
|
114 |
-
*
|
115 |
-
* @deprecated silently.
|
116 |
-
* @since WordPress 4.4.0
|
117 |
-
* @since The SEO Framework 2.7.0
|
118 |
-
* @since 2.8.0: Deprecated visually.
|
119 |
-
*
|
120 |
-
* @param object $term Database row object.
|
121 |
-
* @param string $taxonomy Taxonomy name that $term is part of.
|
122 |
-
* @return object $term Database row object.
|
123 |
-
*/
|
124 |
-
public function get_term_filter( $term, $taxonomy ) {
|
125 |
-
|
126 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "get_term_meta()"' );
|
127 |
-
|
128 |
-
return false;
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Adds The SEO Framework term meta data to functions that return multiple terms.
|
133 |
-
*
|
134 |
-
* @since 2.0.0
|
135 |
-
*
|
136 |
-
* @deprecated silently.
|
137 |
-
* @since WordPress 4.4.0
|
138 |
-
* @since The SEO Framework 2.7.0
|
139 |
-
* @since 2.8.0: Deprecated visually.
|
140 |
-
*
|
141 |
-
* @param array $terms Database row objects.
|
142 |
-
* @param string $taxonomy Taxonomy name that $terms are part of.
|
143 |
-
* @return array $terms Database row objects.
|
144 |
-
*/
|
145 |
-
public function get_terms_filter( array $terms, $taxonomy ) {
|
146 |
-
|
147 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "get_term_meta()"' );
|
148 |
-
|
149 |
-
return false;
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Save taxonomy meta data.
|
154 |
-
* Fires when a user edits and saves a taxonomy.
|
155 |
-
*
|
156 |
-
* @since 2.1.8
|
157 |
-
*
|
158 |
-
* @deprecated silently.
|
159 |
-
* @since WordPress 4.4.0
|
160 |
-
* @since The SEO Framework 2.7.0
|
161 |
-
* @since 2.8.0: Deprecated visually.
|
162 |
-
*
|
163 |
-
* @param integer $term_id Term ID.
|
164 |
-
* @param integer $tt_id Term Taxonomy ID.
|
165 |
-
* @return void Early on AJAX call.
|
166 |
-
*/
|
167 |
-
public function taxonomy_seo_save( $term_id, $tt_id ) {
|
168 |
-
|
169 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "update_term_meta()"' );
|
170 |
-
|
171 |
-
return false;
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Delete term meta data.
|
176 |
-
* Fires when a user deletes a term.
|
177 |
-
*
|
178 |
-
* @since 2.1.8
|
179 |
-
*
|
180 |
-
* @deprecated silently.
|
181 |
-
* @since WordPress 4.4.0
|
182 |
-
* @since The SEO Framework 2.7.0
|
183 |
-
* @since 2.8.0: Deprecated visually.
|
184 |
-
*
|
185 |
-
* @param integer $term_id Term ID.
|
186 |
-
* @param integer $tt_id Taxonomy Term ID.
|
187 |
-
*/
|
188 |
-
public function term_meta_delete( $term_id, $tt_id ) {
|
189 |
-
|
190 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "delete_term_meta()"' );
|
191 |
-
|
192 |
-
return false;
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Faster way of doing an in_array search compared to default PHP behavior.
|
197 |
-
* @NOTE only to show improvement with large arrays. Might slow down with small arrays.
|
198 |
-
* @NOTE can't do type checks. Always assume the comparing value is a string.
|
199 |
-
*
|
200 |
-
* @since 2.5.2
|
201 |
-
* @since 2.7.0 Deprecated.
|
202 |
-
* @deprecated
|
203 |
-
*
|
204 |
-
* @param string|array $needle The needle(s) to search for
|
205 |
-
* @param array $array The single dimensional array to search in.
|
206 |
-
* @return bool true if value is in array.
|
207 |
-
*/
|
208 |
-
public function in_array( $needle, $array, $strict = true ) {
|
209 |
-
|
210 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Core::' . __FUNCTION__, '2.7.0', 'in_array()' );
|
211 |
-
|
212 |
-
$array = array_flip( $array );
|
213 |
-
|
214 |
-
if ( is_string( $needle ) ) {
|
215 |
-
if ( isset( $array[ $needle ] ) )
|
216 |
-
return true;
|
217 |
-
} elseif ( is_array( $needle ) ) {
|
218 |
-
foreach ( $needle as $str ) {
|
219 |
-
if ( isset( $array[ $str ] ) )
|
220 |
-
return true;
|
221 |
-
}
|
222 |
-
}
|
223 |
-
|
224 |
-
return false;
|
225 |
-
}
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Fetches posts with exclude_local_search option on
|
229 |
-
*
|
230 |
-
* @since 2.1.7
|
231 |
-
* @since 2.7.0 Deprecated.
|
232 |
-
* @deprecated
|
233 |
-
*
|
234 |
-
* @return array Excluded Post IDs
|
235 |
-
*/
|
236 |
-
public function exclude_search_ids() {
|
237 |
-
|
238 |
-
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Search::' . __FUNCTION__, '2.7.0', 'the_seo_framework()->get_excluded_search_ids()' );
|
239 |
-
|
240 |
-
return $this->get_excluded_search_ids();
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Fetches posts with exclude_local_search option on.
|
245 |
-
*
|
246 |
-
* @since 2.1.7
|
247 |
-
* @since 2.7.0 No longer used for performance reasons.
|
248 |
-
* @uses $this->exclude_search_ids()
|
249 |
-
* @deprecated
|
250 |
-
* @since 2.8.0 deprecated.
|
251 |
-
*
|
252 |
-
* @param array $query The possible search query.
|
253 |
-
* @return void Early if no search query is found.
|
254 |
-
*/
|
255 |
-
public function search_filter( $query ) {
|
256 |
-
|
257 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->search_filter()', '2.8.0' );
|
258 |
-
|
259 |
-
// Don't exclude pages in wp-admin.
|
260 |
-
if ( $query->is_search && false === \the_seo_framework()->is_admin() ) {
|
261 |
-
|
262 |
-
$q = $query->query;
|
263 |
-
//* Only interact with an actual Search Query.
|
264 |
-
if ( false === isset( $q['s'] ) )
|
265 |
-
return;
|
266 |
-
|
267 |
-
//* Get excluded IDs.
|
268 |
-
$protected_posts = $this->get_excluded_search_ids();
|
269 |
-
if ( $protected_posts ) {
|
270 |
-
$get = $query->get( 'post__not_in' );
|
271 |
-
|
272 |
-
//* Merge user defined query.
|
273 |
-
if ( is_array( $get ) && ! empty( $get ) )
|
274 |
-
$protected_posts = array_merge( $protected_posts, $get );
|
275 |
-
|
276 |
-
$query->set( 'post__not_in', $protected_posts );
|
277 |
-
}
|
278 |
-
|
279 |
-
// Parse all ID's, even beyond the first page.
|
280 |
-
$query->set( 'no_found_rows', false );
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Fetches posts with exclude_local_search option on.
|
286 |
-
*
|
287 |
-
* @since 2.7.0
|
288 |
-
* @since 2.7.0 No longer used.
|
289 |
-
* @global int $blog_id
|
290 |
-
* @deprecated
|
291 |
-
*
|
292 |
-
* @return array Excluded Post IDs
|
293 |
-
*/
|
294 |
-
public function get_excluded_search_ids() {
|
295 |
-
|
296 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_excluded_search_ids()', '2.7.0' );
|
297 |
-
|
298 |
-
global $blog_id;
|
299 |
-
|
300 |
-
$cache_key = 'exclude_search_ids_' . $blog_id . '_' . \get_locale();
|
301 |
-
|
302 |
-
$post_ids = \the_seo_framework()->object_cache_get( $cache_key );
|
303 |
-
if ( false === $post_ids ) {
|
304 |
-
$post_ids = array();
|
305 |
-
|
306 |
-
$args = array(
|
307 |
-
'post_type' => 'any',
|
308 |
-
'numberposts' => -1,
|
309 |
-
'posts_per_page' => -1,
|
310 |
-
'order' => 'DESC',
|
311 |
-
'post_status' => 'publish',
|
312 |
-
'meta_key' => 'exclude_local_search',
|
313 |
-
'meta_value' => 1,
|
314 |
-
'meta_compare' => '=',
|
315 |
-
'cache_results' => true,
|
316 |
-
'suppress_filters' => false,
|
317 |
-
);
|
318 |
-
$get_posts = new \WP_Query;
|
319 |
-
$excluded_posts = $get_posts->query( $args );
|
320 |
-
unset( $get_posts );
|
321 |
-
|
322 |
-
if ( $excluded_posts )
|
323 |
-
$post_ids = \wp_list_pluck( $excluded_posts, 'ID' );
|
324 |
-
|
325 |
-
\the_seo_framework()->object_cache_set( $cache_key, $post_ids, 86400 );
|
326 |
-
}
|
327 |
-
|
328 |
-
// return an array of exclude post IDs
|
329 |
-
return $post_ids;
|
330 |
-
}
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Registers option sanitation filter
|
334 |
-
*
|
335 |
-
* @since 2.2.2
|
336 |
-
* @since 2.7.0 : No longer used internally.
|
337 |
-
* @since 2.8.0 : Deprecated
|
338 |
-
* @deprecated
|
339 |
-
*
|
340 |
-
* @param string $filter The filter to call (see The_SEO_Framework_Site_Options::$available_filters for options)
|
341 |
-
* @param string $option The WordPress option name
|
342 |
-
* @param string|array $suboption Optional. The suboption or suboptions you want to filter
|
343 |
-
* @return true on completion.
|
344 |
-
*/
|
345 |
-
public function autodescription_add_option_filter( $filter, $option, $suboption = null ) {
|
346 |
-
|
347 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->add_option_filter()', '2.8.0' );
|
348 |
-
|
349 |
-
return \the_seo_framework()->add_option_filter( $filter, $option, $suboption );
|
350 |
-
}
|
351 |
-
|
352 |
-
/**
|
353 |
-
* Register each of the settings with a sanitization filter type.
|
354 |
-
*
|
355 |
-
* @since 2.2.2
|
356 |
-
* @since 2.8.0 Deprecated.
|
357 |
-
* @uses method add_filter() Assign filter to array of settings.
|
358 |
-
* @see The_SEO_Framework_Sanitize::add_filter() Add sanitization filters to options.
|
359 |
-
*/
|
360 |
-
public function sanitizer_filters() {
|
361 |
-
|
362 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->sanitizer_filters()', '2.8.0', 'the_seo_framework()->init_sanitizer_filters()' );
|
363 |
-
|
364 |
-
\the_seo_framework()->init_sanitizer_filters();
|
365 |
-
}
|
366 |
-
|
367 |
-
/**
|
368 |
-
* Fetches site icon brought in WordPress 4.3.0
|
369 |
-
*
|
370 |
-
* @since 2.2.1
|
371 |
-
* @since 2.8.0: Deprecated.
|
372 |
-
* @deprecated
|
373 |
-
*
|
374 |
-
* @param string $size The icon size, accepts 'full' and pixel values.
|
375 |
-
* @param bool $set_og_dimensions Whether to set size for OG image. Always falls back to the current post ID.
|
376 |
-
* @return string URL site icon, not escaped.
|
377 |
-
*/
|
378 |
-
public function site_icon( $size = 'full', $set_og_dimensions = false ) {
|
379 |
-
|
380 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->site_icon()', '2.8.0', 'the_seo_framework()->get_site_icon()' );
|
381 |
-
|
382 |
-
return the_seo_framework()->get_site_icon( $size, $set_og_dimensions );
|
383 |
-
}
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Delete transient on post save.
|
387 |
-
*
|
388 |
-
* @since 2.2.9
|
389 |
-
* @since 2.8.0 : Deprecated
|
390 |
-
* @deprecated
|
391 |
-
*
|
392 |
-
* @param int $post_id The Post ID that has been updated.
|
393 |
-
* @return bool|null True when sitemap is flushed. False on revision. Null
|
394 |
-
* when sitemaps are deactivated.
|
395 |
-
*/
|
396 |
-
public function delete_transients_post( $post_id ) {
|
397 |
-
|
398 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_transients_post()', '2.8.0', 'the_seo_framework()->delete_post_cache()' );
|
399 |
-
|
400 |
-
return \the_seo_framework()->delete_post_cache( $post_id );
|
401 |
-
}
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Delete transient on profile save.
|
405 |
-
*
|
406 |
-
* @since 2.6.4
|
407 |
-
* @since 2.8.0 : Deprecated
|
408 |
-
* @deprecated
|
409 |
-
*
|
410 |
-
* @param int $user_id The User ID that has been updated.
|
411 |
-
*/
|
412 |
-
public function delete_transients_author( $user_id ) {
|
413 |
-
|
414 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_transients_author()', '2.8.0', 'the_seo_framework()->delete_author_cache()' );
|
415 |
-
|
416 |
-
return \the_seo_framework()->delete_author_cache( $user_id );
|
417 |
-
}
|
418 |
-
|
419 |
-
/**
|
420 |
-
* Flushes the home page LD+Json transient.
|
421 |
-
*
|
422 |
-
* @since 2.6.0
|
423 |
-
* @since 2.8.0 deprecated.
|
424 |
-
* @staticvar bool $flushed Prevents second flush.
|
425 |
-
* @deprecated
|
426 |
-
*
|
427 |
-
* @return bool Whether it's flushed on current call.
|
428 |
-
*/
|
429 |
-
public function delete_front_ld_json_transient() {
|
430 |
-
|
431 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_front_ld_json_transient()', '2.8.0', 'the_seo_framework()->delete_cache( \'front\' )' );
|
432 |
-
|
433 |
-
static $flushed = null;
|
434 |
-
|
435 |
-
if ( isset( $flushed ) )
|
436 |
-
return false;
|
437 |
-
|
438 |
-
if ( ! \the_seo_framework()->is_option_checked( 'cache_meta_schema' ) )
|
439 |
-
return $flushed = false;
|
440 |
-
|
441 |
-
$front_id = \the_seo_framework()->get_the_front_page_ID();
|
442 |
-
|
443 |
-
\the_seo_framework()->delete_ld_json_transient( $front_id, '', 'frontpage' );
|
444 |
-
|
445 |
-
return $flushed = true;
|
446 |
-
}
|
447 |
-
|
448 |
-
/**
|
449 |
-
* Determines whether we can use the new WordPress core term meta functionality.
|
450 |
-
*
|
451 |
-
* @since 2.7.0
|
452 |
-
* @since 2.8.0: Deprecated. WordPress 4.4+ is now required.
|
453 |
-
* @staticvar bool $cache
|
454 |
-
* @deprecated
|
455 |
-
*
|
456 |
-
* @return bool True when WordPress is at version 4.4 or higher and has an
|
457 |
-
* accordingly upgraded database.
|
458 |
-
*/
|
459 |
-
public function can_get_term_meta() {
|
460 |
-
|
461 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->can_get_term_meta()', '2.8.0' );
|
462 |
-
|
463 |
-
static $cache = null;
|
464 |
-
|
465 |
-
if ( isset( $cache ) )
|
466 |
-
return $cache;
|
467 |
-
|
468 |
-
return $cache = \get_option( 'db_version' ) >= 34370 && \get_option( 'the_seo_framework_upgraded_db_version' ) >= '2700' && \the_seo_framework()->wp_version( '4.3.999', '>' );
|
469 |
-
}
|
470 |
-
|
471 |
-
/**
|
472 |
-
* Fetches term metadata array for the inpost term metabox.
|
473 |
-
*
|
474 |
-
* @since 2.7.0
|
475 |
-
* @since 2.8.0: Deprecated. WordPress 4.4+ is now required.
|
476 |
-
* @deprecated
|
477 |
-
*
|
478 |
-
* @param object $term The TT object. Must be assigned.
|
479 |
-
* @return array The SEO Framework TT data.
|
480 |
-
*/
|
481 |
-
protected function get_old_term_data( $term ) {
|
482 |
-
|
483 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_old_term_data()', '2.8.0' );
|
484 |
-
|
485 |
-
$data = array();
|
486 |
-
|
487 |
-
$data['title'] = isset( $term->admeta['doctitle'] ) ? $term->admeta['doctitle'] : '';
|
488 |
-
$data['description'] = isset( $term->admeta['description'] ) ? $term->admeta['description'] : '';
|
489 |
-
$data['noindex'] = isset( $term->admeta['noindex'] ) ? $term->admeta['noindex'] : '';
|
490 |
-
$data['nofollow'] = isset( $term->admeta['nofollow'] ) ? $term->admeta['nofollow'] : '';
|
491 |
-
$data['noarchive'] = isset( $term->admeta['noarchive'] ) ? $term->admeta['noarchive'] : '';
|
492 |
-
$flag = isset( $term->admeta['saved_flag'] ) ? (bool) $term->admeta['saved_flag'] : false;
|
493 |
-
|
494 |
-
//* Genesis data fetch. This will override our options with Genesis options on save.
|
495 |
-
if ( false === $flag && isset( $term->meta ) ) {
|
496 |
-
$data['title'] = empty( $data['title'] ) && isset( $term->meta['doctitle'] ) ? $term->meta['doctitle'] : $data['noindex'];
|
497 |
-
$data['description'] = empty( $data['description'] ) && isset( $term->meta['description'] ) ? $term->meta['description'] : $data['description'];
|
498 |
-
$data['noindex'] = empty( $data['noindex'] ) && isset( $term->meta['noindex'] ) ? $term->meta['noindex'] : $data['noindex'];
|
499 |
-
$data['nofollow'] = empty( $data['nofollow'] ) && isset( $term->meta['nofollow'] ) ? $term->meta['nofollow'] : $data['nofollow'];
|
500 |
-
$data['noarchive'] = empty( $data['noarchive'] ) && isset( $term->meta['noarchive'] ) ? $term->meta['noarchive'] : $data['noarchive'];
|
501 |
-
}
|
502 |
-
|
503 |
-
return $data;
|
504 |
-
}
|
505 |
-
|
506 |
-
/**
|
507 |
-
* Fetches og:image URL.
|
508 |
-
*
|
509 |
-
* @since 2.2.2
|
510 |
-
* @since 2.2.8 : Added theme icon detection.
|
511 |
-
* @since 2.5.2 : Added args filters.
|
512 |
-
* @since 2.8.0 : 1. Added theme logo detection.
|
513 |
-
* 2. Added inpost image selection detection.
|
514 |
-
* @since 2.8.2 : 1. Now returns something on post ID 0.
|
515 |
-
* 2. Added SEO settings fallback image selection detection.
|
516 |
-
* @since 2.9.0 : 1. Added 'skip_fallback' option to arguments.
|
517 |
-
* 2. Added 'escape' option to arguments.
|
518 |
-
* 3. First parameter is now arguments. Fallback for integer is added.
|
519 |
-
* 4. Second parameter is now deprecated.
|
520 |
-
* 5. Deprecated.
|
521 |
-
* @deprecated Use get_social_image instead.
|
522 |
-
*
|
523 |
-
* @param int|array $args The image arguments.
|
524 |
-
* Was: $post_id.
|
525 |
-
* Warning: Integer usage is only used for backwards compat.
|
526 |
-
* @param array $depr_args, Deprecated;
|
527 |
-
* Was $args The image arguments.
|
528 |
-
* @param bool $escape Whether to escape the image URL.
|
529 |
-
* Deprecated: You should use $args['escape'].
|
530 |
-
* @return string the image URL.
|
531 |
-
*/
|
532 |
-
public function get_image( $args = array(), $depr_args = '', $depr_escape = true ) {
|
533 |
-
|
534 |
-
$tsf = \the_seo_framework();
|
535 |
-
|
536 |
-
$tsf->_deprecated_function( 'the_seo_framework()->get_image()', '2.9.0', 'the_seo_framework()->get_social_image()' );
|
537 |
-
|
538 |
-
if ( is_int( $args ) || is_array( $depr_args ) ) {
|
539 |
-
$tsf->_doing_it_wrong( __METHOD__, 'First parameter is now used for arguments. Second parameter is deprecated.', '2.9.0' );
|
540 |
-
|
541 |
-
$post_id = $args;
|
542 |
-
$args = array();
|
543 |
-
|
544 |
-
/**
|
545 |
-
* Backwards compat with parse args.
|
546 |
-
* @since 2.5.0
|
547 |
-
*/
|
548 |
-
if ( ! isset( $depr_args['post_id'] ) ) {
|
549 |
-
$args['post_id'] = $post_id ?: ( $tsf->is_singular( $post_id ) ? $tsf->get_the_real_ID() : 0 );
|
550 |
-
}
|
551 |
-
|
552 |
-
if ( is_array( $depr_args ) ) {
|
553 |
-
$args = \wp_parse_args( $depr_args, $args );
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
if ( false === $depr_escape ) {
|
558 |
-
$tsf->_doing_it_wrong( __METHOD__, 'Third parameter has been deprecated. Use `$args["escape"] => false` instead.', '2.9.0' );
|
559 |
-
$args['escape'] = false;
|
560 |
-
}
|
561 |
-
|
562 |
-
$args = $tsf->reparse_image_args( $args );
|
563 |
-
|
564 |
-
//* 0. Image from argument.
|
565 |
-
pre_0 : {
|
566 |
-
if ( $image = $args['image'] )
|
567 |
-
goto end;
|
568 |
-
}
|
569 |
-
|
570 |
-
//* Check if there are no disallowed arguments.
|
571 |
-
$all_allowed = empty( $args['disallowed'] );
|
572 |
-
|
573 |
-
//* 1. Fetch image from homepage SEO meta upload.
|
574 |
-
if ( $all_allowed || false === in_array( 'homemeta', $args['disallowed'], true ) ) {
|
575 |
-
if ( $image = $tsf->get_social_image_url_from_home_meta( $args['post_id'], true ) )
|
576 |
-
goto end;
|
577 |
-
}
|
578 |
-
|
579 |
-
if ( $args['post_id'] ) {
|
580 |
-
//* 2. Fetch image from SEO meta upload.
|
581 |
-
if ( $all_allowed || false === in_array( 'postmeta', $args['disallowed'], true ) ) {
|
582 |
-
if ( $image = $tsf->get_social_image_url_from_post_meta( $args['post_id'], true ) )
|
583 |
-
goto end;
|
584 |
-
}
|
585 |
-
|
586 |
-
//* 3. Fetch image from featured.
|
587 |
-
if ( $all_allowed || false === in_array( 'featured', $args['disallowed'], true ) ) {
|
588 |
-
if ( $image = $tsf->get_image_from_post_thumbnail( $args, true ) )
|
589 |
-
goto end;
|
590 |
-
}
|
591 |
-
}
|
592 |
-
|
593 |
-
if ( $args['skip_fallback'] )
|
594 |
-
goto end;
|
595 |
-
|
596 |
-
//* 4. Fetch image from SEO settings
|
597 |
-
if ( $all_allowed || false === in_array( 'option', $args['disallowed'], true ) ) {
|
598 |
-
if ( $image = $tsf->get_social_image_url_from_seo_settings( true ) )
|
599 |
-
goto end;
|
600 |
-
}
|
601 |
-
|
602 |
-
//* 5. Fetch image from fallback filter 1
|
603 |
-
/**
|
604 |
-
* Applies filters 'the_seo_framework_og_image_after_featured' : string
|
605 |
-
* @since 2.5.2
|
606 |
-
*/
|
607 |
-
fallback_1 : {
|
608 |
-
if ( $image = (string) \apply_filters( 'the_seo_framework_og_image_after_featured', '', $args['post_id'] ) )
|
609 |
-
goto end;
|
610 |
-
}
|
611 |
-
|
612 |
-
//* 6. Fallback: Get header image if exists
|
613 |
-
if ( ( $all_allowed || false === in_array( 'header', $args['disallowed'], true ) ) && \current_theme_supports( 'custom-header', 'default-image' ) ) {
|
614 |
-
if ( $image = $tsf->get_header_image( true ) )
|
615 |
-
goto end;
|
616 |
-
}
|
617 |
-
|
618 |
-
//* 7. Fetch image from fallback filter 2
|
619 |
-
/**
|
620 |
-
* Applies filters 'the_seo_framework_og_image_after_header' : string
|
621 |
-
* @since 2.5.2
|
622 |
-
*/
|
623 |
-
fallback_2 : {
|
624 |
-
if ( $image = (string) \apply_filters( 'the_seo_framework_og_image_after_header', '', $args['post_id'] ) )
|
625 |
-
goto end;
|
626 |
-
}
|
627 |
-
|
628 |
-
//* 8. Get the WP 4.5 Site Logo
|
629 |
-
if ( ( $all_allowed || false === in_array( 'logo', $args['disallowed'], true ) ) && $tsf->can_use_logo() ) {
|
630 |
-
if ( $image = $tsf->get_site_logo( true ) )
|
631 |
-
goto end;
|
632 |
-
}
|
633 |
-
|
634 |
-
//* 9. Get the WP 4.3 Site Icon
|
635 |
-
if ( $all_allowed || false === in_array( 'icon', $args['disallowed'], true ) ) {
|
636 |
-
if ( $image = $tsf->get_site_icon( 'full', true ) )
|
637 |
-
goto end;
|
638 |
-
}
|
639 |
-
|
640 |
-
end :;
|
641 |
-
|
642 |
-
if ( $args['escape'] && $image )
|
643 |
-
$image = \esc_url( $image );
|
644 |
-
|
645 |
-
return (string) $image;
|
646 |
-
}
|
647 |
-
|
648 |
-
/**
|
649 |
-
* Fetches image from post thumbnail.
|
650 |
-
* Resizes the image between 4096px if bigger. Then it saves the image and
|
651 |
-
* Keeps dimensions relative.
|
652 |
-
*
|
653 |
-
* @since 2.3.0
|
654 |
-
* @since 2.9.0 Changed parameters.
|
655 |
-
* @since 2.9.0 Deprecated.
|
656 |
-
* @since 2.9.3 Now supports 4K, rather than 1500px.
|
657 |
-
* @deprecated
|
658 |
-
*
|
659 |
-
* @param array $args The image args.
|
660 |
-
* Was: int $id The post/page ID.
|
661 |
-
* @param bool $set_og_dimensions Whether to set Open Graph image dimensions.
|
662 |
-
* Was: array $depr_args Deprecated. Image arguments.
|
663 |
-
* @return string|null the image url.
|
664 |
-
*/
|
665 |
-
public function get_image_from_post_thumbnail( $args = array(), $set_og_dimensions = false ) {
|
666 |
-
|
667 |
-
$tsf = \the_seo_framework();
|
668 |
-
|
669 |
-
$tsf->_deprecated_function( 'the_seo_framework()->get_image_from_post_thumbnail()', '2.9.0', 'the_seo_framework()->get_social_image_url_from_post_thumbnail()' );
|
670 |
-
|
671 |
-
if ( is_array( $set_og_dimensions ) ) {
|
672 |
-
$tsf->_doing_it_wrong( __METHOD__, 'First parameter are now arguments, second parameter is for setting og dimensions.', '2.9.0' );
|
673 |
-
$args = $set_og_dimensions;
|
674 |
-
$set_og_dimensions = false;
|
675 |
-
}
|
676 |
-
|
677 |
-
$args = $tsf->reparse_image_args( $args );
|
678 |
-
|
679 |
-
$id = \get_post_thumbnail_id( $args['post_id'] );
|
680 |
-
|
681 |
-
$args['get_the_real_ID'] = true;
|
682 |
-
|
683 |
-
$image = $id ? $tsf->parse_og_image( $id, $args, $set_og_dimensions ) : '';
|
684 |
-
|
685 |
-
return $image;
|
686 |
-
}
|
687 |
-
|
688 |
-
/**
|
689 |
-
* Detects front page.
|
690 |
-
*
|
691 |
-
* Returns true on SEO settings page if ID is 0.
|
692 |
-
*
|
693 |
-
* @since 2.6.0
|
694 |
-
* @since 2.9.0: Deprecated.
|
695 |
-
* @deprecated
|
696 |
-
*
|
697 |
-
* @param int $id The Page or Post ID.
|
698 |
-
* @return bool
|
699 |
-
*/
|
700 |
-
public function is_front_page( $id = 0 ) {
|
701 |
-
|
702 |
-
$tsf = \the_seo_framework();
|
703 |
-
|
704 |
-
$tsf->_deprecated_function( 'the_seo_framework()->is_front_page()', '2.9.0', 'the_seo_framework()->is_real_front_page() or the_seo_framework()->is_front_page_by_id()' );
|
705 |
-
|
706 |
-
static $cache = array();
|
707 |
-
|
708 |
-
if ( null !== $cache = $tsf->get_query_cache( __METHOD__, null, $id ) )
|
709 |
-
return $cache;
|
710 |
-
|
711 |
-
$is_front_page = false;
|
712 |
-
|
713 |
-
if ( \is_front_page() && empty( $id ) )
|
714 |
-
$is_front_page = true;
|
715 |
-
|
716 |
-
//* Elegant Themes Support. Yay.
|
717 |
-
if ( false === $is_front_page && empty( $id ) && $tsf->is_home() ) {
|
718 |
-
$sof = \get_option( 'show_on_front' );
|
719 |
-
|
720 |
-
if ( 'page' !== $sof && 'posts' !== $sof )
|
721 |
-
$is_front_page = true;
|
722 |
-
}
|
723 |
-
|
724 |
-
//* Compare against $id
|
725 |
-
if ( false === $is_front_page && $id ) {
|
726 |
-
$sof = \get_option( 'show_on_front' );
|
727 |
-
|
728 |
-
if ( 'page' === $sof && (int) \get_option( 'page_on_front' ) === $id )
|
729 |
-
$is_front_page = true;
|
730 |
-
|
731 |
-
if ( 'posts' === $sof && (int) \get_option( 'page_for_posts' ) === $id )
|
732 |
-
$is_front_page = true;
|
733 |
-
} elseif ( empty( $id ) && $tsf->is_seo_settings_page() ) {
|
734 |
-
$is_front_page = true;
|
735 |
-
}
|
736 |
-
|
737 |
-
$tsf->set_query_cache(
|
738 |
-
__METHOD__,
|
739 |
-
$is_front_page,
|
740 |
-
$id
|
741 |
-
);
|
742 |
-
|
743 |
-
return $is_front_page;
|
744 |
-
}
|
745 |
-
|
746 |
-
/**
|
747 |
-
* Returns http://schema.org json encoded context URL.
|
748 |
-
*
|
749 |
-
* @staticvar string $context
|
750 |
-
* @since 2.6.0
|
751 |
-
* @since 2.9.3 Deprecated.
|
752 |
-
* @deprecated
|
753 |
-
*
|
754 |
-
* @return string The json encoded context url.
|
755 |
-
*/
|
756 |
-
public function schema_context() {
|
757 |
-
|
758 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_context()', '2.9.3' );
|
759 |
-
|
760 |
-
static $context;
|
761 |
-
|
762 |
-
if ( isset( $context ) )
|
763 |
-
return $context;
|
764 |
-
|
765 |
-
return $context = json_encode( 'http://schema.org' );
|
766 |
-
}
|
767 |
-
|
768 |
-
|
769 |
-
/**
|
770 |
-
* Returns 'WebSite' json encoded type name.
|
771 |
-
*
|
772 |
-
* @staticvar string $context
|
773 |
-
* @since 2.6.0
|
774 |
-
* @since 2.9.3 Deprecated.
|
775 |
-
* @deprecated
|
776 |
-
*
|
777 |
-
* @return string The json encoded type name.
|
778 |
-
*/
|
779 |
-
public function schema_type() {
|
780 |
-
|
781 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_type()', '2.9.3' );
|
782 |
-
|
783 |
-
static $type;
|
784 |
-
|
785 |
-
if ( isset( $type ) )
|
786 |
-
return $type;
|
787 |
-
|
788 |
-
return $type = json_encode( 'WebSite' );
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
* Returns json encoded home url.
|
793 |
-
*
|
794 |
-
* @staticvar string $url
|
795 |
-
* @since 2.6.0
|
796 |
-
* @since 2.9.3 Deprecated.
|
797 |
-
* @deprecated
|
798 |
-
*
|
799 |
-
* @return string The json encoded home url.
|
800 |
-
*/
|
801 |
-
public function schema_home_url() {
|
802 |
-
|
803 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_home_url()', '2.9.3' );
|
804 |
-
|
805 |
-
static $type;
|
806 |
-
|
807 |
-
if ( isset( $type ) )
|
808 |
-
return $type;
|
809 |
-
|
810 |
-
return $type = json_encode( \the_seo_framework()->the_home_url_from_cache() );
|
811 |
-
}
|
812 |
-
|
813 |
-
/**
|
814 |
-
* Returns json encoded blogname.
|
815 |
-
*
|
816 |
-
* @staticvar string $name
|
817 |
-
* @since 2.6.0
|
818 |
-
* @since 2.9.3 Deprecated.
|
819 |
-
* @deprecated
|
820 |
-
*
|
821 |
-
* @return string The json encoded blogname.
|
822 |
-
*/
|
823 |
-
public function schema_blog_name() {
|
824 |
-
|
825 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_blog_name()', '2.9.3' );
|
826 |
-
|
827 |
-
static $name;
|
828 |
-
|
829 |
-
if ( isset( $name ) )
|
830 |
-
return $name;
|
831 |
-
|
832 |
-
return $name = json_encode( \the_seo_framework()->get_blogname() );
|
833 |
-
}
|
834 |
-
|
835 |
-
/**
|
836 |
-
* Returns 'BreadcrumbList' json encoded type name.
|
837 |
-
*
|
838 |
-
* @staticvar string $crumblist
|
839 |
-
* @since 2.6.0
|
840 |
-
* @since 2.9.3 Deprecated.
|
841 |
-
* @deprecated
|
842 |
-
*
|
843 |
-
* @return string The json encoded 'BreadcrumbList'.
|
844 |
-
*/
|
845 |
-
public function schema_breadcrumblist() {
|
846 |
-
|
847 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_breadcrumblist()', '2.9.3' );
|
848 |
-
|
849 |
-
static $crumblist;
|
850 |
-
|
851 |
-
if ( isset( $crumblist ) )
|
852 |
-
return $crumblist;
|
853 |
-
|
854 |
-
return $crumblist = json_encode( 'BreadcrumbList' );
|
855 |
-
}
|
856 |
-
|
857 |
-
/**
|
858 |
-
* Returns 'ListItem' json encoded type name.
|
859 |
-
*
|
860 |
-
* @staticvar string $listitem
|
861 |
-
* @since 2.6.0
|
862 |
-
* @since 2.9.3 Deprecated.
|
863 |
-
* @deprecated
|
864 |
-
*
|
865 |
-
* @return string The json encoded 'ListItem'.
|
866 |
-
*/
|
867 |
-
public function schema_listitem() {
|
868 |
-
|
869 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_listitem()', '2.9.3' );
|
870 |
-
|
871 |
-
static $listitem;
|
872 |
-
|
873 |
-
if ( isset( $listitem ) )
|
874 |
-
return $listitem;
|
875 |
-
|
876 |
-
return $listitem = json_encode( 'ListItem' );
|
877 |
-
}
|
878 |
-
|
879 |
-
/**
|
880 |
-
* Returns 'image' json encoded value.
|
881 |
-
*
|
882 |
-
* @staticvar array $images
|
883 |
-
* @since 2.7.0
|
884 |
-
* @since 2.9.0 : 1. No longer uses image from cache, instead: it skips fallback images.
|
885 |
-
* 2. Can now fetch home-page as blog set image.
|
886 |
-
* @since 2.9.3 Deprecated.
|
887 |
-
* @deprecated
|
888 |
-
*
|
889 |
-
* @param int|string $id The page, post, product or term ID.
|
890 |
-
* @param bool $singular Whether the ID is singular.
|
891 |
-
*/
|
892 |
-
public function schema_image( $id = 0, $singular = false ) {
|
893 |
-
|
894 |
-
$tsf = \the_seo_framework();
|
895 |
-
|
896 |
-
$tsf->_deprecated_function( 'the_seo_framework()->schema_image()', '2.9.3' );
|
897 |
-
|
898 |
-
static $images = array();
|
899 |
-
|
900 |
-
$id = (int) $id;
|
901 |
-
|
902 |
-
if ( isset( $images[ $id ][ $singular ] ) )
|
903 |
-
return $images[ $id ][ $singular ];
|
904 |
-
|
905 |
-
$image = '';
|
906 |
-
|
907 |
-
if ( $singular ) {
|
908 |
-
if ( $id === $tsf->get_the_front_page_ID() ) {
|
909 |
-
if ( $tsf->has_page_on_front() ) {
|
910 |
-
$image_args = array(
|
911 |
-
'post_id' => $id,
|
912 |
-
'skip_fallback' => true,
|
913 |
-
);
|
914 |
-
} else {
|
915 |
-
$image_args = array(
|
916 |
-
'post_id' => $id,
|
917 |
-
'skip_fallback' => true,
|
918 |
-
'disallowed' => array(
|
919 |
-
'postmeta',
|
920 |
-
'featured',
|
921 |
-
),
|
922 |
-
);
|
923 |
-
}
|
924 |
-
} else {
|
925 |
-
$image_args = array(
|
926 |
-
'post_id' => $id,
|
927 |
-
'skip_fallback' => true,
|
928 |
-
'disallowed' => array(
|
929 |
-
'homemeta'
|
930 |
-
),
|
931 |
-
);
|
932 |
-
}
|
933 |
-
$image = $tsf->get_social_image( $image_args );
|
934 |
-
} else {
|
935 |
-
//* Placeholder.
|
936 |
-
$image = '';
|
937 |
-
}
|
938 |
-
|
939 |
-
/**
|
940 |
-
* Applies filters 'the_seo_framework_ld_json_breadcrumb_image' : string
|
941 |
-
* @since 2.7.0
|
942 |
-
* @param string $image The current image.
|
943 |
-
* @param int $id The page, post, product or term ID.
|
944 |
-
* @param bool $singular Whether the ID is singular.
|
945 |
-
*/
|
946 |
-
$image = \apply_filters( 'the_seo_framework_ld_json_breadcrumb_image', $image, $id, $singular );
|
947 |
-
|
948 |
-
return $images[ $id ][ $singular ] = json_encode( \esc_url_raw( $image ) );
|
949 |
-
}
|
950 |
-
|
951 |
-
/**
|
952 |
-
* Generate LD+Json search helper.
|
953 |
-
*
|
954 |
-
* @since 2.2.8
|
955 |
-
* @since 2.9.3 Deprecated.
|
956 |
-
* @deprecated
|
957 |
-
*
|
958 |
-
* @return escaped LD+json search helper string.
|
959 |
-
*/
|
960 |
-
public function ld_json_search() {
|
961 |
-
|
962 |
-
$tsf = \the_seo_framework();
|
963 |
-
|
964 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_search()', '2.9.3' );
|
965 |
-
|
966 |
-
if ( false === $tsf->enable_ld_json_searchbox() )
|
967 |
-
return '';
|
968 |
-
|
969 |
-
$context = $this->schema_context();
|
970 |
-
$webtype = $this->schema_type();
|
971 |
-
$url = $this->schema_home_url();
|
972 |
-
$name = $this->schema_blog_name();
|
973 |
-
$actiontype = json_encode( 'SearchAction' );
|
974 |
-
|
975 |
-
/**
|
976 |
-
* Applies filters 'the_seo_framework_ld_json_search_url' : string
|
977 |
-
* @since 2.7.0
|
978 |
-
* @param string $search_url The default WordPress search URL without query parameters.
|
979 |
-
*/
|
980 |
-
$search_url = (string) \apply_filters( 'the_seo_framework_ld_json_search_url', $tsf->the_home_url_from_cache( true ) . '?s=' );
|
981 |
-
|
982 |
-
// Remove trailing quote and add it back.
|
983 |
-
$target = mb_substr( json_encode( $search_url ), 0, -1 ) . '{search_term_string}"';
|
984 |
-
|
985 |
-
$queryaction = json_encode( 'required name=search_term_string' );
|
986 |
-
|
987 |
-
$json = sprintf( '{"@context":%s,"@type":%s,"url":%s,"name":%s,"potentialAction":{"@type":%s,"target":%s,"query-input":%s}}', $context, $webtype, $url, $name, $actiontype, $target, $queryaction );
|
988 |
-
|
989 |
-
$output = '';
|
990 |
-
|
991 |
-
if ( $json )
|
992 |
-
$output = '<script type="application/ld+json">' . $json . '</script>' . "\r\n";
|
993 |
-
|
994 |
-
return $output;
|
995 |
-
}
|
996 |
-
|
997 |
-
/**
|
998 |
-
* Generate Site Name LD+Json script.
|
999 |
-
*
|
1000 |
-
* @since 2.6.0
|
1001 |
-
* @since 2.9.3 Deprecated.
|
1002 |
-
* @deprecated
|
1003 |
-
*
|
1004 |
-
* @return string The LD+JSon Site Name script.
|
1005 |
-
*/
|
1006 |
-
public function ld_json_name() {
|
1007 |
-
|
1008 |
-
$tsf = \the_seo_framework();
|
1009 |
-
|
1010 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_name()', '2.9.3' );
|
1011 |
-
|
1012 |
-
$context = $this->schema_context();
|
1013 |
-
$webtype = $this->schema_type();
|
1014 |
-
$url = $this->schema_home_url();
|
1015 |
-
$name = $this->schema_blog_name();
|
1016 |
-
$alternate = '';
|
1017 |
-
|
1018 |
-
$blogname = $tsf->get_blogname();
|
1019 |
-
$knowledge_name = $tsf->get_option( 'knowledge_name' );
|
1020 |
-
|
1021 |
-
if ( $knowledge_name && $knowledge_name !== $blogname ) {
|
1022 |
-
$alternate = json_encode( \esc_html( $knowledge_name ) );
|
1023 |
-
}
|
1024 |
-
|
1025 |
-
if ( $alternate ) {
|
1026 |
-
$json = sprintf( '{"@context":%s,"@type":%s,"name":%s,"alternateName":%s,"url":%s}', $context, $webtype, $name, $alternate, $url );
|
1027 |
-
} else {
|
1028 |
-
$json = sprintf( '{"@context":%s,"@type":%s,"name":%s,"url":%s}', $context, $webtype, $name, $url );
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
$output = '';
|
1032 |
-
if ( $json )
|
1033 |
-
$output = '<script type="application/ld+json">' . $json . '</script>' . "\r\n";
|
1034 |
-
|
1035 |
-
return $output;
|
1036 |
-
}
|
1037 |
-
|
1038 |
-
/**
|
1039 |
-
* Return LD+Json Knowledge Graph helper.
|
1040 |
-
*
|
1041 |
-
* @since 2.2.8
|
1042 |
-
* @since 2.9.2 : Now grabs home URL from cache.
|
1043 |
-
* @since 2.9.3 Deprecated.
|
1044 |
-
* @deprecated
|
1045 |
-
*
|
1046 |
-
* @return string LD+json Knowledge Graph helper.
|
1047 |
-
*/
|
1048 |
-
public function ld_json_knowledge() {
|
1049 |
-
|
1050 |
-
$tsf = \the_seo_framework();
|
1051 |
-
|
1052 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_name()', '2.9.3', 'the_seo_framework()->get_ld_json_links()' );
|
1053 |
-
|
1054 |
-
return $tsf->get_ld_json_links();
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
/**
|
1058 |
-
* Generate LD+Json breadcrumb helper.
|
1059 |
-
*
|
1060 |
-
* @since 2.4.2
|
1061 |
-
* @since 2.9.3 Deprecated.
|
1062 |
-
* @deprecated
|
1063 |
-
*
|
1064 |
-
* @return escaped LD+json search helper string.
|
1065 |
-
*/
|
1066 |
-
public function ld_json_breadcrumbs() {
|
1067 |
-
|
1068 |
-
$tsf = \the_seo_framework();
|
1069 |
-
|
1070 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs()' );
|
1071 |
-
|
1072 |
-
return $tsf->get_ld_json_breadcrumbs();
|
1073 |
-
}
|
1074 |
-
|
1075 |
-
/**
|
1076 |
-
* Generate post breadcrumb.
|
1077 |
-
*
|
1078 |
-
* @since 2.6.0
|
1079 |
-
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1080 |
-
* @since 2.9.3 Deprecated.
|
1081 |
-
* @deprecated
|
1082 |
-
*
|
1083 |
-
* @return string $output The breadcrumb script.
|
1084 |
-
*/
|
1085 |
-
public function ld_json_breadcrumbs_post() {
|
1086 |
-
|
1087 |
-
$tsf = \the_seo_framework();
|
1088 |
-
|
1089 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs_post()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs_post()' );
|
1090 |
-
|
1091 |
-
return $tsf->get_ld_json_breadcrumbs_post();
|
1092 |
-
}
|
1093 |
-
|
1094 |
-
/**
|
1095 |
-
* Generate page breadcrumb.
|
1096 |
-
*
|
1097 |
-
* @since 2.6.0
|
1098 |
-
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1099 |
-
* @since 2.9.3 Deprecated.
|
1100 |
-
* @deprecated
|
1101 |
-
*
|
1102 |
-
* @return string $output The breadcrumb script.
|
1103 |
-
*/
|
1104 |
-
public function ld_json_breadcrumbs_page() {
|
1105 |
-
|
1106 |
-
$tsf = \the_seo_framework();
|
1107 |
-
|
1108 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs_page()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs_page()' );
|
1109 |
-
|
1110 |
-
return $tsf->get_ld_json_breadcrumbs_page();
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
/**
|
1114 |
-
* Return home page item for LD Json Breadcrumbs.
|
1115 |
-
*
|
1116 |
-
* @since 2.4.2
|
1117 |
-
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1118 |
-
* @since 2.9.3 Deprecated.
|
1119 |
-
* @deprecated
|
1120 |
-
* @staticvar string $first_item.
|
1121 |
-
*
|
1122 |
-
* @param string|null $item_type the breadcrumb item type.
|
1123 |
-
* @return string Home Breadcrumb item
|
1124 |
-
*/
|
1125 |
-
public function ld_json_breadcrumb_first( $item_type = null ) {
|
1126 |
-
|
1127 |
-
$tsf = \the_seo_framework();
|
1128 |
-
|
1129 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumb_first()', '2.9.3' );
|
1130 |
-
|
1131 |
-
static $first_item = null;
|
1132 |
-
|
1133 |
-
if ( isset( $first_item ) )
|
1134 |
-
return $first_item;
|
1135 |
-
|
1136 |
-
if ( is_null( $item_type ) )
|
1137 |
-
$item_type = json_encode( 'ListItem' );
|
1138 |
-
|
1139 |
-
$id = json_encode( $tsf->the_home_url_from_cache() );
|
1140 |
-
|
1141 |
-
if ( $tsf->ld_json_breadcrumbs_use_seo_title() ) {
|
1142 |
-
|
1143 |
-
$home_title = $tsf->get_option( 'homepage_title' );
|
1144 |
-
|
1145 |
-
if ( $home_title ) {
|
1146 |
-
$custom_name = $home_title;
|
1147 |
-
} elseif ( $tsf->has_page_on_front() ) {
|
1148 |
-
$home_id = (int) \get_option( 'page_on_front' );
|
1149 |
-
|
1150 |
-
$custom_name = $tsf->get_custom_field( '_genesis_title', $home_id ) ?: $tsf->get_blogname();
|
1151 |
-
} else {
|
1152 |
-
$custom_name = $tsf->get_blogname();
|
1153 |
-
}
|
1154 |
-
} else {
|
1155 |
-
$custom_name = $tsf->get_blogname();
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
$custom_name = json_encode( $custom_name );
|
1159 |
-
$image = $this->schema_image( $tsf->get_the_front_page_ID(), true );
|
1160 |
-
|
1161 |
-
$breadcrumb = array(
|
1162 |
-
'type' => $item_type,
|
1163 |
-
'pos' => '1',
|
1164 |
-
'id' => $id,
|
1165 |
-
'name' => $custom_name,
|
1166 |
-
'image' => $image,
|
1167 |
-
);
|
1168 |
-
|
1169 |
-
return $first_item = $tsf->make_breadcrumb( $breadcrumb, true );
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
/**
|
1173 |
-
* Return current page item for LD Json Breadcrumbs.
|
1174 |
-
*
|
1175 |
-
* @since 2.4.2
|
1176 |
-
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1177 |
-
* @since 2.9.3 Deprecated.
|
1178 |
-
* @deprecated
|
1179 |
-
* @staticvar string $last_item.
|
1180 |
-
* @staticvar string $type The breadcrumb item type.
|
1181 |
-
* @staticvar string $id The current post/page/archive url.
|
1182 |
-
* @staticvar string $name The current post/page/archive title.
|
1183 |
-
*
|
1184 |
-
* @param string $item_type the breadcrumb item type.
|
1185 |
-
* @param int $pos Last known position.
|
1186 |
-
* @param int $post_id The current Post ID
|
1187 |
-
* @return string Last Breadcrumb item
|
1188 |
-
*/
|
1189 |
-
public function ld_json_breadcrumb_last( $item_type = null, $pos = null, $post_id = null ) {
|
1190 |
-
|
1191 |
-
$tsf = \the_seo_framework();
|
1192 |
-
|
1193 |
-
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumb_last()', '2.9.3' );
|
1194 |
-
|
1195 |
-
/**
|
1196 |
-
* 2 (becomes 3) holds mostly true for single term items.
|
1197 |
-
* This shouldn't run anyway. Pos should always be provided.
|
1198 |
-
*/
|
1199 |
-
if ( is_null( $pos ) )
|
1200 |
-
$pos = 2;
|
1201 |
-
|
1202 |
-
//* Add current page.
|
1203 |
-
$pos = $pos + 1;
|
1204 |
-
|
1205 |
-
if ( is_null( $item_type ) ) {
|
1206 |
-
static $type = null;
|
1207 |
-
|
1208 |
-
if ( ! isset( $type ) )
|
1209 |
-
$type = json_encode( 'ListItem' );
|
1210 |
-
|
1211 |
-
$item_type = $type;
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
if ( empty( $post_id ) )
|
1215 |
-
$post_id = $tsf->get_the_real_ID();
|
1216 |
-
|
1217 |
-
static $id = null;
|
1218 |
-
static $name = null;
|
1219 |
-
|
1220 |
-
if ( ! isset( $id ) )
|
1221 |
-
$id = json_encode( $tsf->the_url_from_cache() );
|
1222 |
-
|
1223 |
-
$title_args = array(
|
1224 |
-
'term_id' => $post_id,
|
1225 |
-
'placeholder' => true,
|
1226 |
-
'meta' => true,
|
1227 |
-
'notagline' => true,
|
1228 |
-
'description_title' => true,
|
1229 |
-
'get_custom_field' => false,
|
1230 |
-
);
|
1231 |
-
|
1232 |
-
if ( ! isset( $name ) ) {
|
1233 |
-
if ( $tsf->ld_json_breadcrumbs_use_seo_title() ) {
|
1234 |
-
$name = $tsf->get_custom_field( '_genesis_title', $post_id ) ?: $tsf->title( '', '', '', $title_args );
|
1235 |
-
} else {
|
1236 |
-
$name = $tsf->title( '', '', '', $title_args );
|
1237 |
-
}
|
1238 |
-
$name = json_encode( $name );
|
1239 |
-
}
|
1240 |
-
|
1241 |
-
$image = $this->schema_image( $post_id, true );
|
1242 |
-
|
1243 |
-
$breadcrumb = array(
|
1244 |
-
'type' => $item_type,
|
1245 |
-
'pos' => (string) $pos,
|
1246 |
-
'id' => $id,
|
1247 |
-
'name' => $name,
|
1248 |
-
'image' => $image,
|
1249 |
-
);
|
1250 |
-
|
1251 |
-
return $this->make_breadcrumb( $breadcrumb, false );
|
1252 |
-
}
|
1253 |
-
|
1254 |
-
/**
|
1255 |
-
* Builds a breadcrumb.
|
1256 |
-
*
|
1257 |
-
* @since 2.6.0
|
1258 |
-
* @since 2.9.0 : No longer outputs image if it's not present.
|
1259 |
-
* @since 2.9.3 Deprecated.
|
1260 |
-
* @deprecated
|
1261 |
-
*
|
1262 |
-
* @param array $item : {
|
1263 |
-
* 'type',
|
1264 |
-
* 'pos',
|
1265 |
-
* 'id',
|
1266 |
-
* 'name'
|
1267 |
-
* }
|
1268 |
-
* @param bool $comma Whether to add a trailing comma.
|
1269 |
-
* @return string The LD+Json breadcrumb.
|
1270 |
-
*/
|
1271 |
-
public function make_breadcrumb( $item, $comma = true ) {
|
1272 |
-
|
1273 |
-
$tsf = \the_seo_framework();
|
1274 |
-
|
1275 |
-
$tsf->_deprecated_function( 'the_seo_framework()->make_breadcrumb()', '2.9.3' );
|
1276 |
-
|
1277 |
-
$comma = $comma ? ',' : '';
|
1278 |
-
|
1279 |
-
if ( $item['image'] && '""' !== $item['image'] ) {
|
1280 |
-
$retval = sprintf( '{"@type":%s,"position":%s,"item":{"@id":%s,"name":%s,"image":%s}}%s', $item['type'], $item['pos'], $item['id'], $item['name'], $item['image'], $comma );
|
1281 |
-
} else {
|
1282 |
-
$retval = sprintf( '{"@type":%s,"position":%s,"item":{"@id":%s,"name":%s}}%s', $item['type'], $item['pos'], $item['id'], $item['name'], $comma );
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
return $retval;
|
1286 |
-
}
|
1287 |
-
|
1288 |
-
/**
|
1289 |
-
* Fetch set Term data.
|
1290 |
-
*
|
1291 |
-
* @since 2.6.0
|
1292 |
-
* @since 2.7.0 Handles term object differently for upgraded database.
|
1293 |
-
* @since 3.0.0 Deprecated.
|
1294 |
-
*
|
1295 |
-
* @deprecated.
|
1296 |
-
*
|
1297 |
-
* @param object|null $term The TT object, if it isn't set, one is fetched.
|
1298 |
-
* @param int $term_id The term object.
|
1299 |
-
* @return array The SEO Framework TT data.
|
1300 |
-
*/
|
1301 |
-
public function get_term_data( $term = null, $term_id = 0 ) {
|
1302 |
-
|
1303 |
-
$tsf = \the_seo_framework();
|
1304 |
-
|
1305 |
-
$tsf->_deprecated_function( 'the_seo_framework()->get_term_data( $term, $term_id )', '3.0.0', 'the_seo_framework()->get_term_meta( $term_id )' );
|
1306 |
-
|
1307 |
-
if ( is_null( $term ) )
|
1308 |
-
$term = $tsf->fetch_the_term( $term_id );
|
1309 |
-
|
1310 |
-
if ( isset( $term->term_id ) )
|
1311 |
-
return $tsf->get_term_meta( $term->term_id );
|
1312 |
-
|
1313 |
-
//* Return null if no term can be set.
|
1314 |
-
return null;
|
1315 |
-
}
|
1316 |
-
|
1317 |
-
/**
|
1318 |
-
* Creates canonical URL.
|
1319 |
-
*
|
1320 |
-
* @since 2.0.0
|
1321 |
-
* @since 2.4.2 : Refactored arguments
|
1322 |
-
* @since 2.8.0 : No longer tolerates $id as Post object.
|
1323 |
-
* @since 2.9.0 : When using 'home => true' args parameter, the home path is added when set.
|
1324 |
-
* @since 2.9.2 Added filter usage cache.
|
1325 |
-
* @since 3.0.0 Deprecated.
|
1326 |
-
* @deprecated
|
1327 |
-
* @staticvar array $_has_filters
|
1328 |
-
*
|
1329 |
-
* @param string $url the url
|
1330 |
-
* @param array $args : accepted args : {
|
1331 |
-
* @param bool $paged Return current page URL without pagination if false
|
1332 |
-
* @param bool $paged_plural Whether to add pagination for the second or later page.
|
1333 |
-
* @param bool $from_option Get the canonical uri option
|
1334 |
-
* @param object $post The Post Object.
|
1335 |
-
* @param bool $external Whether to fetch the current WP Request or get the permalink by Post Object.
|
1336 |
-
* @param bool $is_term Fetch url for term.
|
1337 |
-
* @param object $term The term object.
|
1338 |
-
* @param bool $home Fetch home URL.
|
1339 |
-
* @param bool $forceslash Fetch home URL and slash it, always.
|
1340 |
-
* @param int $id The Page or Term ID.
|
1341 |
-
* }
|
1342 |
-
* @return string Escape url.
|
1343 |
-
*/
|
1344 |
-
public function the_url( $url = '', $args = array() ) {
|
1345 |
-
|
1346 |
-
$tsf = \the_seo_framework();
|
1347 |
-
|
1348 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->the_url()', '3.0.0', 'the_seo_framework()->get_canonical_url()' );
|
1349 |
-
|
1350 |
-
$args = $tsf->reparse_url_args( $args );
|
1351 |
-
|
1352 |
-
/**
|
1353 |
-
* Fetch permalink if Feed.
|
1354 |
-
* @since 2.5.2
|
1355 |
-
*/
|
1356 |
-
if ( $tsf->is_feed() )
|
1357 |
-
$url = \get_permalink();
|
1358 |
-
|
1359 |
-
//* Reset cache.
|
1360 |
-
$tsf->url_slashit = true;
|
1361 |
-
$tsf->unset_current_subdomain();
|
1362 |
-
$tsf->current_host = '';
|
1363 |
-
|
1364 |
-
$path = '';
|
1365 |
-
$scheme = '';
|
1366 |
-
$slashit = true;
|
1367 |
-
|
1368 |
-
if ( false === $args['home'] && empty( $url ) ) {
|
1369 |
-
/**
|
1370 |
-
* Get URL from options.
|
1371 |
-
* @since 2.2.9
|
1372 |
-
*/
|
1373 |
-
if ( $args['get_custom_field'] && $tsf->is_singular() ) {
|
1374 |
-
$custom_url = $tsf->get_custom_field( '_genesis_canonical_uri' );
|
1375 |
-
|
1376 |
-
if ( $custom_url ) {
|
1377 |
-
$url = $custom_url;
|
1378 |
-
$tsf->url_slashit = false;
|
1379 |
-
$parsed_url = \wp_parse_url( $custom_url );
|
1380 |
-
$scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] : 'http';
|
1381 |
-
}
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
if ( empty( $url ) )
|
1385 |
-
$path = $tsf->generate_url_path( $args );
|
1386 |
-
} elseif ( $args['home'] ) {
|
1387 |
-
$path = $tsf->get_home_path();
|
1388 |
-
}
|
1389 |
-
|
1390 |
-
static $_has_filters = null;
|
1391 |
-
if ( null === $_has_filters ) {
|
1392 |
-
$_has_filters = array();
|
1393 |
-
$_has_filters['the_seo_framework_url_path'] = \has_filter( 'the_seo_framework_url_path' );
|
1394 |
-
$_has_filters['the_seo_framework_url_output_args'] = \has_filter( 'the_seo_framework_url_output_args' );
|
1395 |
-
}
|
1396 |
-
|
1397 |
-
if ( $_has_filters['the_seo_framework_url_path'] ) {
|
1398 |
-
/**
|
1399 |
-
* Applies filters 'the_seo_framework_url_path' : array
|
1400 |
-
*
|
1401 |
-
* @since 2.8.0
|
1402 |
-
*
|
1403 |
-
* @param string $path the URL path.
|
1404 |
-
* @param int $id The current post, page or term ID.
|
1405 |
-
* @param bool $external Whether the call is made from outside the current ID scope. Like from the Sitemap.
|
1406 |
-
*/
|
1407 |
-
$path = (string) \apply_filters( 'the_seo_framework_url_path', $path, $args['id'], $args['external'] );
|
1408 |
-
}
|
1409 |
-
|
1410 |
-
if ( $_has_filters['the_seo_framework_url_output_args'] ) {
|
1411 |
-
/**
|
1412 |
-
* Applies filters 'the_seo_framework_sanitize_redirect_url' : array
|
1413 |
-
*
|
1414 |
-
* @since 2.8.0
|
1415 |
-
*
|
1416 |
-
* @param array : { 'url' => The full URL built from $path, 'scheme' => The preferred scheme }
|
1417 |
-
* @param string $path the URL path.
|
1418 |
-
* @param int $id The current post, page or term ID.
|
1419 |
-
* @param bool $external Whether the call is made from outside the current ID scope. Like from the Sitemap.
|
1420 |
-
*/
|
1421 |
-
$url_filter = (array) \apply_filters( 'the_seo_framework_url_output_args', array(), $path, $args['id'], $args['external'] );
|
1422 |
-
|
1423 |
-
if ( $url_filter ) {
|
1424 |
-
$url = $url_filter['url'];
|
1425 |
-
$scheme = $url_filter['scheme'];
|
1426 |
-
}
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
//* Non-custom URL
|
1430 |
-
if ( empty( $url ) ) {
|
1431 |
-
//* Reset cache if request is for the home URL.
|
1432 |
-
if ( $args['home'] )
|
1433 |
-
$tsf->unset_current_subdomain();
|
1434 |
-
|
1435 |
-
$url = $tsf->add_url_host( $path );
|
1436 |
-
$scheme = '';
|
1437 |
-
|
1438 |
-
$url = $tsf->add_url_subdomain( $url );
|
1439 |
-
}
|
1440 |
-
|
1441 |
-
$scheme = $scheme ?: $tsf->get_preferred_scheme();
|
1442 |
-
|
1443 |
-
$url = $tsf->set_url_scheme( $url, $scheme );
|
1444 |
-
|
1445 |
-
if ( $tsf->url_slashit ) {
|
1446 |
-
if ( $args['forceslash'] ) {
|
1447 |
-
$url = \trailingslashit( $url );
|
1448 |
-
} elseif ( $slashit ) {
|
1449 |
-
$url = \user_trailingslashit( $url );
|
1450 |
-
}
|
1451 |
-
}
|
1452 |
-
|
1453 |
-
if ( $tsf->pretty_permalinks ) {
|
1454 |
-
$url = \esc_url( $url, array( 'http', 'https' ) );
|
1455 |
-
} else {
|
1456 |
-
//* Keep the &'s more readable.
|
1457 |
-
$url = \esc_url_raw( $url, array( 'http', 'https' ) );
|
1458 |
-
}
|
1459 |
-
|
1460 |
-
return $url;
|
1461 |
-
}
|
1462 |
-
|
1463 |
-
/**
|
1464 |
-
* Parse and sanitize url args.
|
1465 |
-
*
|
1466 |
-
* @since 2.4.2
|
1467 |
-
* @since 2.9.2 Added filter usage cache.
|
1468 |
-
* @since 3.0.0 Deprecated.
|
1469 |
-
* @deprecated
|
1470 |
-
* @staticvar bool $_has_filter
|
1471 |
-
*
|
1472 |
-
* @param array $args required The passed arguments.
|
1473 |
-
* @param array $defaults The default arguments.
|
1474 |
-
* @param bool $get_defaults Return the default arguments. Ignoring $args.
|
1475 |
-
* @return array $args parsed args.
|
1476 |
-
*/
|
1477 |
-
public function parse_url_args( $args = array(), $defaults = array(), $get_defaults = false ) {
|
1478 |
-
|
1479 |
-
$tsf = \the_seo_framework();
|
1480 |
-
|
1481 |
-
$tsf->_deprecated_function( 'the_seo_framework()->parse_url_args()', '3.0.0' );
|
1482 |
-
|
1483 |
-
//* Passing back the defaults reduces the memory usage.
|
1484 |
-
if ( empty( $defaults ) ) :
|
1485 |
-
$defaults = array(
|
1486 |
-
'paged' => false,
|
1487 |
-
'paged_plural' => true,
|
1488 |
-
'get_custom_field' => true,
|
1489 |
-
'external' => false,
|
1490 |
-
'is_term' => false,
|
1491 |
-
'post' => null,
|
1492 |
-
'term' => null,
|
1493 |
-
'home' => false,
|
1494 |
-
'forceslash' => false,
|
1495 |
-
'id' => $tsf->get_the_real_ID(),
|
1496 |
-
);
|
1497 |
-
|
1498 |
-
static $_has_filter = null;
|
1499 |
-
if ( null === $_has_filter )
|
1500 |
-
$_has_filter = \has_filter( 'the_seo_framework_url_args' );
|
1501 |
-
|
1502 |
-
if ( $_has_filter ) {
|
1503 |
-
/**
|
1504 |
-
* @applies filters the_seo_framework_url_args : {
|
1505 |
-
* @param bool $paged Return current page URL without pagination if false
|
1506 |
-
* @param bool $paged_plural Whether to add pagination for the second or later page.
|
1507 |
-
* @param bool $from_option Get the canonical uri option
|
1508 |
-
* @param object $post The Post Object.
|
1509 |
-
* @param bool $external Whether to fetch the current WP Request or get the permalink by Post Object.
|
1510 |
-
* @param bool $is_term Fetch url for term.
|
1511 |
-
* @param object $term The term object.
|
1512 |
-
* @param bool $home Fetch home URL.
|
1513 |
-
* @param bool $forceslash Fetch home URL and slash it, always.
|
1514 |
-
* @param int $id The Page or Term ID.
|
1515 |
-
* }
|
1516 |
-
*
|
1517 |
-
* @since 2.5.0
|
1518 |
-
* @since 3.0.0 Deprecated
|
1519 |
-
* @deprecated
|
1520 |
-
*
|
1521 |
-
* @param array $defaults The url defaults.
|
1522 |
-
* @param array $args The input args.
|
1523 |
-
*/
|
1524 |
-
$defaults = (array) \apply_filters( 'the_seo_framework_url_args', $defaults, $args );
|
1525 |
-
}
|
1526 |
-
endif;
|
1527 |
-
|
1528 |
-
//* Return early if it's only a default args request.
|
1529 |
-
if ( $get_defaults )
|
1530 |
-
return $defaults;
|
1531 |
-
|
1532 |
-
//* Array merge doesn't support sanitation. We're simply type casting here.
|
1533 |
-
$args['paged'] = isset( $args['paged'] ) ? (bool) $args['paged'] : $defaults['paged'];
|
1534 |
-
$args['paged_plural'] = isset( $args['paged_plural'] ) ? (bool) $args['paged_plural'] : $defaults['paged_plural'];
|
1535 |
-
$args['get_custom_field'] = isset( $args['get_custom_field'] ) ? (bool) $args['get_custom_field'] : $defaults['get_custom_field'];
|
1536 |
-
$args['external'] = isset( $args['external'] ) ? (bool) $args['external'] : $defaults['external'];
|
1537 |
-
$args['is_term'] = isset( $args['is_term'] ) ? (bool) $args['is_term'] : $defaults['is_term'];
|
1538 |
-
$args['post'] = isset( $args['post'] ) ? (object) $args['post'] : $defaults['post'];
|
1539 |
-
$args['term'] = isset( $args['term'] ) ? (object) $args['term'] : $defaults['term'];
|
1540 |
-
$args['home'] = isset( $args['home'] ) ? (bool) $args['home'] : $defaults['home'];
|
1541 |
-
$args['forceslash'] = isset( $args['forceslash'] ) ? (bool) $args['forceslash'] : $defaults['forceslash'];
|
1542 |
-
$args['id'] = isset( $args['id'] ) ? (int) $args['id'] : $defaults['id'];
|
1543 |
-
|
1544 |
-
return $args;
|
1545 |
-
}
|
1546 |
-
|
1547 |
-
/**
|
1548 |
-
* Reparse URL args.
|
1549 |
-
*
|
1550 |
-
* @since 2.6.2
|
1551 |
-
* @since 2.9.2 Now passes args to filter.
|
1552 |
-
* @since 3.0.0 Deprecated.
|
1553 |
-
* @deprecated
|
1554 |
-
*
|
1555 |
-
* @param array $args required The passed arguments.
|
1556 |
-
* @return array $args parsed args.
|
1557 |
-
*/
|
1558 |
-
public function reparse_url_args( $args = array() ) {
|
1559 |
-
|
1560 |
-
$tsf = \the_seo_framework();
|
1561 |
-
|
1562 |
-
$tsf->_deprecated_function( 'the_seo_framework()->reparse_url_args()', '3.0.0' );
|
1563 |
-
|
1564 |
-
$default_args = $tsf->parse_url_args( $args, '', true );
|
1565 |
-
|
1566 |
-
if ( is_array( $args ) ) {
|
1567 |
-
if ( empty( $args ) ) {
|
1568 |
-
$args = $default_args;
|
1569 |
-
} else {
|
1570 |
-
$args = $tsf->parse_url_args( $args, $default_args );
|
1571 |
-
}
|
1572 |
-
} else {
|
1573 |
-
//* Old style parameters are used. Doing it wrong.
|
1574 |
-
$tsf->_doing_it_wrong( __METHOD__, 'Use $args = array() for parameters.', '2.4.2' );
|
1575 |
-
$args = $default_args;
|
1576 |
-
}
|
1577 |
-
|
1578 |
-
return $args;
|
1579 |
-
}
|
1580 |
-
|
1581 |
-
/**
|
1582 |
-
* Generate URL from arguments.
|
1583 |
-
*
|
1584 |
-
* @since 2.6.0
|
1585 |
-
* @since 3.0.0 Deprecated.
|
1586 |
-
* @deprecated
|
1587 |
-
* @NOTE: Handles full path, including home directory.
|
1588 |
-
*
|
1589 |
-
* @param array $args the URL args.
|
1590 |
-
* @return string $path
|
1591 |
-
*/
|
1592 |
-
public function generate_url_path( $args = array() ) {
|
1593 |
-
|
1594 |
-
$tsf = \the_seo_framework();
|
1595 |
-
|
1596 |
-
$tsf->_deprecated_function( 'the_seo_framework()->generate_url_path()', '3.0.0' );
|
1597 |
-
|
1598 |
-
$args = $tsf->reparse_url_args( $args );
|
1599 |
-
|
1600 |
-
if ( $tsf->is_archive() || $args['is_term'] ) :
|
1601 |
-
|
1602 |
-
$term = $args['term'];
|
1603 |
-
|
1604 |
-
//* Term or Taxonomy.
|
1605 |
-
if ( ! isset( $term ) )
|
1606 |
-
$term = \get_queried_object();
|
1607 |
-
|
1608 |
-
if ( isset( $term->taxonomy ) ) {
|
1609 |
-
//* Registered Terms and Taxonomies.
|
1610 |
-
$path = $tsf->get_relative_term_url( $term, $args );
|
1611 |
-
} elseif ( ! $args['external'] && isset( $GLOBALS['wp']->request ) ) {
|
1612 |
-
//* Everything else.
|
1613 |
-
$_url = \trailingslashit( \get_option( 'home' ) ) . $GLOBALS['wp']->request;
|
1614 |
-
$path = $tsf->set_url_scheme( $_url, 'relative' );
|
1615 |
-
} else {
|
1616 |
-
//* Nothing to see here...
|
1617 |
-
$path = '';
|
1618 |
-
}
|
1619 |
-
elseif ( $tsf->is_search() ) :
|
1620 |
-
$_url = \get_search_link();
|
1621 |
-
$path = $tsf->set_url_scheme( $_url, 'relative' );
|
1622 |
-
else :
|
1623 |
-
/**
|
1624 |
-
* Reworked to use the $args['id'] check based on get_the_real_ID.
|
1625 |
-
* @since 2.6.0 & 2.6.2
|
1626 |
-
*/
|
1627 |
-
$post_id = isset( $args['post']->ID ) ? $args['post']->ID : $args['id'];
|
1628 |
-
|
1629 |
-
if ( $tsf->pretty_permalinks && $post_id && $tsf->is_singular( $post_id ) ) {
|
1630 |
-
$post = \get_post( $post_id );
|
1631 |
-
|
1632 |
-
//* Don't slash draft links.
|
1633 |
-
if ( isset( $post->post_status ) && ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status ) )
|
1634 |
-
$tsf->url_slashit = false;
|
1635 |
-
}
|
1636 |
-
|
1637 |
-
$path = $tsf->build_singular_relative_url( $post_id, $args );
|
1638 |
-
endif;
|
1639 |
-
|
1640 |
-
return $path;
|
1641 |
-
}
|
1642 |
-
|
1643 |
-
/**
|
1644 |
-
* Generates relative URL for the Homepage and Singular Posts.
|
1645 |
-
*
|
1646 |
-
* @since 2.6.5
|
1647 |
-
* @NOTE: Handles full path, including home directory.
|
1648 |
-
* @since 2.8.0: Continues on empty post ID. Handles it as HomePage.
|
1649 |
-
* @since 3.0.0 Deprecated.
|
1650 |
-
* @deprecated
|
1651 |
-
*
|
1652 |
-
* @param int $post_id The ID.
|
1653 |
-
* @param array $args The URL arguments.
|
1654 |
-
* @return string relative Post or Page url.
|
1655 |
-
*/
|
1656 |
-
public function build_singular_relative_url( $post_id = null, $args = array() ) {
|
1657 |
-
|
1658 |
-
$tsf = \the_seo_framework();
|
1659 |
-
|
1660 |
-
$tsf->_deprecated_function( 'the_seo_framework()->build_singular_relative_url()', '3.0.0' );
|
1661 |
-
|
1662 |
-
if ( empty( $post_id ) ) {
|
1663 |
-
//* We can't fetch the post ID when there's an external request.
|
1664 |
-
if ( $args['external'] ) {
|
1665 |
-
$post_id = 0;
|
1666 |
-
} else {
|
1667 |
-
$post_id = $tsf->get_the_real_ID();
|
1668 |
-
}
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
$args = $tsf->reparse_url_args( $args );
|
1672 |
-
|
1673 |
-
if ( $args['external'] || ! $tsf->is_real_front_page() || ! $tsf->is_front_page_by_id( $post_id ) ) {
|
1674 |
-
$url = \get_permalink( $post_id );
|
1675 |
-
} elseif ( $tsf->is_real_front_page() || $tsf->is_front_page_by_id( $post_id ) ) {
|
1676 |
-
$url = \get_home_url();
|
1677 |
-
} elseif ( ! $args['external'] ) {
|
1678 |
-
if ( isset( $GLOBALS['wp']->request ) )
|
1679 |
-
$url = \trailingslashit( \get_home_url() ) . $GLOBALS['wp']->request;
|
1680 |
-
}
|
1681 |
-
|
1682 |
-
//* No permalink found.
|
1683 |
-
if ( ! isset( $url ) )
|
1684 |
-
return '';
|
1685 |
-
|
1686 |
-
$paged = false;
|
1687 |
-
|
1688 |
-
if ( false === $args['external'] ) {
|
1689 |
-
$paged = $tsf->is_singular() ? $tsf->page() : $tsf->paged();
|
1690 |
-
$paged = $tsf->maybe_get_paged( $paged, $args['paged'], $args['paged_plural'] );
|
1691 |
-
}
|
1692 |
-
|
1693 |
-
if ( $paged ) {
|
1694 |
-
if ( $tsf->pretty_permalinks ) {
|
1695 |
-
if ( $tsf->is_singular() ) {
|
1696 |
-
$url = \trailingslashit( $url ) . $paged;
|
1697 |
-
} else {
|
1698 |
-
$url = \trailingslashit( $url ) . 'page/' . $paged;
|
1699 |
-
}
|
1700 |
-
} else {
|
1701 |
-
if ( $tsf->is_singular() ) {
|
1702 |
-
$url = \add_query_arg( 'page', $paged, $url );
|
1703 |
-
} else {
|
1704 |
-
$url = \add_query_arg( 'paged', $paged, $url );
|
1705 |
-
}
|
1706 |
-
}
|
1707 |
-
}
|
1708 |
-
|
1709 |
-
return $tsf->set_url_scheme( $url, 'relative' );
|
1710 |
-
}
|
1711 |
-
|
1712 |
-
/**
|
1713 |
-
* Generates relative URL for current term.
|
1714 |
-
*
|
1715 |
-
* @since 2.4.2
|
1716 |
-
* @since 2.7.0 Added home directory to output.
|
1717 |
-
* @since 3.0.0 Deprecated.
|
1718 |
-
* @deprecated
|
1719 |
-
* @global object $wp_rewrite
|
1720 |
-
* @NOTE: Handles full path, including home directory.
|
1721 |
-
*
|
1722 |
-
* @param object $term The term object.
|
1723 |
-
* @param array|bool $args {
|
1724 |
-
* 'external' : Whether to fetch the WP Request or get the permalink by Post Object.
|
1725 |
-
* 'paged' : Whether to add pagination for all types.
|
1726 |
-
* 'paged_plural' : Whether to add pagination for the second or later page.
|
1727 |
-
* }
|
1728 |
-
* @return string Relative term or taxonomy URL.
|
1729 |
-
*/
|
1730 |
-
public function get_relative_term_url( $term = null, $args = array() ) {
|
1731 |
-
|
1732 |
-
$tsf = \the_seo_framework();
|
1733 |
-
|
1734 |
-
$tsf->_deprecated_function( 'the_seo_framework()->get_relative_term_url()', '3.0.0' );
|
1735 |
-
|
1736 |
-
global $wp_rewrite;
|
1737 |
-
|
1738 |
-
if ( ! is_array( $args ) ) {
|
1739 |
-
/**
|
1740 |
-
* @since 2.6.0
|
1741 |
-
* '$args = array()' replaced '$no_request = false'.
|
1742 |
-
*/
|
1743 |
-
$tsf->_doing_it_wrong( __METHOD__, 'Use $args = array() for parameters.', '2.6.0' );
|
1744 |
-
|
1745 |
-
$no_request = (bool) $args;
|
1746 |
-
$args = $tsf->parse_url_args( '', '', true );
|
1747 |
-
$args['external'] = $no_request;
|
1748 |
-
}
|
1749 |
-
|
1750 |
-
// We can't fetch the Term object within sitemaps.
|
1751 |
-
if ( $args['external'] && is_null( $term ) )
|
1752 |
-
return '';
|
1753 |
-
|
1754 |
-
if ( is_null( $term ) )
|
1755 |
-
$term = \get_queried_object();
|
1756 |
-
|
1757 |
-
$taxonomy = $term->taxonomy;
|
1758 |
-
$path = $wp_rewrite->get_extra_permastruct( $taxonomy );
|
1759 |
-
|
1760 |
-
$slug = $term->slug;
|
1761 |
-
$t = \get_taxonomy( $taxonomy );
|
1762 |
-
|
1763 |
-
$paged = $tsf->maybe_get_paged( $tsf->paged(), $args['paged'], $args['paged_plural'] );
|
1764 |
-
|
1765 |
-
if ( empty( $path ) ) :
|
1766 |
-
//* Default permalink structure.
|
1767 |
-
|
1768 |
-
if ( 'category' === $taxonomy ) {
|
1769 |
-
$path = '?cat=' . $term->term_id;
|
1770 |
-
} elseif ( isset( $t->query_var ) && '' !== $t->query_var ) {
|
1771 |
-
$path = '?' . $t->query_var . '=' . $slug;
|
1772 |
-
} else {
|
1773 |
-
$path = '?taxonomy=' . $taxonomy . '&term=' . $slug;
|
1774 |
-
}
|
1775 |
-
|
1776 |
-
if ( $paged )
|
1777 |
-
$path .= '&paged=' . $paged;
|
1778 |
-
|
1779 |
-
//* Don't slash it.
|
1780 |
-
$tsf->url_slashit = false;
|
1781 |
-
|
1782 |
-
else :
|
1783 |
-
if ( $t->rewrite['hierarchical'] ) {
|
1784 |
-
$hierarchical_slugs = array();
|
1785 |
-
$ancestors = \get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );
|
1786 |
-
|
1787 |
-
foreach ( (array) $ancestors as $ancestor ) {
|
1788 |
-
$ancestor_term = \get_term( $ancestor, $taxonomy );
|
1789 |
-
$hierarchical_slugs[] = $ancestor_term->slug;
|
1790 |
-
}
|
1791 |
-
|
1792 |
-
$hierarchical_slugs = array_reverse( $hierarchical_slugs );
|
1793 |
-
$hierarchical_slugs[] = $slug;
|
1794 |
-
|
1795 |
-
$path = str_replace( "%$taxonomy%", implode( '/', $hierarchical_slugs ), $path );
|
1796 |
-
} else {
|
1797 |
-
$path = str_replace( "%$taxonomy%", $slug, $path );
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
if ( $paged )
|
1801 |
-
$path = \trailingslashit( $path ) . 'page/' . $paged;
|
1802 |
-
|
1803 |
-
$path = \user_trailingslashit( $path, 'category' );
|
1804 |
-
endif;
|
1805 |
-
|
1806 |
-
//* Add plausible domain subdirectories.
|
1807 |
-
$url = \trailingslashit( \get_option( 'home' ) ) . ltrim( $path, ' \\/' );
|
1808 |
-
$path = $tsf->set_url_scheme( $url, 'relative' );
|
1809 |
-
|
1810 |
-
return $path;
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
/**
|
1814 |
-
* Adds subdomain to input URL.
|
1815 |
-
*
|
1816 |
-
* @since 2.6.5
|
1817 |
-
* @since 3.0.0 Deprecated.
|
1818 |
-
* @deprecated
|
1819 |
-
*
|
1820 |
-
* @param string $url The current URL without subdomain.
|
1821 |
-
* @return string $url Fully qualified URL with possible subdomain.
|
1822 |
-
*/
|
1823 |
-
public function add_url_subdomain( $url = '' ) {
|
1824 |
-
|
1825 |
-
$tsf = \the_seo_framework();
|
1826 |
-
$tsf->_deprecated_function( 'the_seo_framework()->add_url_subdomain()', '3.0.0' );
|
1827 |
-
|
1828 |
-
$url = $tsf->make_fully_qualified_url( $url );
|
1829 |
-
|
1830 |
-
//* Add subdomain, if set.
|
1831 |
-
if ( $subdomain = $tsf->get_current_subdomain() ) {
|
1832 |
-
$parsed_url = \wp_parse_url( $url );
|
1833 |
-
$scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] : 'http';
|
1834 |
-
$url = str_replace( $scheme . '://', '', $url );
|
1835 |
-
|
1836 |
-
//* Put it together.
|
1837 |
-
$url = $scheme . '://' . $subdomain . '.' . $url;
|
1838 |
-
}
|
1839 |
-
|
1840 |
-
return $url;
|
1841 |
-
}
|
1842 |
-
|
1843 |
-
/**
|
1844 |
-
* Fetches current subdomain set by $this->set_current_subdomain();
|
1845 |
-
*
|
1846 |
-
* @since 2.7.0
|
1847 |
-
* @since 3.0.0 Deprecated.
|
1848 |
-
* @deprecated
|
1849 |
-
* @staticvar string $subdomain
|
1850 |
-
*
|
1851 |
-
* @param null|string $set Whether to set a new subdomain.
|
1852 |
-
* @param bool $unset Whether to remove subdomain from cache.
|
1853 |
-
* @return string|bool The set subdomain, false if none is set.
|
1854 |
-
*/
|
1855 |
-
public function get_current_subdomain( $set = null, $unset = false ) {
|
1856 |
-
|
1857 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_current_subdomain()', '3.0.0' );
|
1858 |
-
|
1859 |
-
static $subdomain = null;
|
1860 |
-
|
1861 |
-
if ( isset( $set ) )
|
1862 |
-
$subdomain = \esc_html( $set );
|
1863 |
-
|
1864 |
-
if ( $unset )
|
1865 |
-
unset( $subdomain );
|
1866 |
-
|
1867 |
-
if ( isset( $subdomain ) )
|
1868 |
-
return $subdomain;
|
1869 |
-
|
1870 |
-
return false;
|
1871 |
-
}
|
1872 |
-
|
1873 |
-
/**
|
1874 |
-
* Sets current working subdomain.
|
1875 |
-
*
|
1876 |
-
* @since 2.7.0
|
1877 |
-
* @since 3.0.0 Deprecated.
|
1878 |
-
* @deprecated
|
1879 |
-
*
|
1880 |
-
* @param string $subdomain The current subdomain.
|
1881 |
-
* @return string The set subdomain.
|
1882 |
-
*/
|
1883 |
-
public function set_current_subdomain( $subdomain = '' ) {
|
1884 |
-
|
1885 |
-
$tsf = \the_seo_framework();
|
1886 |
-
|
1887 |
-
$tsf->_deprecated_function( 'the_seo_framework()->unset_current_subdomain()', '3.0.0' );
|
1888 |
-
|
1889 |
-
return $tsf->get_current_subdomain( $subdomain );
|
1890 |
-
}
|
1891 |
-
|
1892 |
-
/**
|
1893 |
-
* Unsets current working subdomain.
|
1894 |
-
*
|
1895 |
-
* @since 2.7.0
|
1896 |
-
* @since 3.0.0 Deprecated.
|
1897 |
-
* @deprecated
|
1898 |
-
*/
|
1899 |
-
public function unset_current_subdomain() {
|
1900 |
-
|
1901 |
-
$tsf = \the_seo_framework();
|
1902 |
-
|
1903 |
-
$tsf->_deprecated_function( 'the_seo_framework()->unset_current_subdomain()', '3.0.0' );
|
1904 |
-
|
1905 |
-
$tsf->get_current_subdomain( null, true );
|
1906 |
-
}
|
1907 |
-
|
1908 |
-
/**
|
1909 |
-
* Create full valid URL with parsed host.
|
1910 |
-
* Don't forget to use set_url_scheme() afterwards.
|
1911 |
-
*
|
1912 |
-
* Note: will return $path if no host can be found.
|
1913 |
-
*
|
1914 |
-
* @since 2.6.5
|
1915 |
-
* @since 3.0.0 Deprecated.
|
1916 |
-
* @deprecated
|
1917 |
-
*
|
1918 |
-
* @param string $path Current path.
|
1919 |
-
* @return string Full valid URL with http host.
|
1920 |
-
*/
|
1921 |
-
public function add_url_host( $path = '' ) {
|
1922 |
-
|
1923 |
-
$tsf = \the_seo_framework();
|
1924 |
-
|
1925 |
-
$tsf->_deprecated_function( 'the_seo_framework()->add_url_host()', '3.0.0' );
|
1926 |
-
|
1927 |
-
$host = $tsf->current_host ?: $tsf->get_home_host();
|
1928 |
-
|
1929 |
-
$scheme = $host ? 'http://' : '';
|
1930 |
-
|
1931 |
-
return $url = $scheme . \trailingslashit( $host ) . ltrim( $path, ' \\/' );
|
1932 |
-
}
|
1933 |
-
|
1934 |
-
/**
|
1935 |
-
* Fetches home URL subdirectory path. Like "wordpress.org/plugins/".
|
1936 |
-
*
|
1937 |
-
* @since 2.7.0
|
1938 |
-
* @since 3.0.0 Deprecated.
|
1939 |
-
* @deprecated
|
1940 |
-
* @staticvar string $cache
|
1941 |
-
*
|
1942 |
-
* @return string The home URL path.
|
1943 |
-
*/
|
1944 |
-
public function get_home_path() {
|
1945 |
-
|
1946 |
-
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_home_path()', '3.0.0' );
|
1947 |
-
|
1948 |
-
static $cache = null;
|
1949 |
-
|
1950 |
-
if ( isset( $cache ) )
|
1951 |
-
return $cache;
|
1952 |
-
|
1953 |
-
$path = '';
|
1954 |
-
|
1955 |
-
$parsed_url = \wp_parse_url( \get_option( 'home' ) );
|
1956 |
-
|
1957 |
-
if ( ! empty( $parsed_url['path'] ) && $path = ltrim( $parsed_url['path'], ' \\/' ) )
|
1958 |
-
$path = '/' . $path;
|
1959 |
-
|
1960 |
-
return $cache = $path;
|
1961 |
-
}
|
1962 |
-
|
1963 |
-
/**
|
1964 |
-
* Cache current URL in static variable
|
1965 |
-
* Must be called inside the loop
|
1966 |
-
*
|
1967 |
-
* @since 2.2.2
|
1968 |
-
* @since 3.0.0 Deprecated.
|
1969 |
-
* @deprecated
|
1970 |
-
* @staticvar array $url_cache
|
1971 |
-
*
|
1972 |
-
* @param string $url the url
|
1973 |
-
* @param int $post_id the page id, if empty it will fetch the requested ID, else the page uri
|
1974 |
-
* @param bool $paged Return current page URL with pagination
|
1975 |
-
* @param bool $from_option Get the canonical uri option
|
1976 |
-
* @param bool $paged_plural Whether to allow pagination on second or later pages.
|
1977 |
-
* @return string The url
|
1978 |
-
*/
|
1979 |
-
public function the_url_from_cache( $url = '', $post_id = null, $paged = false, $from_option = true, $paged_plural = true ) {
|
1980 |
-
|
1981 |
-
$tsf = \the_seo_framework();
|
1982 |
-
$tsf->_deprecated_function( 'the_seo_framework()->the_url_from_cache()', '3.0.0', `the_seo_framework()->get_current_canonical_url()` );
|
1983 |
-
|
1984 |
-
return $tsf->get_current_canonical_url();
|
1985 |
-
}
|
1986 |
-
|
1987 |
-
/**
|
1988 |
-
* Cache home URL in static variable
|
1989 |
-
*
|
1990 |
-
* @since 2.5.0
|
1991 |
-
* @since 2.9.0 Now returns subdirectory installations paths too.
|
1992 |
-
* @since 3.0.0 1: Now no longer regenerates home URL when parameters differ.
|
1993 |
-
* 2: Deprecated.
|
1994 |
-
* @deprecated
|
1995 |
-
* @staticvar string $url
|
1996 |
-
*
|
1997 |
-
* @param bool $force_slash Force slash
|
1998 |
-
* @return string The url
|
1999 |
-
*/
|
2000 |
-
public function the_home_url_from_cache( $force_slash = false ) {
|
2001 |
-
|
2002 |
-
$tsf = \the_seo_framework();
|
2003 |
-
$tsf->_deprecated_function( 'the_seo_framework()->the_home_url_from_cache()', '3.0.0', 'the_seo_framework()->get_homepage_permalink()' );
|
2004 |
-
|
2005 |
-
static $url;
|
2006 |
-
|
2007 |
-
if ( ! $url )
|
2008 |
-
$url = $tsf->get_homepage_permalink();
|
2009 |
-
|
2010 |
-
return $force_slash ? \trailingslashit( $url ) : $url;
|
2011 |
-
}
|
2012 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package The_SEO_Framework\Classes\Deprecated
|
4 |
+
*/
|
5 |
+
namespace The_SEO_Framework;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The SEO Framework plugin
|
11 |
+
* Copyright (C) 2015 - 2017 Sybre Waaijer, CyberWire (https://cyberwire.nl/)
|
12 |
+
*
|
13 |
+
* This program is free software: you can redistribute it and/or modify
|
14 |
+
* it under the terms of the GNU General Public License version 3 as published
|
15 |
+
* by the Free Software Foundation.
|
16 |
+
*
|
17 |
+
* This program is distributed in the hope that it will be useful,
|
18 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
* GNU General Public License for more details.
|
21 |
+
*
|
22 |
+
* You should have received a copy of the GNU General Public License
|
23 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
+
*/
|
25 |
+
|
26 |
+
defined( 'ABSPATH' ) or die;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Class The_SEO_Framework\Deprecated
|
30 |
+
*
|
31 |
+
* Contains all deprecated functions.
|
32 |
+
*
|
33 |
+
* @since 2.8.0
|
34 |
+
*/
|
35 |
+
final class Deprecated {
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Constructor. Does nothing.
|
39 |
+
*/
|
40 |
+
public function __construct() { }
|
41 |
+
|
42 |
+
/**
|
43 |
+
* HomePage Metabox General Tab Output.
|
44 |
+
*
|
45 |
+
* @since 2.6.0
|
46 |
+
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
47 |
+
*
|
48 |
+
* @deprecated
|
49 |
+
* @since 2.7.0
|
50 |
+
*/
|
51 |
+
public function homepage_metabox_general() {
|
52 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_general_tab()' );
|
53 |
+
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'general' );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* HomePage Metabox Additions Tab Output.
|
58 |
+
*
|
59 |
+
* @since 2.6.0
|
60 |
+
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
61 |
+
*
|
62 |
+
* @deprecated
|
63 |
+
* @since 2.7.0
|
64 |
+
*/
|
65 |
+
public function homepage_metabox_additions() {
|
66 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_additions_tab()' );
|
67 |
+
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'additions' );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* HomePage Metabox Robots Tab Output
|
72 |
+
*
|
73 |
+
* @since 2.6.0
|
74 |
+
* @see $this->homepage_metabox() Callback for HomePage Settings box.
|
75 |
+
*
|
76 |
+
* @deprecated
|
77 |
+
* @since 2.7.0
|
78 |
+
*/
|
79 |
+
public function homepage_metabox_robots() {
|
80 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Metaboxes::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Metaboxes::homepage_metabox_robots_tab()' );
|
81 |
+
\the_seo_framework()->get_view( 'metaboxes/homepage-metabox', array(), 'robots' );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Delete transient for the automatic description for blog on save request.
|
86 |
+
* Returns old option, since that's passed for sanitation within WP Core.
|
87 |
+
*
|
88 |
+
* @since 2.3.3
|
89 |
+
*
|
90 |
+
* @deprecated
|
91 |
+
* @since 2.7.0
|
92 |
+
*
|
93 |
+
* @param string $old_option The previous blog description option.
|
94 |
+
* @return string Previous option.
|
95 |
+
*/
|
96 |
+
public function delete_auto_description_blog_transient( $old_option ) {
|
97 |
+
|
98 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'The_SEO_Framework_Transients::delete_auto_description_frontpage_transient()' );
|
99 |
+
|
100 |
+
\the_seo_framework()->delete_auto_description_transient( \the_seo_framework()->get_the_front_page_ID(), '', 'frontpage' );
|
101 |
+
|
102 |
+
return $old_option;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Add term meta data into options table of the term.
|
107 |
+
* Adds separated database options for terms, as the terms table doesn't allow for addition.
|
108 |
+
*
|
109 |
+
* Applies filters array the_seo_framework_term_meta_defaults : Array of default term SEO options
|
110 |
+
* Applies filters mixed the_seo_framework_term_meta_{field} : Override filter for specifics.
|
111 |
+
* Applies filters array the_seo_framework_term_meta : Override output for term or taxonomy.
|
112 |
+
*
|
113 |
+
* @since 2.1.8
|
114 |
+
*
|
115 |
+
* @deprecated silently.
|
116 |
+
* @since WordPress 4.4.0
|
117 |
+
* @since The SEO Framework 2.7.0
|
118 |
+
* @since 2.8.0: Deprecated visually.
|
119 |
+
*
|
120 |
+
* @param object $term Database row object.
|
121 |
+
* @param string $taxonomy Taxonomy name that $term is part of.
|
122 |
+
* @return object $term Database row object.
|
123 |
+
*/
|
124 |
+
public function get_term_filter( $term, $taxonomy ) {
|
125 |
+
|
126 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "get_term_meta()"' );
|
127 |
+
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Adds The SEO Framework term meta data to functions that return multiple terms.
|
133 |
+
*
|
134 |
+
* @since 2.0.0
|
135 |
+
*
|
136 |
+
* @deprecated silently.
|
137 |
+
* @since WordPress 4.4.0
|
138 |
+
* @since The SEO Framework 2.7.0
|
139 |
+
* @since 2.8.0: Deprecated visually.
|
140 |
+
*
|
141 |
+
* @param array $terms Database row objects.
|
142 |
+
* @param string $taxonomy Taxonomy name that $terms are part of.
|
143 |
+
* @return array $terms Database row objects.
|
144 |
+
*/
|
145 |
+
public function get_terms_filter( array $terms, $taxonomy ) {
|
146 |
+
|
147 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "get_term_meta()"' );
|
148 |
+
|
149 |
+
return false;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Save taxonomy meta data.
|
154 |
+
* Fires when a user edits and saves a taxonomy.
|
155 |
+
*
|
156 |
+
* @since 2.1.8
|
157 |
+
*
|
158 |
+
* @deprecated silently.
|
159 |
+
* @since WordPress 4.4.0
|
160 |
+
* @since The SEO Framework 2.7.0
|
161 |
+
* @since 2.8.0: Deprecated visually.
|
162 |
+
*
|
163 |
+
* @param integer $term_id Term ID.
|
164 |
+
* @param integer $tt_id Term Taxonomy ID.
|
165 |
+
* @return void Early on AJAX call.
|
166 |
+
*/
|
167 |
+
public function taxonomy_seo_save( $term_id, $tt_id ) {
|
168 |
+
|
169 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "update_term_meta()"' );
|
170 |
+
|
171 |
+
return false;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Delete term meta data.
|
176 |
+
* Fires when a user deletes a term.
|
177 |
+
*
|
178 |
+
* @since 2.1.8
|
179 |
+
*
|
180 |
+
* @deprecated silently.
|
181 |
+
* @since WordPress 4.4.0
|
182 |
+
* @since The SEO Framework 2.7.0
|
183 |
+
* @since 2.8.0: Deprecated visually.
|
184 |
+
*
|
185 |
+
* @param integer $term_id Term ID.
|
186 |
+
* @param integer $tt_id Taxonomy Term ID.
|
187 |
+
*/
|
188 |
+
public function term_meta_delete( $term_id, $tt_id ) {
|
189 |
+
|
190 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Transients::' . __FUNCTION__, '2.7.0', 'WordPress Core "delete_term_meta()"' );
|
191 |
+
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Faster way of doing an in_array search compared to default PHP behavior.
|
197 |
+
* @NOTE only to show improvement with large arrays. Might slow down with small arrays.
|
198 |
+
* @NOTE can't do type checks. Always assume the comparing value is a string.
|
199 |
+
*
|
200 |
+
* @since 2.5.2
|
201 |
+
* @since 2.7.0 Deprecated.
|
202 |
+
* @deprecated
|
203 |
+
*
|
204 |
+
* @param string|array $needle The needle(s) to search for
|
205 |
+
* @param array $array The single dimensional array to search in.
|
206 |
+
* @return bool true if value is in array.
|
207 |
+
*/
|
208 |
+
public function in_array( $needle, $array, $strict = true ) {
|
209 |
+
|
210 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Core::' . __FUNCTION__, '2.7.0', 'in_array()' );
|
211 |
+
|
212 |
+
$array = array_flip( $array );
|
213 |
+
|
214 |
+
if ( is_string( $needle ) ) {
|
215 |
+
if ( isset( $array[ $needle ] ) )
|
216 |
+
return true;
|
217 |
+
} elseif ( is_array( $needle ) ) {
|
218 |
+
foreach ( $needle as $str ) {
|
219 |
+
if ( isset( $array[ $str ] ) )
|
220 |
+
return true;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Fetches posts with exclude_local_search option on
|
229 |
+
*
|
230 |
+
* @since 2.1.7
|
231 |
+
* @since 2.7.0 Deprecated.
|
232 |
+
* @deprecated
|
233 |
+
*
|
234 |
+
* @return array Excluded Post IDs
|
235 |
+
*/
|
236 |
+
public function exclude_search_ids() {
|
237 |
+
|
238 |
+
\the_seo_framework()->_deprecated_function( 'The_SEO_Framework_Search::' . __FUNCTION__, '2.7.0', 'the_seo_framework()->get_excluded_search_ids()' );
|
239 |
+
|
240 |
+
return $this->get_excluded_search_ids();
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Fetches posts with exclude_local_search option on.
|
245 |
+
*
|
246 |
+
* @since 2.1.7
|
247 |
+
* @since 2.7.0 No longer used for performance reasons.
|
248 |
+
* @uses $this->exclude_search_ids()
|
249 |
+
* @deprecated
|
250 |
+
* @since 2.8.0 deprecated.
|
251 |
+
*
|
252 |
+
* @param array $query The possible search query.
|
253 |
+
* @return void Early if no search query is found.
|
254 |
+
*/
|
255 |
+
public function search_filter( $query ) {
|
256 |
+
|
257 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->search_filter()', '2.8.0' );
|
258 |
+
|
259 |
+
// Don't exclude pages in wp-admin.
|
260 |
+
if ( $query->is_search && false === \the_seo_framework()->is_admin() ) {
|
261 |
+
|
262 |
+
$q = $query->query;
|
263 |
+
//* Only interact with an actual Search Query.
|
264 |
+
if ( false === isset( $q['s'] ) )
|
265 |
+
return;
|
266 |
+
|
267 |
+
//* Get excluded IDs.
|
268 |
+
$protected_posts = $this->get_excluded_search_ids();
|
269 |
+
if ( $protected_posts ) {
|
270 |
+
$get = $query->get( 'post__not_in' );
|
271 |
+
|
272 |
+
//* Merge user defined query.
|
273 |
+
if ( is_array( $get ) && ! empty( $get ) )
|
274 |
+
$protected_posts = array_merge( $protected_posts, $get );
|
275 |
+
|
276 |
+
$query->set( 'post__not_in', $protected_posts );
|
277 |
+
}
|
278 |
+
|
279 |
+
// Parse all ID's, even beyond the first page.
|
280 |
+
$query->set( 'no_found_rows', false );
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Fetches posts with exclude_local_search option on.
|
286 |
+
*
|
287 |
+
* @since 2.7.0
|
288 |
+
* @since 2.7.0 No longer used.
|
289 |
+
* @global int $blog_id
|
290 |
+
* @deprecated
|
291 |
+
*
|
292 |
+
* @return array Excluded Post IDs
|
293 |
+
*/
|
294 |
+
public function get_excluded_search_ids() {
|
295 |
+
|
296 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_excluded_search_ids()', '2.7.0' );
|
297 |
+
|
298 |
+
global $blog_id;
|
299 |
+
|
300 |
+
$cache_key = 'exclude_search_ids_' . $blog_id . '_' . \get_locale();
|
301 |
+
|
302 |
+
$post_ids = \the_seo_framework()->object_cache_get( $cache_key );
|
303 |
+
if ( false === $post_ids ) {
|
304 |
+
$post_ids = array();
|
305 |
+
|
306 |
+
$args = array(
|
307 |
+
'post_type' => 'any',
|
308 |
+
'numberposts' => -1,
|
309 |
+
'posts_per_page' => -1,
|
310 |
+
'order' => 'DESC',
|
311 |
+
'post_status' => 'publish',
|
312 |
+
'meta_key' => 'exclude_local_search',
|
313 |
+
'meta_value' => 1,
|
314 |
+
'meta_compare' => '=',
|
315 |
+
'cache_results' => true,
|
316 |
+
'suppress_filters' => false,
|
317 |
+
);
|
318 |
+
$get_posts = new \WP_Query;
|
319 |
+
$excluded_posts = $get_posts->query( $args );
|
320 |
+
unset( $get_posts );
|
321 |
+
|
322 |
+
if ( $excluded_posts )
|
323 |
+
$post_ids = \wp_list_pluck( $excluded_posts, 'ID' );
|
324 |
+
|
325 |
+
\the_seo_framework()->object_cache_set( $cache_key, $post_ids, 86400 );
|
326 |
+
}
|
327 |
+
|
328 |
+
// return an array of exclude post IDs
|
329 |
+
return $post_ids;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Registers option sanitation filter
|
334 |
+
*
|
335 |
+
* @since 2.2.2
|
336 |
+
* @since 2.7.0 : No longer used internally.
|
337 |
+
* @since 2.8.0 : Deprecated
|
338 |
+
* @deprecated
|
339 |
+
*
|
340 |
+
* @param string $filter The filter to call (see The_SEO_Framework_Site_Options::$available_filters for options)
|
341 |
+
* @param string $option The WordPress option name
|
342 |
+
* @param string|array $suboption Optional. The suboption or suboptions you want to filter
|
343 |
+
* @return true on completion.
|
344 |
+
*/
|
345 |
+
public function autodescription_add_option_filter( $filter, $option, $suboption = null ) {
|
346 |
+
|
347 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->add_option_filter()', '2.8.0' );
|
348 |
+
|
349 |
+
return \the_seo_framework()->add_option_filter( $filter, $option, $suboption );
|
350 |
+
}
|
351 |
+
|
352 |
+
/**
|
353 |
+
* Register each of the settings with a sanitization filter type.
|
354 |
+
*
|
355 |
+
* @since 2.2.2
|
356 |
+
* @since 2.8.0 Deprecated.
|
357 |
+
* @uses method add_filter() Assign filter to array of settings.
|
358 |
+
* @see The_SEO_Framework_Sanitize::add_filter() Add sanitization filters to options.
|
359 |
+
*/
|
360 |
+
public function sanitizer_filters() {
|
361 |
+
|
362 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->sanitizer_filters()', '2.8.0', 'the_seo_framework()->init_sanitizer_filters()' );
|
363 |
+
|
364 |
+
\the_seo_framework()->init_sanitizer_filters();
|
365 |
+
}
|
366 |
+
|
367 |
+
/**
|
368 |
+
* Fetches site icon brought in WordPress 4.3.0
|
369 |
+
*
|
370 |
+
* @since 2.2.1
|
371 |
+
* @since 2.8.0: Deprecated.
|
372 |
+
* @deprecated
|
373 |
+
*
|
374 |
+
* @param string $size The icon size, accepts 'full' and pixel values.
|
375 |
+
* @param bool $set_og_dimensions Whether to set size for OG image. Always falls back to the current post ID.
|
376 |
+
* @return string URL site icon, not escaped.
|
377 |
+
*/
|
378 |
+
public function site_icon( $size = 'full', $set_og_dimensions = false ) {
|
379 |
+
|
380 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->site_icon()', '2.8.0', 'the_seo_framework()->get_site_icon()' );
|
381 |
+
|
382 |
+
return the_seo_framework()->get_site_icon( $size, $set_og_dimensions );
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Delete transient on post save.
|
387 |
+
*
|
388 |
+
* @since 2.2.9
|
389 |
+
* @since 2.8.0 : Deprecated
|
390 |
+
* @deprecated
|
391 |
+
*
|
392 |
+
* @param int $post_id The Post ID that has been updated.
|
393 |
+
* @return bool|null True when sitemap is flushed. False on revision. Null
|
394 |
+
* when sitemaps are deactivated.
|
395 |
+
*/
|
396 |
+
public function delete_transients_post( $post_id ) {
|
397 |
+
|
398 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_transients_post()', '2.8.0', 'the_seo_framework()->delete_post_cache()' );
|
399 |
+
|
400 |
+
return \the_seo_framework()->delete_post_cache( $post_id );
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Delete transient on profile save.
|
405 |
+
*
|
406 |
+
* @since 2.6.4
|
407 |
+
* @since 2.8.0 : Deprecated
|
408 |
+
* @deprecated
|
409 |
+
*
|
410 |
+
* @param int $user_id The User ID that has been updated.
|
411 |
+
*/
|
412 |
+
public function delete_transients_author( $user_id ) {
|
413 |
+
|
414 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_transients_author()', '2.8.0', 'the_seo_framework()->delete_author_cache()' );
|
415 |
+
|
416 |
+
return \the_seo_framework()->delete_author_cache( $user_id );
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Flushes the home page LD+Json transient.
|
421 |
+
*
|
422 |
+
* @since 2.6.0
|
423 |
+
* @since 2.8.0 deprecated.
|
424 |
+
* @staticvar bool $flushed Prevents second flush.
|
425 |
+
* @deprecated
|
426 |
+
*
|
427 |
+
* @return bool Whether it's flushed on current call.
|
428 |
+
*/
|
429 |
+
public function delete_front_ld_json_transient() {
|
430 |
+
|
431 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->delete_front_ld_json_transient()', '2.8.0', 'the_seo_framework()->delete_cache( \'front\' )' );
|
432 |
+
|
433 |
+
static $flushed = null;
|
434 |
+
|
435 |
+
if ( isset( $flushed ) )
|
436 |
+
return false;
|
437 |
+
|
438 |
+
if ( ! \the_seo_framework()->is_option_checked( 'cache_meta_schema' ) )
|
439 |
+
return $flushed = false;
|
440 |
+
|
441 |
+
$front_id = \the_seo_framework()->get_the_front_page_ID();
|
442 |
+
|
443 |
+
\the_seo_framework()->delete_ld_json_transient( $front_id, '', 'frontpage' );
|
444 |
+
|
445 |
+
return $flushed = true;
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Determines whether we can use the new WordPress core term meta functionality.
|
450 |
+
*
|
451 |
+
* @since 2.7.0
|
452 |
+
* @since 2.8.0: Deprecated. WordPress 4.4+ is now required.
|
453 |
+
* @staticvar bool $cache
|
454 |
+
* @deprecated
|
455 |
+
*
|
456 |
+
* @return bool True when WordPress is at version 4.4 or higher and has an
|
457 |
+
* accordingly upgraded database.
|
458 |
+
*/
|
459 |
+
public function can_get_term_meta() {
|
460 |
+
|
461 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->can_get_term_meta()', '2.8.0' );
|
462 |
+
|
463 |
+
static $cache = null;
|
464 |
+
|
465 |
+
if ( isset( $cache ) )
|
466 |
+
return $cache;
|
467 |
+
|
468 |
+
return $cache = \get_option( 'db_version' ) >= 34370 && \get_option( 'the_seo_framework_upgraded_db_version' ) >= '2700' && \the_seo_framework()->wp_version( '4.3.999', '>' );
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Fetches term metadata array for the inpost term metabox.
|
473 |
+
*
|
474 |
+
* @since 2.7.0
|
475 |
+
* @since 2.8.0: Deprecated. WordPress 4.4+ is now required.
|
476 |
+
* @deprecated
|
477 |
+
*
|
478 |
+
* @param object $term The TT object. Must be assigned.
|
479 |
+
* @return array The SEO Framework TT data.
|
480 |
+
*/
|
481 |
+
protected function get_old_term_data( $term ) {
|
482 |
+
|
483 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_old_term_data()', '2.8.0' );
|
484 |
+
|
485 |
+
$data = array();
|
486 |
+
|
487 |
+
$data['title'] = isset( $term->admeta['doctitle'] ) ? $term->admeta['doctitle'] : '';
|
488 |
+
$data['description'] = isset( $term->admeta['description'] ) ? $term->admeta['description'] : '';
|
489 |
+
$data['noindex'] = isset( $term->admeta['noindex'] ) ? $term->admeta['noindex'] : '';
|
490 |
+
$data['nofollow'] = isset( $term->admeta['nofollow'] ) ? $term->admeta['nofollow'] : '';
|
491 |
+
$data['noarchive'] = isset( $term->admeta['noarchive'] ) ? $term->admeta['noarchive'] : '';
|
492 |
+
$flag = isset( $term->admeta['saved_flag'] ) ? (bool) $term->admeta['saved_flag'] : false;
|
493 |
+
|
494 |
+
//* Genesis data fetch. This will override our options with Genesis options on save.
|
495 |
+
if ( false === $flag && isset( $term->meta ) ) {
|
496 |
+
$data['title'] = empty( $data['title'] ) && isset( $term->meta['doctitle'] ) ? $term->meta['doctitle'] : $data['noindex'];
|
497 |
+
$data['description'] = empty( $data['description'] ) && isset( $term->meta['description'] ) ? $term->meta['description'] : $data['description'];
|
498 |
+
$data['noindex'] = empty( $data['noindex'] ) && isset( $term->meta['noindex'] ) ? $term->meta['noindex'] : $data['noindex'];
|
499 |
+
$data['nofollow'] = empty( $data['nofollow'] ) && isset( $term->meta['nofollow'] ) ? $term->meta['nofollow'] : $data['nofollow'];
|
500 |
+
$data['noarchive'] = empty( $data['noarchive'] ) && isset( $term->meta['noarchive'] ) ? $term->meta['noarchive'] : $data['noarchive'];
|
501 |
+
}
|
502 |
+
|
503 |
+
return $data;
|
504 |
+
}
|
505 |
+
|
506 |
+
/**
|
507 |
+
* Fetches og:image URL.
|
508 |
+
*
|
509 |
+
* @since 2.2.2
|
510 |
+
* @since 2.2.8 : Added theme icon detection.
|
511 |
+
* @since 2.5.2 : Added args filters.
|
512 |
+
* @since 2.8.0 : 1. Added theme logo detection.
|
513 |
+
* 2. Added inpost image selection detection.
|
514 |
+
* @since 2.8.2 : 1. Now returns something on post ID 0.
|
515 |
+
* 2. Added SEO settings fallback image selection detection.
|
516 |
+
* @since 2.9.0 : 1. Added 'skip_fallback' option to arguments.
|
517 |
+
* 2. Added 'escape' option to arguments.
|
518 |
+
* 3. First parameter is now arguments. Fallback for integer is added.
|
519 |
+
* 4. Second parameter is now deprecated.
|
520 |
+
* 5. Deprecated.
|
521 |
+
* @deprecated Use get_social_image instead.
|
522 |
+
*
|
523 |
+
* @param int|array $args The image arguments.
|
524 |
+
* Was: $post_id.
|
525 |
+
* Warning: Integer usage is only used for backwards compat.
|
526 |
+
* @param array $depr_args, Deprecated;
|
527 |
+
* Was $args The image arguments.
|
528 |
+
* @param bool $escape Whether to escape the image URL.
|
529 |
+
* Deprecated: You should use $args['escape'].
|
530 |
+
* @return string the image URL.
|
531 |
+
*/
|
532 |
+
public function get_image( $args = array(), $depr_args = '', $depr_escape = true ) {
|
533 |
+
|
534 |
+
$tsf = \the_seo_framework();
|
535 |
+
|
536 |
+
$tsf->_deprecated_function( 'the_seo_framework()->get_image()', '2.9.0', 'the_seo_framework()->get_social_image()' );
|
537 |
+
|
538 |
+
if ( is_int( $args ) || is_array( $depr_args ) ) {
|
539 |
+
$tsf->_doing_it_wrong( __METHOD__, 'First parameter is now used for arguments. Second parameter is deprecated.', '2.9.0' );
|
540 |
+
|
541 |
+
$post_id = $args;
|
542 |
+
$args = array();
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Backwards compat with parse args.
|
546 |
+
* @since 2.5.0
|
547 |
+
*/
|
548 |
+
if ( ! isset( $depr_args['post_id'] ) ) {
|
549 |
+
$args['post_id'] = $post_id ?: ( $tsf->is_singular( $post_id ) ? $tsf->get_the_real_ID() : 0 );
|
550 |
+
}
|
551 |
+
|
552 |
+
if ( is_array( $depr_args ) ) {
|
553 |
+
$args = \wp_parse_args( $depr_args, $args );
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
if ( false === $depr_escape ) {
|
558 |
+
$tsf->_doing_it_wrong( __METHOD__, 'Third parameter has been deprecated. Use `$args["escape"] => false` instead.', '2.9.0' );
|
559 |
+
$args['escape'] = false;
|
560 |
+
}
|
561 |
+
|
562 |
+
$args = $tsf->reparse_image_args( $args );
|
563 |
+
|
564 |
+
//* 0. Image from argument.
|
565 |
+
pre_0 : {
|
566 |
+
if ( $image = $args['image'] )
|
567 |
+
goto end;
|
568 |
+
}
|
569 |
+
|
570 |
+
//* Check if there are no disallowed arguments.
|
571 |
+
$all_allowed = empty( $args['disallowed'] );
|
572 |
+
|
573 |
+
//* 1. Fetch image from homepage SEO meta upload.
|
574 |
+
if ( $all_allowed || false === in_array( 'homemeta', $args['disallowed'], true ) ) {
|
575 |
+
if ( $image = $tsf->get_social_image_url_from_home_meta( $args['post_id'], true ) )
|
576 |
+
goto end;
|
577 |
+
}
|
578 |
+
|
579 |
+
if ( $args['post_id'] ) {
|
580 |
+
//* 2. Fetch image from SEO meta upload.
|
581 |
+
if ( $all_allowed || false === in_array( 'postmeta', $args['disallowed'], true ) ) {
|
582 |
+
if ( $image = $tsf->get_social_image_url_from_post_meta( $args['post_id'], true ) )
|
583 |
+
goto end;
|
584 |
+
}
|
585 |
+
|
586 |
+
//* 3. Fetch image from featured.
|
587 |
+
if ( $all_allowed || false === in_array( 'featured', $args['disallowed'], true ) ) {
|
588 |
+
if ( $image = $tsf->get_image_from_post_thumbnail( $args, true ) )
|
589 |
+
goto end;
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
+
if ( $args['skip_fallback'] )
|
594 |
+
goto end;
|
595 |
+
|
596 |
+
//* 4. Fetch image from SEO settings
|
597 |
+
if ( $all_allowed || false === in_array( 'option', $args['disallowed'], true ) ) {
|
598 |
+
if ( $image = $tsf->get_social_image_url_from_seo_settings( true ) )
|
599 |
+
goto end;
|
600 |
+
}
|
601 |
+
|
602 |
+
//* 5. Fetch image from fallback filter 1
|
603 |
+
/**
|
604 |
+
* Applies filters 'the_seo_framework_og_image_after_featured' : string
|
605 |
+
* @since 2.5.2
|
606 |
+
*/
|
607 |
+
fallback_1 : {
|
608 |
+
if ( $image = (string) \apply_filters( 'the_seo_framework_og_image_after_featured', '', $args['post_id'] ) )
|
609 |
+
goto end;
|
610 |
+
}
|
611 |
+
|
612 |
+
//* 6. Fallback: Get header image if exists
|
613 |
+
if ( ( $all_allowed || false === in_array( 'header', $args['disallowed'], true ) ) && \current_theme_supports( 'custom-header', 'default-image' ) ) {
|
614 |
+
if ( $image = $tsf->get_header_image( true ) )
|
615 |
+
goto end;
|
616 |
+
}
|
617 |
+
|
618 |
+
//* 7. Fetch image from fallback filter 2
|
619 |
+
/**
|
620 |
+
* Applies filters 'the_seo_framework_og_image_after_header' : string
|
621 |
+
* @since 2.5.2
|
622 |
+
*/
|
623 |
+
fallback_2 : {
|
624 |
+
if ( $image = (string) \apply_filters( 'the_seo_framework_og_image_after_header', '', $args['post_id'] ) )
|
625 |
+
goto end;
|
626 |
+
}
|
627 |
+
|
628 |
+
//* 8. Get the WP 4.5 Site Logo
|
629 |
+
if ( ( $all_allowed || false === in_array( 'logo', $args['disallowed'], true ) ) && $tsf->can_use_logo() ) {
|
630 |
+
if ( $image = $tsf->get_site_logo( true ) )
|
631 |
+
goto end;
|
632 |
+
}
|
633 |
+
|
634 |
+
//* 9. Get the WP 4.3 Site Icon
|
635 |
+
if ( $all_allowed || false === in_array( 'icon', $args['disallowed'], true ) ) {
|
636 |
+
if ( $image = $tsf->get_site_icon( 'full', true ) )
|
637 |
+
goto end;
|
638 |
+
}
|
639 |
+
|
640 |
+
end :;
|
641 |
+
|
642 |
+
if ( $args['escape'] && $image )
|
643 |
+
$image = \esc_url( $image );
|
644 |
+
|
645 |
+
return (string) $image;
|
646 |
+
}
|
647 |
+
|
648 |
+
/**
|
649 |
+
* Fetches image from post thumbnail.
|
650 |
+
* Resizes the image between 4096px if bigger. Then it saves the image and
|
651 |
+
* Keeps dimensions relative.
|
652 |
+
*
|
653 |
+
* @since 2.3.0
|
654 |
+
* @since 2.9.0 Changed parameters.
|
655 |
+
* @since 2.9.0 Deprecated.
|
656 |
+
* @since 2.9.3 Now supports 4K, rather than 1500px.
|
657 |
+
* @deprecated
|
658 |
+
*
|
659 |
+
* @param array $args The image args.
|
660 |
+
* Was: int $id The post/page ID.
|
661 |
+
* @param bool $set_og_dimensions Whether to set Open Graph image dimensions.
|
662 |
+
* Was: array $depr_args Deprecated. Image arguments.
|
663 |
+
* @return string|null the image url.
|
664 |
+
*/
|
665 |
+
public function get_image_from_post_thumbnail( $args = array(), $set_og_dimensions = false ) {
|
666 |
+
|
667 |
+
$tsf = \the_seo_framework();
|
668 |
+
|
669 |
+
$tsf->_deprecated_function( 'the_seo_framework()->get_image_from_post_thumbnail()', '2.9.0', 'the_seo_framework()->get_social_image_url_from_post_thumbnail()' );
|
670 |
+
|
671 |
+
if ( is_array( $set_og_dimensions ) ) {
|
672 |
+
$tsf->_doing_it_wrong( __METHOD__, 'First parameter are now arguments, second parameter is for setting og dimensions.', '2.9.0' );
|
673 |
+
$args = $set_og_dimensions;
|
674 |
+
$set_og_dimensions = false;
|
675 |
+
}
|
676 |
+
|
677 |
+
$args = $tsf->reparse_image_args( $args );
|
678 |
+
|
679 |
+
$id = \get_post_thumbnail_id( $args['post_id'] );
|
680 |
+
|
681 |
+
$args['get_the_real_ID'] = true;
|
682 |
+
|
683 |
+
$image = $id ? $tsf->parse_og_image( $id, $args, $set_og_dimensions ) : '';
|
684 |
+
|
685 |
+
return $image;
|
686 |
+
}
|
687 |
+
|
688 |
+
/**
|
689 |
+
* Detects front page.
|
690 |
+
*
|
691 |
+
* Returns true on SEO settings page if ID is 0.
|
692 |
+
*
|
693 |
+
* @since 2.6.0
|
694 |
+
* @since 2.9.0: Deprecated.
|
695 |
+
* @deprecated
|
696 |
+
*
|
697 |
+
* @param int $id The Page or Post ID.
|
698 |
+
* @return bool
|
699 |
+
*/
|
700 |
+
public function is_front_page( $id = 0 ) {
|
701 |
+
|
702 |
+
$tsf = \the_seo_framework();
|
703 |
+
|
704 |
+
$tsf->_deprecated_function( 'the_seo_framework()->is_front_page()', '2.9.0', 'the_seo_framework()->is_real_front_page() or the_seo_framework()->is_front_page_by_id()' );
|
705 |
+
|
706 |
+
static $cache = array();
|
707 |
+
|
708 |
+
if ( null !== $cache = $tsf->get_query_cache( __METHOD__, null, $id ) )
|
709 |
+
return $cache;
|
710 |
+
|
711 |
+
$is_front_page = false;
|
712 |
+
|
713 |
+
if ( \is_front_page() && empty( $id ) )
|
714 |
+
$is_front_page = true;
|
715 |
+
|
716 |
+
//* Elegant Themes Support. Yay.
|
717 |
+
if ( false === $is_front_page && empty( $id ) && $tsf->is_home() ) {
|
718 |
+
$sof = \get_option( 'show_on_front' );
|
719 |
+
|
720 |
+
if ( 'page' !== $sof && 'posts' !== $sof )
|
721 |
+
$is_front_page = true;
|
722 |
+
}
|
723 |
+
|
724 |
+
//* Compare against $id
|
725 |
+
if ( false === $is_front_page && $id ) {
|
726 |
+
$sof = \get_option( 'show_on_front' );
|
727 |
+
|
728 |
+
if ( 'page' === $sof && (int) \get_option( 'page_on_front' ) === $id )
|
729 |
+
$is_front_page = true;
|
730 |
+
|
731 |
+
if ( 'posts' === $sof && (int) \get_option( 'page_for_posts' ) === $id )
|
732 |
+
$is_front_page = true;
|
733 |
+
} elseif ( empty( $id ) && $tsf->is_seo_settings_page() ) {
|
734 |
+
$is_front_page = true;
|
735 |
+
}
|
736 |
+
|
737 |
+
$tsf->set_query_cache(
|
738 |
+
__METHOD__,
|
739 |
+
$is_front_page,
|
740 |
+
$id
|
741 |
+
);
|
742 |
+
|
743 |
+
return $is_front_page;
|
744 |
+
}
|
745 |
+
|
746 |
+
/**
|
747 |
+
* Returns http://schema.org json encoded context URL.
|
748 |
+
*
|
749 |
+
* @staticvar string $context
|
750 |
+
* @since 2.6.0
|
751 |
+
* @since 2.9.3 Deprecated.
|
752 |
+
* @deprecated
|
753 |
+
*
|
754 |
+
* @return string The json encoded context url.
|
755 |
+
*/
|
756 |
+
public function schema_context() {
|
757 |
+
|
758 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_context()', '2.9.3' );
|
759 |
+
|
760 |
+
static $context;
|
761 |
+
|
762 |
+
if ( isset( $context ) )
|
763 |
+
return $context;
|
764 |
+
|
765 |
+
return $context = json_encode( 'http://schema.org' );
|
766 |
+
}
|
767 |
+
|
768 |
+
|
769 |
+
/**
|
770 |
+
* Returns 'WebSite' json encoded type name.
|
771 |
+
*
|
772 |
+
* @staticvar string $context
|
773 |
+
* @since 2.6.0
|
774 |
+
* @since 2.9.3 Deprecated.
|
775 |
+
* @deprecated
|
776 |
+
*
|
777 |
+
* @return string The json encoded type name.
|
778 |
+
*/
|
779 |
+
public function schema_type() {
|
780 |
+
|
781 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_type()', '2.9.3' );
|
782 |
+
|
783 |
+
static $type;
|
784 |
+
|
785 |
+
if ( isset( $type ) )
|
786 |
+
return $type;
|
787 |
+
|
788 |
+
return $type = json_encode( 'WebSite' );
|
789 |
+
}
|
790 |
+
|
791 |
+
/**
|
792 |
+
* Returns json encoded home url.
|
793 |
+
*
|
794 |
+
* @staticvar string $url
|
795 |
+
* @since 2.6.0
|
796 |
+
* @since 2.9.3 Deprecated.
|
797 |
+
* @deprecated
|
798 |
+
*
|
799 |
+
* @return string The json encoded home url.
|
800 |
+
*/
|
801 |
+
public function schema_home_url() {
|
802 |
+
|
803 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_home_url()', '2.9.3' );
|
804 |
+
|
805 |
+
static $type;
|
806 |
+
|
807 |
+
if ( isset( $type ) )
|
808 |
+
return $type;
|
809 |
+
|
810 |
+
return $type = json_encode( \the_seo_framework()->the_home_url_from_cache() );
|
811 |
+
}
|
812 |
+
|
813 |
+
/**
|
814 |
+
* Returns json encoded blogname.
|
815 |
+
*
|
816 |
+
* @staticvar string $name
|
817 |
+
* @since 2.6.0
|
818 |
+
* @since 2.9.3 Deprecated.
|
819 |
+
* @deprecated
|
820 |
+
*
|
821 |
+
* @return string The json encoded blogname.
|
822 |
+
*/
|
823 |
+
public function schema_blog_name() {
|
824 |
+
|
825 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_blog_name()', '2.9.3' );
|
826 |
+
|
827 |
+
static $name;
|
828 |
+
|
829 |
+
if ( isset( $name ) )
|
830 |
+
return $name;
|
831 |
+
|
832 |
+
return $name = json_encode( \the_seo_framework()->get_blogname() );
|
833 |
+
}
|
834 |
+
|
835 |
+
/**
|
836 |
+
* Returns 'BreadcrumbList' json encoded type name.
|
837 |
+
*
|
838 |
+
* @staticvar string $crumblist
|
839 |
+
* @since 2.6.0
|
840 |
+
* @since 2.9.3 Deprecated.
|
841 |
+
* @deprecated
|
842 |
+
*
|
843 |
+
* @return string The json encoded 'BreadcrumbList'.
|
844 |
+
*/
|
845 |
+
public function schema_breadcrumblist() {
|
846 |
+
|
847 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_breadcrumblist()', '2.9.3' );
|
848 |
+
|
849 |
+
static $crumblist;
|
850 |
+
|
851 |
+
if ( isset( $crumblist ) )
|
852 |
+
return $crumblist;
|
853 |
+
|
854 |
+
return $crumblist = json_encode( 'BreadcrumbList' );
|
855 |
+
}
|
856 |
+
|
857 |
+
/**
|
858 |
+
* Returns 'ListItem' json encoded type name.
|
859 |
+
*
|
860 |
+
* @staticvar string $listitem
|
861 |
+
* @since 2.6.0
|
862 |
+
* @since 2.9.3 Deprecated.
|
863 |
+
* @deprecated
|
864 |
+
*
|
865 |
+
* @return string The json encoded 'ListItem'.
|
866 |
+
*/
|
867 |
+
public function schema_listitem() {
|
868 |
+
|
869 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->schema_listitem()', '2.9.3' );
|
870 |
+
|
871 |
+
static $listitem;
|
872 |
+
|
873 |
+
if ( isset( $listitem ) )
|
874 |
+
return $listitem;
|
875 |
+
|
876 |
+
return $listitem = json_encode( 'ListItem' );
|
877 |
+
}
|
878 |
+
|
879 |
+
/**
|
880 |
+
* Returns 'image' json encoded value.
|
881 |
+
*
|
882 |
+
* @staticvar array $images
|
883 |
+
* @since 2.7.0
|
884 |
+
* @since 2.9.0 : 1. No longer uses image from cache, instead: it skips fallback images.
|
885 |
+
* 2. Can now fetch home-page as blog set image.
|
886 |
+
* @since 2.9.3 Deprecated.
|
887 |
+
* @deprecated
|
888 |
+
*
|
889 |
+
* @param int|string $id The page, post, product or term ID.
|
890 |
+
* @param bool $singular Whether the ID is singular.
|
891 |
+
*/
|
892 |
+
public function schema_image( $id = 0, $singular = false ) {
|
893 |
+
|
894 |
+
$tsf = \the_seo_framework();
|
895 |
+
|
896 |
+
$tsf->_deprecated_function( 'the_seo_framework()->schema_image()', '2.9.3' );
|
897 |
+
|
898 |
+
static $images = array();
|
899 |
+
|
900 |
+
$id = (int) $id;
|
901 |
+
|
902 |
+
if ( isset( $images[ $id ][ $singular ] ) )
|
903 |
+
return $images[ $id ][ $singular ];
|
904 |
+
|
905 |
+
$image = '';
|
906 |
+
|
907 |
+
if ( $singular ) {
|
908 |
+
if ( $id === $tsf->get_the_front_page_ID() ) {
|
909 |
+
if ( $tsf->has_page_on_front() ) {
|
910 |
+
$image_args = array(
|
911 |
+
'post_id' => $id,
|
912 |
+
'skip_fallback' => true,
|
913 |
+
);
|
914 |
+
} else {
|
915 |
+
$image_args = array(
|
916 |
+
'post_id' => $id,
|
917 |
+
'skip_fallback' => true,
|
918 |
+
'disallowed' => array(
|
919 |
+
'postmeta',
|
920 |
+
'featured',
|
921 |
+
),
|
922 |
+
);
|
923 |
+
}
|
924 |
+
} else {
|
925 |
+
$image_args = array(
|
926 |
+
'post_id' => $id,
|
927 |
+
'skip_fallback' => true,
|
928 |
+
'disallowed' => array(
|
929 |
+
'homemeta'
|
930 |
+
),
|
931 |
+
);
|
932 |
+
}
|
933 |
+
$image = $tsf->get_social_image( $image_args );
|
934 |
+
} else {
|
935 |
+
//* Placeholder.
|
936 |
+
$image = '';
|
937 |
+
}
|
938 |
+
|
939 |
+
/**
|
940 |
+
* Applies filters 'the_seo_framework_ld_json_breadcrumb_image' : string
|
941 |
+
* @since 2.7.0
|
942 |
+
* @param string $image The current image.
|
943 |
+
* @param int $id The page, post, product or term ID.
|
944 |
+
* @param bool $singular Whether the ID is singular.
|
945 |
+
*/
|
946 |
+
$image = \apply_filters( 'the_seo_framework_ld_json_breadcrumb_image', $image, $id, $singular );
|
947 |
+
|
948 |
+
return $images[ $id ][ $singular ] = json_encode( \esc_url_raw( $image ) );
|
949 |
+
}
|
950 |
+
|
951 |
+
/**
|
952 |
+
* Generate LD+Json search helper.
|
953 |
+
*
|
954 |
+
* @since 2.2.8
|
955 |
+
* @since 2.9.3 Deprecated.
|
956 |
+
* @deprecated
|
957 |
+
*
|
958 |
+
* @return escaped LD+json search helper string.
|
959 |
+
*/
|
960 |
+
public function ld_json_search() {
|
961 |
+
|
962 |
+
$tsf = \the_seo_framework();
|
963 |
+
|
964 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_search()', '2.9.3' );
|
965 |
+
|
966 |
+
if ( false === $tsf->enable_ld_json_searchbox() )
|
967 |
+
return '';
|
968 |
+
|
969 |
+
$context = $this->schema_context();
|
970 |
+
$webtype = $this->schema_type();
|
971 |
+
$url = $this->schema_home_url();
|
972 |
+
$name = $this->schema_blog_name();
|
973 |
+
$actiontype = json_encode( 'SearchAction' );
|
974 |
+
|
975 |
+
/**
|
976 |
+
* Applies filters 'the_seo_framework_ld_json_search_url' : string
|
977 |
+
* @since 2.7.0
|
978 |
+
* @param string $search_url The default WordPress search URL without query parameters.
|
979 |
+
*/
|
980 |
+
$search_url = (string) \apply_filters( 'the_seo_framework_ld_json_search_url', $tsf->the_home_url_from_cache( true ) . '?s=' );
|
981 |
+
|
982 |
+
// Remove trailing quote and add it back.
|
983 |
+
$target = mb_substr( json_encode( $search_url ), 0, -1 ) . '{search_term_string}"';
|
984 |
+
|
985 |
+
$queryaction = json_encode( 'required name=search_term_string' );
|
986 |
+
|
987 |
+
$json = sprintf( '{"@context":%s,"@type":%s,"url":%s,"name":%s,"potentialAction":{"@type":%s,"target":%s,"query-input":%s}}', $context, $webtype, $url, $name, $actiontype, $target, $queryaction );
|
988 |
+
|
989 |
+
$output = '';
|
990 |
+
|
991 |
+
if ( $json )
|
992 |
+
$output = '<script type="application/ld+json">' . $json . '</script>' . "\r\n";
|
993 |
+
|
994 |
+
return $output;
|
995 |
+
}
|
996 |
+
|
997 |
+
/**
|
998 |
+
* Generate Site Name LD+Json script.
|
999 |
+
*
|
1000 |
+
* @since 2.6.0
|
1001 |
+
* @since 2.9.3 Deprecated.
|
1002 |
+
* @deprecated
|
1003 |
+
*
|
1004 |
+
* @return string The LD+JSon Site Name script.
|
1005 |
+
*/
|
1006 |
+
public function ld_json_name() {
|
1007 |
+
|
1008 |
+
$tsf = \the_seo_framework();
|
1009 |
+
|
1010 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_name()', '2.9.3' );
|
1011 |
+
|
1012 |
+
$context = $this->schema_context();
|
1013 |
+
$webtype = $this->schema_type();
|
1014 |
+
$url = $this->schema_home_url();
|
1015 |
+
$name = $this->schema_blog_name();
|
1016 |
+
$alternate = '';
|
1017 |
+
|
1018 |
+
$blogname = $tsf->get_blogname();
|
1019 |
+
$knowledge_name = $tsf->get_option( 'knowledge_name' );
|
1020 |
+
|
1021 |
+
if ( $knowledge_name && $knowledge_name !== $blogname ) {
|
1022 |
+
$alternate = json_encode( \esc_html( $knowledge_name ) );
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
if ( $alternate ) {
|
1026 |
+
$json = sprintf( '{"@context":%s,"@type":%s,"name":%s,"alternateName":%s,"url":%s}', $context, $webtype, $name, $alternate, $url );
|
1027 |
+
} else {
|
1028 |
+
$json = sprintf( '{"@context":%s,"@type":%s,"name":%s,"url":%s}', $context, $webtype, $name, $url );
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
$output = '';
|
1032 |
+
if ( $json )
|
1033 |
+
$output = '<script type="application/ld+json">' . $json . '</script>' . "\r\n";
|
1034 |
+
|
1035 |
+
return $output;
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
/**
|
1039 |
+
* Return LD+Json Knowledge Graph helper.
|
1040 |
+
*
|
1041 |
+
* @since 2.2.8
|
1042 |
+
* @since 2.9.2 : Now grabs home URL from cache.
|
1043 |
+
* @since 2.9.3 Deprecated.
|
1044 |
+
* @deprecated
|
1045 |
+
*
|
1046 |
+
* @return string LD+json Knowledge Graph helper.
|
1047 |
+
*/
|
1048 |
+
public function ld_json_knowledge() {
|
1049 |
+
|
1050 |
+
$tsf = \the_seo_framework();
|
1051 |
+
|
1052 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_name()', '2.9.3', 'the_seo_framework()->get_ld_json_links()' );
|
1053 |
+
|
1054 |
+
return $tsf->get_ld_json_links();
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
/**
|
1058 |
+
* Generate LD+Json breadcrumb helper.
|
1059 |
+
*
|
1060 |
+
* @since 2.4.2
|
1061 |
+
* @since 2.9.3 Deprecated.
|
1062 |
+
* @deprecated
|
1063 |
+
*
|
1064 |
+
* @return escaped LD+json search helper string.
|
1065 |
+
*/
|
1066 |
+
public function ld_json_breadcrumbs() {
|
1067 |
+
|
1068 |
+
$tsf = \the_seo_framework();
|
1069 |
+
|
1070 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs()' );
|
1071 |
+
|
1072 |
+
return $tsf->get_ld_json_breadcrumbs();
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
/**
|
1076 |
+
* Generate post breadcrumb.
|
1077 |
+
*
|
1078 |
+
* @since 2.6.0
|
1079 |
+
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1080 |
+
* @since 2.9.3 Deprecated.
|
1081 |
+
* @deprecated
|
1082 |
+
*
|
1083 |
+
* @return string $output The breadcrumb script.
|
1084 |
+
*/
|
1085 |
+
public function ld_json_breadcrumbs_post() {
|
1086 |
+
|
1087 |
+
$tsf = \the_seo_framework();
|
1088 |
+
|
1089 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs_post()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs_post()' );
|
1090 |
+
|
1091 |
+
return $tsf->get_ld_json_breadcrumbs_post();
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
/**
|
1095 |
+
* Generate page breadcrumb.
|
1096 |
+
*
|
1097 |
+
* @since 2.6.0
|
1098 |
+
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1099 |
+
* @since 2.9.3 Deprecated.
|
1100 |
+
* @deprecated
|
1101 |
+
*
|
1102 |
+
* @return string $output The breadcrumb script.
|
1103 |
+
*/
|
1104 |
+
public function ld_json_breadcrumbs_page() {
|
1105 |
+
|
1106 |
+
$tsf = \the_seo_framework();
|
1107 |
+
|
1108 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumbs_page()', '2.9.3', 'the_seo_framework()->get_ld_json_breadcrumbs_page()' );
|
1109 |
+
|
1110 |
+
return $tsf->get_ld_json_breadcrumbs_page();
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
/**
|
1114 |
+
* Return home page item for LD Json Breadcrumbs.
|
1115 |
+
*
|
1116 |
+
* @since 2.4.2
|
1117 |
+
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1118 |
+
* @since 2.9.3 Deprecated.
|
1119 |
+
* @deprecated
|
1120 |
+
* @staticvar string $first_item.
|
1121 |
+
*
|
1122 |
+
* @param string|null $item_type the breadcrumb item type.
|
1123 |
+
* @return string Home Breadcrumb item
|
1124 |
+
*/
|
1125 |
+
public function ld_json_breadcrumb_first( $item_type = null ) {
|
1126 |
+
|
1127 |
+
$tsf = \the_seo_framework();
|
1128 |
+
|
1129 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumb_first()', '2.9.3' );
|
1130 |
+
|
1131 |
+
static $first_item = null;
|
1132 |
+
|
1133 |
+
if ( isset( $first_item ) )
|
1134 |
+
return $first_item;
|
1135 |
+
|
1136 |
+
if ( is_null( $item_type ) )
|
1137 |
+
$item_type = json_encode( 'ListItem' );
|
1138 |
+
|
1139 |
+
$id = json_encode( $tsf->the_home_url_from_cache() );
|
1140 |
+
|
1141 |
+
if ( $tsf->ld_json_breadcrumbs_use_seo_title() ) {
|
1142 |
+
|
1143 |
+
$home_title = $tsf->get_option( 'homepage_title' );
|
1144 |
+
|
1145 |
+
if ( $home_title ) {
|
1146 |
+
$custom_name = $home_title;
|
1147 |
+
} elseif ( $tsf->has_page_on_front() ) {
|
1148 |
+
$home_id = (int) \get_option( 'page_on_front' );
|
1149 |
+
|
1150 |
+
$custom_name = $tsf->get_custom_field( '_genesis_title', $home_id ) ?: $tsf->get_blogname();
|
1151 |
+
} else {
|
1152 |
+
$custom_name = $tsf->get_blogname();
|
1153 |
+
}
|
1154 |
+
} else {
|
1155 |
+
$custom_name = $tsf->get_blogname();
|
1156 |
+
}
|
1157 |
+
|
1158 |
+
$custom_name = json_encode( $custom_name );
|
1159 |
+
$image = $this->schema_image( $tsf->get_the_front_page_ID(), true );
|
1160 |
+
|
1161 |
+
$breadcrumb = array(
|
1162 |
+
'type' => $item_type,
|
1163 |
+
'pos' => '1',
|
1164 |
+
'id' => $id,
|
1165 |
+
'name' => $custom_name,
|
1166 |
+
'image' => $image,
|
1167 |
+
);
|
1168 |
+
|
1169 |
+
return $first_item = $tsf->make_breadcrumb( $breadcrumb, true );
|
1170 |
+
}
|
1171 |
+
|
1172 |
+
/**
|
1173 |
+
* Return current page item for LD Json Breadcrumbs.
|
1174 |
+
*
|
1175 |
+
* @since 2.4.2
|
1176 |
+
* @since 2.9.0 Now uses $this->ld_json_breadcrumbs_use_seo_title()
|
1177 |
+
* @since 2.9.3 Deprecated.
|
1178 |
+
* @deprecated
|
1179 |
+
* @staticvar string $last_item.
|
1180 |
+
* @staticvar string $type The breadcrumb item type.
|
1181 |
+
* @staticvar string $id The current post/page/archive url.
|
1182 |
+
* @staticvar string $name The current post/page/archive title.
|
1183 |
+
*
|
1184 |
+
* @param string $item_type the breadcrumb item type.
|
1185 |
+
* @param int $pos Last known position.
|
1186 |
+
* @param int $post_id The current Post ID
|
1187 |
+
* @return string Last Breadcrumb item
|
1188 |
+
*/
|
1189 |
+
public function ld_json_breadcrumb_last( $item_type = null, $pos = null, $post_id = null ) {
|
1190 |
+
|
1191 |
+
$tsf = \the_seo_framework();
|
1192 |
+
|
1193 |
+
$tsf->_deprecated_function( 'the_seo_framework()->ld_json_breadcrumb_last()', '2.9.3' );
|
1194 |
+
|
1195 |
+
/**
|
1196 |
+
* 2 (becomes 3) holds mostly true for single term items.
|
1197 |
+
* This shouldn't run anyway. Pos should always be provided.
|
1198 |
+
*/
|
1199 |
+
if ( is_null( $pos ) )
|
1200 |
+
$pos = 2;
|
1201 |
+
|
1202 |
+
//* Add current page.
|
1203 |
+
$pos = $pos + 1;
|
1204 |
+
|
1205 |
+
if ( is_null( $item_type ) ) {
|
1206 |
+
static $type = null;
|
1207 |
+
|
1208 |
+
if ( ! isset( $type ) )
|
1209 |
+
$type = json_encode( 'ListItem' );
|
1210 |
+
|
1211 |
+
$item_type = $type;
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
if ( empty( $post_id ) )
|
1215 |
+
$post_id = $tsf->get_the_real_ID();
|
1216 |
+
|
1217 |
+
static $id = null;
|
1218 |
+
static $name = null;
|
1219 |
+
|
1220 |
+
if ( ! isset( $id ) )
|
1221 |
+
$id = json_encode( $tsf->the_url_from_cache() );
|
1222 |
+
|
1223 |
+
$title_args = array(
|
1224 |
+
'term_id' => $post_id,
|
1225 |
+
'placeholder' => true,
|
1226 |
+
'meta' => true,
|
1227 |
+
'notagline' => true,
|
1228 |
+
'description_title' => true,
|
1229 |
+
'get_custom_field' => false,
|
1230 |
+
);
|
1231 |
+
|
1232 |
+
if ( ! isset( $name ) ) {
|
1233 |
+
if ( $tsf->ld_json_breadcrumbs_use_seo_title() ) {
|
1234 |
+
$name = $tsf->get_custom_field( '_genesis_title', $post_id ) ?: $tsf->title( '', '', '', $title_args );
|
1235 |
+
} else {
|
1236 |
+
$name = $tsf->title( '', '', '', $title_args );
|
1237 |
+
}
|
1238 |
+
$name = json_encode( $name );
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
$image = $this->schema_image( $post_id, true );
|
1242 |
+
|
1243 |
+
$breadcrumb = array(
|
1244 |
+
'type' => $item_type,
|
1245 |
+
'pos' => (string) $pos,
|
1246 |
+
'id' => $id,
|
1247 |
+
'name' => $name,
|
1248 |
+
'image' => $image,
|
1249 |
+
);
|
1250 |
+
|
1251 |
+
return $this->make_breadcrumb( $breadcrumb, false );
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
/**
|
1255 |
+
* Builds a breadcrumb.
|
1256 |
+
*
|
1257 |
+
* @since 2.6.0
|
1258 |
+
* @since 2.9.0 : No longer outputs image if it's not present.
|
1259 |
+
* @since 2.9.3 Deprecated.
|
1260 |
+
* @deprecated
|
1261 |
+
*
|
1262 |
+
* @param array $item : {
|
1263 |
+
* 'type',
|
1264 |
+
* 'pos',
|
1265 |
+
* 'id',
|
1266 |
+
* 'name'
|
1267 |
+
* }
|
1268 |
+
* @param bool $comma Whether to add a trailing comma.
|
1269 |
+
* @return string The LD+Json breadcrumb.
|
1270 |
+
*/
|
1271 |
+
public function make_breadcrumb( $item, $comma = true ) {
|
1272 |
+
|
1273 |
+
$tsf = \the_seo_framework();
|
1274 |
+
|
1275 |
+
$tsf->_deprecated_function( 'the_seo_framework()->make_breadcrumb()', '2.9.3' );
|
1276 |
+
|
1277 |
+
$comma = $comma ? ',' : '';
|
1278 |
+
|
1279 |
+
if ( $item['image'] && '""' !== $item['image'] ) {
|
1280 |
+
$retval = sprintf( '{"@type":%s,"position":%s,"item":{"@id":%s,"name":%s,"image":%s}}%s', $item['type'], $item['pos'], $item['id'], $item['name'], $item['image'], $comma );
|
1281 |
+
} else {
|
1282 |
+
$retval = sprintf( '{"@type":%s,"position":%s,"item":{"@id":%s,"name":%s}}%s', $item['type'], $item['pos'], $item['id'], $item['name'], $comma );
|
1283 |
+
}
|
1284 |
+
|
1285 |
+
return $retval;
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
/**
|
1289 |
+
* Fetch set Term data.
|
1290 |
+
*
|
1291 |
+
* @since 2.6.0
|
1292 |
+
* @since 2.7.0 Handles term object differently for upgraded database.
|
1293 |
+
* @since 3.0.0 Deprecated.
|
1294 |
+
*
|
1295 |
+
* @deprecated.
|
1296 |
+
*
|
1297 |
+
* @param object|null $term The TT object, if it isn't set, one is fetched.
|
1298 |
+
* @param int $term_id The term object.
|
1299 |
+
* @return array The SEO Framework TT data.
|
1300 |
+
*/
|
1301 |
+
public function get_term_data( $term = null, $term_id = 0 ) {
|
1302 |
+
|
1303 |
+
$tsf = \the_seo_framework();
|
1304 |
+
|
1305 |
+
$tsf->_deprecated_function( 'the_seo_framework()->get_term_data( $term, $term_id )', '3.0.0', 'the_seo_framework()->get_term_meta( $term_id )' );
|
1306 |
+
|
1307 |
+
if ( is_null( $term ) )
|
1308 |
+
$term = $tsf->fetch_the_term( $term_id );
|
1309 |
+
|
1310 |
+
if ( isset( $term->term_id ) )
|
1311 |
+
return $tsf->get_term_meta( $term->term_id );
|
1312 |
+
|
1313 |
+
//* Return null if no term can be set.
|
1314 |
+
return null;
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
/**
|
1318 |
+
* Creates canonical URL.
|
1319 |
+
*
|
1320 |
+
* @since 2.0.0
|
1321 |
+
* @since 2.4.2 : Refactored arguments
|
1322 |
+
* @since 2.8.0 : No longer tolerates $id as Post object.
|
1323 |
+
* @since 2.9.0 : When using 'home => true' args parameter, the home path is added when set.
|
1324 |
+
* @since 2.9.2 Added filter usage cache.
|
1325 |
+
* @since 3.0.0 Deprecated.
|
1326 |
+
* @deprecated
|
1327 |
+
* @staticvar array $_has_filters
|
1328 |
+
*
|
1329 |
+
* @param string $url the url
|
1330 |
+
* @param array $args : accepted args : {
|
1331 |
+
* @param bool $paged Return current page URL without pagination if false
|
1332 |
+
* @param bool $paged_plural Whether to add pagination for the second or later page.
|
1333 |
+
* @param bool $from_option Get the canonical uri option
|
1334 |
+
* @param object $post The Post Object.
|
1335 |
+
* @param bool $external Whether to fetch the current WP Request or get the permalink by Post Object.
|
1336 |
+
* @param bool $is_term Fetch url for term.
|
1337 |
+
* @param object $term The term object.
|
1338 |
+
* @param bool $home Fetch home URL.
|
1339 |
+
* @param bool $forceslash Fetch home URL and slash it, always.
|
1340 |
+
* @param int $id The Page or Term ID.
|
1341 |
+
* }
|
1342 |
+
* @return string Escape url.
|
1343 |
+
*/
|
1344 |
+
public function the_url( $url = '', $args = array() ) {
|
1345 |
+
|
1346 |
+
$tsf = \the_seo_framework();
|
1347 |
+
|
1348 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->the_url()', '3.0.0', 'the_seo_framework()->get_canonical_url()' );
|
1349 |
+
|
1350 |
+
$args = $tsf->reparse_url_args( $args );
|
1351 |
+
|
1352 |
+
/**
|
1353 |
+
* Fetch permalink if Feed.
|
1354 |
+
* @since 2.5.2
|
1355 |
+
*/
|
1356 |
+
if ( $tsf->is_feed() )
|
1357 |
+
$url = \get_permalink();
|
1358 |
+
|
1359 |
+
//* Reset cache.
|
1360 |
+
$tsf->url_slashit = true;
|
1361 |
+
$tsf->unset_current_subdomain();
|
1362 |
+
$tsf->current_host = '';
|
1363 |
+
|
1364 |
+
$path = '';
|
1365 |
+
$scheme = '';
|
1366 |
+
$slashit = true;
|
1367 |
+
|
1368 |
+
if ( false === $args['home'] && empty( $url ) ) {
|
1369 |
+
/**
|
1370 |
+
* Get URL from options.
|
1371 |
+
* @since 2.2.9
|
1372 |
+
*/
|
1373 |
+
if ( $args['get_custom_field'] && $tsf->is_singular() ) {
|
1374 |
+
$custom_url = $tsf->get_custom_field( '_genesis_canonical_uri' );
|
1375 |
+
|
1376 |
+
if ( $custom_url ) {
|
1377 |
+
$url = $custom_url;
|
1378 |
+
$tsf->url_slashit = false;
|
1379 |
+
$parsed_url = \wp_parse_url( $custom_url );
|
1380 |
+
$scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] : 'http';
|
1381 |
+
}
|
1382 |
+
}
|
1383 |
+
|
1384 |
+
if ( empty( $url ) )
|
1385 |
+
$path = $tsf->generate_url_path( $args );
|
1386 |
+
} elseif ( $args['home'] ) {
|
1387 |
+
$path = $tsf->get_home_path();
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
static $_has_filters = null;
|
1391 |
+
if ( null === $_has_filters ) {
|
1392 |
+
$_has_filters = array();
|
1393 |
+
$_has_filters['the_seo_framework_url_path'] = \has_filter( 'the_seo_framework_url_path' );
|
1394 |
+
$_has_filters['the_seo_framework_url_output_args'] = \has_filter( 'the_seo_framework_url_output_args' );
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
if ( $_has_filters['the_seo_framework_url_path'] ) {
|
1398 |
+
/**
|
1399 |
+
* Applies filters 'the_seo_framework_url_path' : array
|
1400 |
+
*
|
1401 |
+
* @since 2.8.0
|
1402 |
+
*
|
1403 |
+
* @param string $path the URL path.
|
1404 |
+
* @param int $id The current post, page or term ID.
|
1405 |
+
* @param bool $external Whether the call is made from outside the current ID scope. Like from the Sitemap.
|
1406 |
+
*/
|
1407 |
+
$path = (string) \apply_filters( 'the_seo_framework_url_path', $path, $args['id'], $args['external'] );
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
if ( $_has_filters['the_seo_framework_url_output_args'] ) {
|
1411 |
+
/**
|
1412 |
+
* Applies filters 'the_seo_framework_sanitize_redirect_url' : array
|
1413 |
+
*
|
1414 |
+
* @since 2.8.0
|
1415 |
+
*
|
1416 |
+
* @param array : { 'url' => The full URL built from $path, 'scheme' => The preferred scheme }
|
1417 |
+
* @param string $path the URL path.
|
1418 |
+
* @param int $id The current post, page or term ID.
|
1419 |
+
* @param bool $external Whether the call is made from outside the current ID scope. Like from the Sitemap.
|
1420 |
+
*/
|
1421 |
+
$url_filter = (array) \apply_filters( 'the_seo_framework_url_output_args', array(), $path, $args['id'], $args['external'] );
|
1422 |
+
|
1423 |
+
if ( $url_filter ) {
|
1424 |
+
$url = $url_filter['url'];
|
1425 |
+
$scheme = $url_filter['scheme'];
|
1426 |
+
}
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
//* Non-custom URL
|
1430 |
+
if ( empty( $url ) ) {
|
1431 |
+
//* Reset cache if request is for the home URL.
|
1432 |
+
if ( $args['home'] )
|
1433 |
+
$tsf->unset_current_subdomain();
|
1434 |
+
|
1435 |
+
$url = $tsf->add_url_host( $path );
|
1436 |
+
$scheme = '';
|
1437 |
+
|
1438 |
+
$url = $tsf->add_url_subdomain( $url );
|
1439 |
+
}
|
1440 |
+
|
1441 |
+
$scheme = $scheme ?: $tsf->get_preferred_scheme();
|
1442 |
+
|
1443 |
+
$url = $tsf->set_url_scheme( $url, $scheme );
|
1444 |
+
|
1445 |
+
if ( $tsf->url_slashit ) {
|
1446 |
+
if ( $args['forceslash'] ) {
|
1447 |
+
$url = \trailingslashit( $url );
|
1448 |
+
} elseif ( $slashit ) {
|
1449 |
+
$url = \user_trailingslashit( $url );
|
1450 |
+
}
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
if ( $tsf->pretty_permalinks ) {
|
1454 |
+
$url = \esc_url( $url, array( 'http', 'https' ) );
|
1455 |
+
} else {
|
1456 |
+
//* Keep the &'s more readable.
|
1457 |
+
$url = \esc_url_raw( $url, array( 'http', 'https' ) );
|
1458 |
+
}
|
1459 |
+
|
1460 |
+
return $url;
|
1461 |
+
}
|
1462 |
+
|
1463 |
+
/**
|
1464 |
+
* Parse and sanitize url args.
|
1465 |
+
*
|
1466 |
+
* @since 2.4.2
|
1467 |
+
* @since 2.9.2 Added filter usage cache.
|
1468 |
+
* @since 3.0.0 Deprecated.
|
1469 |
+
* @deprecated
|
1470 |
+
* @staticvar bool $_has_filter
|
1471 |
+
*
|
1472 |
+
* @param array $args required The passed arguments.
|
1473 |
+
* @param array $defaults The default arguments.
|
1474 |
+
* @param bool $get_defaults Return the default arguments. Ignoring $args.
|
1475 |
+
* @return array $args parsed args.
|
1476 |
+
*/
|
1477 |
+
public function parse_url_args( $args = array(), $defaults = array(), $get_defaults = false ) {
|
1478 |
+
|
1479 |
+
$tsf = \the_seo_framework();
|
1480 |
+
|
1481 |
+
$tsf->_deprecated_function( 'the_seo_framework()->parse_url_args()', '3.0.0' );
|
1482 |
+
|
1483 |
+
//* Passing back the defaults reduces the memory usage.
|
1484 |
+
if ( empty( $defaults ) ) :
|
1485 |
+
$defaults = array(
|
1486 |
+
'paged' => false,
|
1487 |
+
'paged_plural' => true,
|
1488 |
+
'get_custom_field' => true,
|
1489 |
+
'external' => false,
|
1490 |
+
'is_term' => false,
|
1491 |
+
'post' => null,
|
1492 |
+
'term' => null,
|
1493 |
+
'home' => false,
|
1494 |
+
'forceslash' => false,
|
1495 |
+
'id' => $tsf->get_the_real_ID(),
|
1496 |
+
);
|
1497 |
+
|
1498 |
+
static $_has_filter = null;
|
1499 |
+
if ( null === $_has_filter )
|
1500 |
+
$_has_filter = \has_filter( 'the_seo_framework_url_args' );
|
1501 |
+
|
1502 |
+
if ( $_has_filter ) {
|
1503 |
+
/**
|
1504 |
+
* @applies filters the_seo_framework_url_args : {
|
1505 |
+
* @param bool $paged Return current page URL without pagination if false
|
1506 |
+
* @param bool $paged_plural Whether to add pagination for the second or later page.
|
1507 |
+
* @param bool $from_option Get the canonical uri option
|
1508 |
+
* @param object $post The Post Object.
|
1509 |
+
* @param bool $external Whether to fetch the current WP Request or get the permalink by Post Object.
|
1510 |
+
* @param bool $is_term Fetch url for term.
|
1511 |
+
* @param object $term The term object.
|
1512 |
+
* @param bool $home Fetch home URL.
|
1513 |
+
* @param bool $forceslash Fetch home URL and slash it, always.
|
1514 |
+
* @param int $id The Page or Term ID.
|
1515 |
+
* }
|
1516 |
+
*
|
1517 |
+
* @since 2.5.0
|
1518 |
+
* @since 3.0.0 Deprecated
|
1519 |
+
* @deprecated
|
1520 |
+
*
|
1521 |
+
* @param array $defaults The url defaults.
|
1522 |
+
* @param array $args The input args.
|
1523 |
+
*/
|
1524 |
+
$defaults = (array) \apply_filters( 'the_seo_framework_url_args', $defaults, $args );
|
1525 |
+
}
|
1526 |
+
endif;
|
1527 |
+
|
1528 |
+
//* Return early if it's only a default args request.
|
1529 |
+
if ( $get_defaults )
|
1530 |
+
return $defaults;
|
1531 |
+
|
1532 |
+
//* Array merge doesn't support sanitation. We're simply type casting here.
|
1533 |
+
$args['paged'] = isset( $args['paged'] ) ? (bool) $args['paged'] : $defaults['paged'];
|
1534 |
+
$args['paged_plural'] = isset( $args['paged_plural'] ) ? (bool) $args['paged_plural'] : $defaults['paged_plural'];
|
1535 |
+
$args['get_custom_field'] = isset( $args['get_custom_field'] ) ? (bool) $args['get_custom_field'] : $defaults['get_custom_field'];
|
1536 |
+
$args['external'] = isset( $args['external'] ) ? (bool) $args['external'] : $defaults['external'];
|
1537 |
+
$args['is_term'] = isset( $args['is_term'] ) ? (bool) $args['is_term'] : $defaults['is_term'];
|
1538 |
+
$args['post'] = isset( $args['post'] ) ? (object) $args['post'] : $defaults['post'];
|
1539 |
+
$args['term'] = isset( $args['term'] ) ? (object) $args['term'] : $defaults['term'];
|
1540 |
+
$args['home'] = isset( $args['home'] ) ? (bool) $args['home'] : $defaults['home'];
|
1541 |
+
$args['forceslash'] = isset( $args['forceslash'] ) ? (bool) $args['forceslash'] : $defaults['forceslash'];
|
1542 |
+
$args['id'] = isset( $args['id'] ) ? (int) $args['id'] : $defaults['id'];
|
1543 |
+
|
1544 |
+
return $args;
|
1545 |
+
}
|
1546 |
+
|
1547 |
+
/**
|
1548 |
+
* Reparse URL args.
|
1549 |
+
*
|
1550 |
+
* @since 2.6.2
|
1551 |
+
* @since 2.9.2 Now passes args to filter.
|
1552 |
+
* @since 3.0.0 Deprecated.
|
1553 |
+
* @deprecated
|
1554 |
+
*
|
1555 |
+
* @param array $args required The passed arguments.
|
1556 |
+
* @return array $args parsed args.
|
1557 |
+
*/
|
1558 |
+
public function reparse_url_args( $args = array() ) {
|
1559 |
+
|
1560 |
+
$tsf = \the_seo_framework();
|
1561 |
+
|
1562 |
+
$tsf->_deprecated_function( 'the_seo_framework()->reparse_url_args()', '3.0.0' );
|
1563 |
+
|
1564 |
+
$default_args = $tsf->parse_url_args( $args, '', true );
|
1565 |
+
|
1566 |
+
if ( is_array( $args ) ) {
|
1567 |
+
if ( empty( $args ) ) {
|
1568 |
+
$args = $default_args;
|
1569 |
+
} else {
|
1570 |
+
$args = $tsf->parse_url_args( $args, $default_args );
|
1571 |
+
}
|
1572 |
+
} else {
|
1573 |
+
//* Old style parameters are used. Doing it wrong.
|
1574 |
+
$tsf->_doing_it_wrong( __METHOD__, 'Use $args = array() for parameters.', '2.4.2' );
|
1575 |
+
$args = $default_args;
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
return $args;
|
1579 |
+
}
|
1580 |
+
|
1581 |
+
/**
|
1582 |
+
* Generate URL from arguments.
|
1583 |
+
*
|
1584 |
+
* @since 2.6.0
|
1585 |
+
* @since 3.0.0 Deprecated.
|
1586 |
+
* @deprecated
|
1587 |
+
* @NOTE: Handles full path, including home directory.
|
1588 |
+
*
|
1589 |
+
* @param array $args the URL args.
|
1590 |
+
* @return string $path
|
1591 |
+
*/
|
1592 |
+
public function generate_url_path( $args = array() ) {
|
1593 |
+
|
1594 |
+
$tsf = \the_seo_framework();
|
1595 |
+
|
1596 |
+
$tsf->_deprecated_function( 'the_seo_framework()->generate_url_path()', '3.0.0' );
|
1597 |
+
|
1598 |
+
$args = $tsf->reparse_url_args( $args );
|
1599 |
+
|
1600 |
+
if ( $tsf->is_archive() || $args['is_term'] ) :
|
1601 |
+
|
1602 |
+
$term = $args['term'];
|
1603 |
+
|
1604 |
+
//* Term or Taxonomy.
|
1605 |
+
if ( ! isset( $term ) )
|
1606 |
+
$term = \get_queried_object();
|
1607 |
+
|
1608 |
+
if ( isset( $term->taxonomy ) ) {
|
1609 |
+
//* Registered Terms and Taxonomies.
|
1610 |
+
$path = $tsf->get_relative_term_url( $term, $args );
|
1611 |
+
} elseif ( ! $args['external'] && isset( $GLOBALS['wp']->request ) ) {
|
1612 |
+
//* Everything else.
|
1613 |
+
$_url = \trailingslashit( \get_option( 'home' ) ) . $GLOBALS['wp']->request;
|
1614 |
+
$path = $tsf->set_url_scheme( $_url, 'relative' );
|
1615 |
+
} else {
|
1616 |
+
//* Nothing to see here...
|
1617 |
+
$path = '';
|
1618 |
+
}
|
1619 |
+
elseif ( $tsf->is_search() ) :
|
1620 |
+
$_url = \get_search_link();
|
1621 |
+
$path = $tsf->set_url_scheme( $_url, 'relative' );
|
1622 |
+
else :
|
1623 |
+
/**
|
1624 |
+
* Reworked to use the $args['id'] check based on get_the_real_ID.
|
1625 |
+
* @since 2.6.0 & 2.6.2
|
1626 |
+
*/
|
1627 |
+
$post_id = isset( $args['post']->ID ) ? $args['post']->ID : $args['id'];
|
1628 |
+
|
1629 |
+
if ( $tsf->pretty_permalinks && $post_id && $tsf->is_singular( $post_id ) ) {
|
1630 |
+
$post = \get_post( $post_id );
|
1631 |
+
|
1632 |
+
//* Don't slash draft links.
|
1633 |
+
if ( isset( $post->post_status ) && ( 'auto-draft' === $post->post_status || 'draft' === $post->post_status ) )
|
1634 |
+
$tsf->url_slashit = false;
|
1635 |
+
}
|
1636 |
+
|
1637 |
+
$path = $tsf->build_singular_relative_url( $post_id, $args );
|
1638 |
+
endif;
|
1639 |
+
|
1640 |
+
return $path;
|
1641 |
+
}
|
1642 |
+
|
1643 |
+
/**
|
1644 |
+
* Generates relative URL for the Homepage and Singular Posts.
|
1645 |
+
*
|
1646 |
+
* @since 2.6.5
|
1647 |
+
* @NOTE: Handles full path, including home directory.
|
1648 |
+
* @since 2.8.0: Continues on empty post ID. Handles it as HomePage.
|
1649 |
+
* @since 3.0.0 Deprecated.
|
1650 |
+
* @deprecated
|
1651 |
+
*
|
1652 |
+
* @param int $post_id The ID.
|
1653 |
+
* @param array $args The URL arguments.
|
1654 |
+
* @return string relative Post or Page url.
|
1655 |
+
*/
|
1656 |
+
public function build_singular_relative_url( $post_id = null, $args = array() ) {
|
1657 |
+
|
1658 |
+
$tsf = \the_seo_framework();
|
1659 |
+
|
1660 |
+
$tsf->_deprecated_function( 'the_seo_framework()->build_singular_relative_url()', '3.0.0' );
|
1661 |
+
|
1662 |
+
if ( empty( $post_id ) ) {
|
1663 |
+
//* We can't fetch the post ID when there's an external request.
|
1664 |
+
if ( $args['external'] ) {
|
1665 |
+
$post_id = 0;
|
1666 |
+
} else {
|
1667 |
+
$post_id = $tsf->get_the_real_ID();
|
1668 |
+
}
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
$args = $tsf->reparse_url_args( $args );
|
1672 |
+
|
1673 |
+
if ( $args['external'] || ! $tsf->is_real_front_page() || ! $tsf->is_front_page_by_id( $post_id ) ) {
|
1674 |
+
$url = \get_permalink( $post_id );
|
1675 |
+
} elseif ( $tsf->is_real_front_page() || $tsf->is_front_page_by_id( $post_id ) ) {
|
1676 |
+
$url = \get_home_url();
|
1677 |
+
} elseif ( ! $args['external'] ) {
|
1678 |
+
if ( isset( $GLOBALS['wp']->request ) )
|
1679 |
+
$url = \trailingslashit( \get_home_url() ) . $GLOBALS['wp']->request;
|
1680 |
+
}
|
1681 |
+
|
1682 |
+
//* No permalink found.
|
1683 |
+
if ( ! isset( $url ) )
|
1684 |
+
return '';
|
1685 |
+
|
1686 |
+
$paged = false;
|
1687 |
+
|
1688 |
+
if ( false === $args['external'] ) {
|
1689 |
+
$paged = $tsf->is_singular() ? $tsf->page() : $tsf->paged();
|
1690 |
+
$paged = $tsf->maybe_get_paged( $paged, $args['paged'], $args['paged_plural'] );
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
if ( $paged ) {
|
1694 |
+
if ( $tsf->pretty_permalinks ) {
|
1695 |
+
if ( $tsf->is_singular() ) {
|
1696 |
+
$url = \trailingslashit( $url ) . $paged;
|
1697 |
+
} else {
|
1698 |
+
$url = \trailingslashit( $url ) . 'page/' . $paged;
|
1699 |
+
}
|
1700 |
+
} else {
|
1701 |
+
if ( $tsf->is_singular() ) {
|
1702 |
+
$url = \add_query_arg( 'page', $paged, $url );
|
1703 |
+
} else {
|
1704 |
+
$url = \add_query_arg( 'paged', $paged, $url );
|
1705 |
+
}
|
1706 |
+
}
|
1707 |
+
}
|
1708 |
+
|
1709 |
+
return $tsf->set_url_scheme( $url, 'relative' );
|
1710 |
+
}
|
1711 |
+
|
1712 |
+
/**
|
1713 |
+
* Generates relative URL for current term.
|
1714 |
+
*
|
1715 |
+
* @since 2.4.2
|
1716 |
+
* @since 2.7.0 Added home directory to output.
|
1717 |
+
* @since 3.0.0 Deprecated.
|
1718 |
+
* @deprecated
|
1719 |
+
* @global object $wp_rewrite
|
1720 |
+
* @NOTE: Handles full path, including home directory.
|
1721 |
+
*
|
1722 |
+
* @param object $term The term object.
|
1723 |
+
* @param array|bool $args {
|
1724 |
+
* 'external' : Whether to fetch the WP Request or get the permalink by Post Object.
|
1725 |
+
* 'paged' : Whether to add pagination for all types.
|
1726 |
+
* 'paged_plural' : Whether to add pagination for the second or later page.
|
1727 |
+
* }
|
1728 |
+
* @return string Relative term or taxonomy URL.
|
1729 |
+
*/
|
1730 |
+
public function get_relative_term_url( $term = null, $args = array() ) {
|
1731 |
+
|
1732 |
+
$tsf = \the_seo_framework();
|
1733 |
+
|
1734 |
+
$tsf->_deprecated_function( 'the_seo_framework()->get_relative_term_url()', '3.0.0' );
|
1735 |
+
|
1736 |
+
global $wp_rewrite;
|
1737 |
+
|
1738 |
+
if ( ! is_array( $args ) ) {
|
1739 |
+
/**
|
1740 |
+
* @since 2.6.0
|
1741 |
+
* '$args = array()' replaced '$no_request = false'.
|
1742 |
+
*/
|
1743 |
+
$tsf->_doing_it_wrong( __METHOD__, 'Use $args = array() for parameters.', '2.6.0' );
|
1744 |
+
|
1745 |
+
$no_request = (bool) $args;
|
1746 |
+
$args = $tsf->parse_url_args( '', '', true );
|
1747 |
+
$args['external'] = $no_request;
|
1748 |
+
}
|
1749 |
+
|
1750 |
+
// We can't fetch the Term object within sitemaps.
|
1751 |
+
if ( $args['external'] && is_null( $term ) )
|
1752 |
+
return '';
|
1753 |
+
|
1754 |
+
if ( is_null( $term ) )
|
1755 |
+
$term = \get_queried_object();
|
1756 |
+
|
1757 |
+
$taxonomy = $term->taxonomy;
|
1758 |
+
$path = $wp_rewrite->get_extra_permastruct( $taxonomy );
|
1759 |
+
|
1760 |
+
$slug = $term->slug;
|
1761 |
+
$t = \get_taxonomy( $taxonomy );
|
1762 |
+
|
1763 |
+
$paged = $tsf->maybe_get_paged( $tsf->paged(), $args['paged'], $args['paged_plural'] );
|
1764 |
+
|
1765 |
+
if ( empty( $path ) ) :
|
1766 |
+
//* Default permalink structure.
|
1767 |
+
|
1768 |
+
if ( 'category' === $taxonomy ) {
|
1769 |
+
$path = '?cat=' . $term->term_id;
|
1770 |
+
} elseif ( isset( $t->query_var ) && '' !== $t->query_var ) {
|
1771 |
+
$path = '?' . $t->query_var . '=' . $slug;
|
1772 |
+
} else {
|
1773 |
+
$path = '?taxonomy=' . $taxonomy . '&term=' . $slug;
|
1774 |
+
}
|
1775 |
+
|
1776 |
+
if ( $paged )
|
1777 |
+
$path .= '&paged=' . $paged;
|
1778 |
+
|
1779 |
+
//* Don't slash it.
|
1780 |
+
$tsf->url_slashit = false;
|
1781 |
+
|
1782 |
+
else :
|
1783 |
+
if ( $t->rewrite['hierarchical'] ) {
|
1784 |
+
$hierarchical_slugs = array();
|
1785 |
+
$ancestors = \get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );
|
1786 |
+
|
1787 |
+
foreach ( (array) $ancestors as $ancestor ) {
|
1788 |
+
$ancestor_term = \get_term( $ancestor, $taxonomy );
|
1789 |
+
$hierarchical_slugs[] = $ancestor_term->slug;
|
1790 |
+
}
|
1791 |
+
|
1792 |
+
$hierarchical_slugs = array_reverse( $hierarchical_slugs );
|
1793 |
+
$hierarchical_slugs[] = $slug;
|
1794 |
+
|
1795 |
+
$path = str_replace( "%$taxonomy%", implode( '/', $hierarchical_slugs ), $path );
|
1796 |
+
} else {
|
1797 |
+
$path = str_replace( "%$taxonomy%", $slug, $path );
|
1798 |
+
}
|
1799 |
+
|
1800 |
+
if ( $paged )
|
1801 |
+
$path = \trailingslashit( $path ) . 'page/' . $paged;
|
1802 |
+
|
1803 |
+
$path = \user_trailingslashit( $path, 'category' );
|
1804 |
+
endif;
|
1805 |
+
|
1806 |
+
//* Add plausible domain subdirectories.
|
1807 |
+
$url = \trailingslashit( \get_option( 'home' ) ) . ltrim( $path, ' \\/' );
|
1808 |
+
$path = $tsf->set_url_scheme( $url, 'relative' );
|
1809 |
+
|
1810 |
+
return $path;
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
/**
|
1814 |
+
* Adds subdomain to input URL.
|
1815 |
+
*
|
1816 |
+
* @since 2.6.5
|
1817 |
+
* @since 3.0.0 Deprecated.
|
1818 |
+
* @deprecated
|
1819 |
+
*
|
1820 |
+
* @param string $url The current URL without subdomain.
|
1821 |
+
* @return string $url Fully qualified URL with possible subdomain.
|
1822 |
+
*/
|
1823 |
+
public function add_url_subdomain( $url = '' ) {
|
1824 |
+
|
1825 |
+
$tsf = \the_seo_framework();
|
1826 |
+
$tsf->_deprecated_function( 'the_seo_framework()->add_url_subdomain()', '3.0.0' );
|
1827 |
+
|
1828 |
+
$url = $tsf->make_fully_qualified_url( $url );
|
1829 |
+
|
1830 |
+
//* Add subdomain, if set.
|
1831 |
+
if ( $subdomain = $tsf->get_current_subdomain() ) {
|
1832 |
+
$parsed_url = \wp_parse_url( $url );
|
1833 |
+
$scheme = isset( $parsed_url['scheme'] ) ? $parsed_url['scheme'] : 'http';
|
1834 |
+
$url = str_replace( $scheme . '://', '', $url );
|
1835 |
+
|
1836 |
+
//* Put it together.
|
1837 |
+
$url = $scheme . '://' . $subdomain . '.' . $url;
|
1838 |
+
}
|
1839 |
+
|
1840 |
+
return $url;
|
1841 |
+
}
|
1842 |
+
|
1843 |
+
/**
|
1844 |
+
* Fetches current subdomain set by $this->set_current_subdomain();
|
1845 |
+
*
|
1846 |
+
* @since 2.7.0
|
1847 |
+
* @since 3.0.0 Deprecated.
|
1848 |
+
* @deprecated
|
1849 |
+
* @staticvar string $subdomain
|
1850 |
+
*
|
1851 |
+
* @param null|string $set Whether to set a new subdomain.
|
1852 |
+
* @param bool $unset Whether to remove subdomain from cache.
|
1853 |
+
* @return string|bool The set subdomain, false if none is set.
|
1854 |
+
*/
|
1855 |
+
public function get_current_subdomain( $set = null, $unset = false ) {
|
1856 |
+
|
1857 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_current_subdomain()', '3.0.0' );
|
1858 |
+
|
1859 |
+
static $subdomain = null;
|
1860 |
+
|
1861 |
+
if ( isset( $set ) )
|
1862 |
+
$subdomain = \esc_html( $set );
|
1863 |
+
|
1864 |
+
if ( $unset )
|
1865 |
+
unset( $subdomain );
|
1866 |
+
|
1867 |
+
if ( isset( $subdomain ) )
|
1868 |
+
return $subdomain;
|
1869 |
+
|
1870 |
+
return false;
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
/**
|
1874 |
+
* Sets current working subdomain.
|
1875 |
+
*
|
1876 |
+
* @since 2.7.0
|
1877 |
+
* @since 3.0.0 Deprecated.
|
1878 |
+
* @deprecated
|
1879 |
+
*
|
1880 |
+
* @param string $subdomain The current subdomain.
|
1881 |
+
* @return string The set subdomain.
|
1882 |
+
*/
|
1883 |
+
public function set_current_subdomain( $subdomain = '' ) {
|
1884 |
+
|
1885 |
+
$tsf = \the_seo_framework();
|
1886 |
+
|
1887 |
+
$tsf->_deprecated_function( 'the_seo_framework()->unset_current_subdomain()', '3.0.0' );
|
1888 |
+
|
1889 |
+
return $tsf->get_current_subdomain( $subdomain );
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
/**
|
1893 |
+
* Unsets current working subdomain.
|
1894 |
+
*
|
1895 |
+
* @since 2.7.0
|
1896 |
+
* @since 3.0.0 Deprecated.
|
1897 |
+
* @deprecated
|
1898 |
+
*/
|
1899 |
+
public function unset_current_subdomain() {
|
1900 |
+
|
1901 |
+
$tsf = \the_seo_framework();
|
1902 |
+
|
1903 |
+
$tsf->_deprecated_function( 'the_seo_framework()->unset_current_subdomain()', '3.0.0' );
|
1904 |
+
|
1905 |
+
$tsf->get_current_subdomain( null, true );
|
1906 |
+
}
|
1907 |
+
|
1908 |
+
/**
|
1909 |
+
* Create full valid URL with parsed host.
|
1910 |
+
* Don't forget to use set_url_scheme() afterwards.
|
1911 |
+
*
|
1912 |
+
* Note: will return $path if no host can be found.
|
1913 |
+
*
|
1914 |
+
* @since 2.6.5
|
1915 |
+
* @since 3.0.0 Deprecated.
|
1916 |
+
* @deprecated
|
1917 |
+
*
|
1918 |
+
* @param string $path Current path.
|
1919 |
+
* @return string Full valid URL with http host.
|
1920 |
+
*/
|
1921 |
+
public function add_url_host( $path = '' ) {
|
1922 |
+
|
1923 |
+
$tsf = \the_seo_framework();
|
1924 |
+
|
1925 |
+
$tsf->_deprecated_function( 'the_seo_framework()->add_url_host()', '3.0.0' );
|
1926 |
+
|
1927 |
+
$host = $tsf->current_host ?: $tsf->get_home_host();
|
1928 |
+
|
1929 |
+
$scheme = $host ? 'http://' : '';
|
1930 |
+
|
1931 |
+
return $url = $scheme . \trailingslashit( $host ) . ltrim( $path, ' \\/' );
|
1932 |
+
}
|
1933 |
+
|
1934 |
+
/**
|
1935 |
+
* Fetches home URL subdirectory path. Like "wordpress.org/plugins/".
|
1936 |
+
*
|
1937 |
+
* @since 2.7.0
|
1938 |
+
* @since 3.0.0 Deprecated.
|
1939 |
+
* @deprecated
|
1940 |
+
* @staticvar string $cache
|
1941 |
+
*
|
1942 |
+
* @return string The home URL path.
|
1943 |
+
*/
|
1944 |
+
public function get_home_path() {
|
1945 |
+
|
1946 |
+
\the_seo_framework()->_deprecated_function( 'the_seo_framework()->get_home_path()', '3.0.0' );
|
1947 |
+
|
1948 |
+
static $cache = null;
|
1949 |
+
|
1950 |
+
if ( isset( $cache ) )
|
1951 |
+
return $cache;
|
1952 |
+
|
1953 |
+
$path = '';
|
1954 |
+
|
1955 |
+
$parsed_url = \wp_parse_url( \get_option( 'home' ) );
|
1956 |
+
|
1957 |
+
if ( ! empty( $parsed_url['path'] ) && $path = ltrim( $parsed_url['path'], ' \\/' ) )
|
1958 |
+
$path = '/' . $path;
|
1959 |
+
|
1960 |
+
return $cache = $path;
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
/**
|
1964 |
+
* Cache current URL in static variable
|
1965 |
+
* Must be called inside the loop
|
1966 |
+
*
|
1967 |
+
* @since 2.2.2
|
1968 |
+
* @since 3.0.0 Deprecated.
|
1969 |
+
* @deprecated
|
1970 |
+
* @staticvar array $url_cache
|
1971 |
+
*
|
1972 |
+
* @param string $url the url
|
1973 |
+
* @param int $post_id the page id, if empty it will fetch the requested ID, else the page uri
|
1974 |
+
* @param bool $paged Return current page URL with pagination
|
1975 |
+
* @param bool $from_option Get the canonical uri option
|
1976 |
+
* @param bool $paged_plural Whether to allow pagination on second or later pages.
|
1977 |
+
* @return string The url
|
1978 |
+
*/
|
1979 |
+
public function the_url_from_cache( $url = '', $post_id = null, $paged = false, $from_option = true, $paged_plural = true ) {
|
1980 |
+
|
1981 |
+
$tsf = \the_seo_framework();
|
1982 |
+
$tsf->_deprecated_function( 'the_seo_framework()->the_url_from_cache()', '3.0.0', `the_seo_framework()->get_current_canonical_url()` );
|
1983 |
+
|
1984 |
+
return $tsf->get_current_canonical_url();
|
1985 |
+
}
|
1986 |
+
|
1987 |
+
/**
|
1988 |
+
* Cache home URL in static variable
|
1989 |
+
*
|
1990 |
+
* @since 2.5.0
|
1991 |
+
* @since 2.9.0 Now returns subdirectory installations paths too.
|
1992 |
+
* @since 3.0.0 1: Now no longer regenerates home URL when parameters differ.
|
1993 |
+
* 2: Deprecated.
|
1994 |
+
* @deprecated
|
1995 |
+
* @staticvar string $url
|
1996 |
+
*
|
1997 |
+
* @param bool $force_slash Force slash
|
1998 |
+
* @return string The url
|
1999 |
+
*/
|
2000 |
+
public function the_home_url_from_cache( $force_slash = false ) {
|
2001 |
+
|
2002 |
+
$tsf = \the_seo_framework();
|
2003 |
+
$tsf->_deprecated_function( 'the_seo_framework()->the_home_url_from_cache()', '3.0.0', 'the_seo_framework()->get_homepage_permalink()' );
|
2004 |
+
|
2005 |
+
static $url;
|
2006 |
+
|
2007 |
+
if ( ! $url )
|
2008 |
+
$url = $tsf->get_homepage_permalink();
|
2009 |
+
|
2010 |
+
return $force_slash ? \trailingslashit( $url ) : $url;
|
2011 |
+
}
|
2012 |
+
}
|
inc/classes/feed.class.php
CHANGED
@@ -1,184 +1,184 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package The_SEO_Framework\Classes
|
4 |
-
*/
|
5 |
-
namespace The_SEO_Framework;
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* The SEO Framework plugin
|
11 |
-
* Copyright (C) 2015 - 2017 Sybre Waaijer, CyberWire (https://cyberwire.nl/)
|
12 |
-
*
|
13 |
-
* This program is free software: you can redistribute it and/or modify
|
14 |
-
* it under the terms of the GNU General Public License version 3 as published
|
15 |
-
* by the Free Software Foundation.
|
16 |
-
*
|
17 |
-
* This program is distributed in the hope that it will be useful,
|
18 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
-
* GNU General Public License for more details.
|
21 |
-
*
|
22 |
-
* You should have received a copy of the GNU General Public License
|
23 |
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
-
*/
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Class The_SEO_Framework\Feed
|
28 |
-
*
|
29 |
-
* Influences WordPress feeds.
|
30 |
-
* "Report Cybr for Feeding." - General EUW League of Legends player.
|
31 |
-
*
|
32 |
-
* @since 2.8.0
|
33 |
-
*/
|
34 |
-
class Feed extends Cache {
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Constructor, load parent constructor and run functions.
|
38 |
-
*/
|
39 |
-
protected function __construct() {
|
40 |
-
parent::__construct();
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Initializes feed actions and hooks.
|
45 |
-
*
|
46 |
-
* @since 2.9.0
|
47 |
-
* @access private
|
48 |
-
*
|
49 |
-
* @return void Early if this request isn't for a feed.
|
50 |
-
*/
|
51 |
-
public function _init_feed_output() {
|
52 |
-
|
53 |
-
if ( ! $this->is_feed() )
|
54 |
-
return;
|
55 |
-
|
56 |
-
\add_filter( 'the_content_feed', array( $this, 'the_content_feed' ), 10, 2 );
|
57 |
-
|
58 |
-
//* Only add the feed link to the excerpt if we're only building excerpts.
|
59 |
-
if ( $this->rss_uses_excerpt() )
|
60 |
-
\add_filter( 'the_excerpt_rss', array( $this, 'the_content_feed' ), 10, 1 );
|
61 |
-
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Determines whether the WordPress excerpt RSS feed option is used.
|
66 |
-
*
|
67 |
-
* @since 2.6.0
|
68 |
-
*
|
69 |
-
* @return bool
|
70 |
-
*/
|
71 |
-
public function rss_uses_excerpt() {
|
72 |
-
return (bool) \get_option( 'rss_use_excerpt' );
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Changes feed's content based on options.
|
77 |
-
*
|
78 |
-
* This method converts the input $content to an excerpt and is able to add
|
79 |
-
* a nofollow backlink at the end of the feed.
|
80 |
-
*
|
81 |
-
* @since 2.5.2
|
82 |
-
*
|
83 |
-
* @param $content The feed's content.
|
84 |
-
* @param $feed_type The feed type (not used in excerpted content)
|
85 |
-
* @return string The modified feed entry.
|
86 |
-
*/
|
87 |
-
public function the_content_feed( $content = '', $feed_type = null ) {
|
88 |
-
|
89 |
-
if ( ! $content )
|
90 |
-
return '';
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Don't alter already-excerpts or descriptions.
|
94 |
-
* $feed_type is only set on 'the_content_feed' filter.
|
95 |
-
*/
|
96 |
-
if ( isset( $feed_type ) && $this->get_option( 'excerpt_the_feed' ) ) {
|
97 |
-
$content = $this->convert_feed_entry_to_excerpt( $content );
|
98 |
-
}
|
99 |
-
|
100 |
-
if ( $this->get_option( 'source_the_feed' ) ) {
|
101 |
-
$content .= PHP_EOL . $this->get_feed_entry_source_link();
|
102 |
-
}
|
103 |
-
|
104 |
-
return $content;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Converts feed content to excerpt.
|
109 |
-
*
|
110 |
-
* @since 2.9.0
|
111 |
-
*
|
112 |
-
* @param string $content The full feed entry content.
|
113 |
-
* @return string The excerpted feed.
|
114 |
-
*/
|
115 |
-
protected function convert_feed_entry_to_excerpt( $content = '' ) {
|
116 |
-
|
117 |
-
if ( ! $content )
|
118 |
-
return '';
|
119 |
-
|
120 |
-
//* Strip all code and lines.
|
121 |
-
$excerpt = $this->s_excerpt_raw( $content, false );
|
122 |
-
|
123 |
-
$excerpt_len = (int) mb_strlen( $excerpt );
|
124 |
-
/**
|
125 |
-
* Applies filters the_seo_framework_max_content_feed_length : The max excerpt length.
|
126 |
-
* @since 2.5.2
|
127 |
-
*/
|
128 |
-
$max_len = (int) \apply_filters( 'the_seo_framework_max_content_feed_length', 400 );
|
129 |
-
|
130 |
-
//* Generate excerpt.
|
131 |
-
$excerpt = $this->trim_excerpt( $excerpt, $excerpt_len, $max_len );
|
132 |
-
|
133 |
-
$h2_output = '';
|
134 |
-
|
135 |
-
if ( 0 === strpos( $content, '<h2>' ) ) {
|
136 |
-
//* Add the h2 title back
|
137 |
-
$h2_end = mb_strpos( $content, '</h2>' );
|
138 |
-
|
139 |
-
if ( false !== $h2_end ) {
|
140 |
-
//* Start of content, plus <h2>
|
141 |
-
$h2_start = 4;
|
142 |
-
//* Remove the length of <h2>, again.
|
143 |
-
$h2_end = $h2_end - $h2_start;
|
144 |
-
|
145 |
-
//* Fetch h2 content.
|
146 |
-
$h2_content = mb_substr( $content, $h2_start, $h2_end );
|
147 |
-
|
148 |
-
//* Remove the H2 content from the excerpt.
|
149 |
-
$count = 1;
|
150 |
-
$excerpt = str_replace( $h2_content, '', $excerpt, $count );
|
151 |
-
|
152 |
-
//* Wrap h2 content in h2 tags.
|
153 |
-
$h2_output = '<h2>' . $h2_content . '</h2>' . PHP_EOL;
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
$content = $h2_output . '<p>' . trim( $excerpt ) . '</p>';
|
158 |
-
|
159 |
-
return $content;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Generates and returns feed source link.
|
164 |
-
*
|
165 |
-
* @since 2.9.0
|
166 |
-
* @since 3.0.0 Now uses plain permalink, rather than enhanced canonical URL.
|
167 |
-
*
|
168 |
-
* @return string The translatable feed entry source link.
|
169 |
-
*/
|
170 |
-
protected function get_feed_entry_source_link() {
|
171 |
-
/**
|
172 |
-
* Applies filters 'the_seo_framework_feed_source_link' : string
|
173 |
-
*
|
174 |
-
* @since 2.6.0
|
175 |
-
* @since 2.7.2 or 2.7.3: Escaped output.
|
176 |
-
*
|
177 |
-
* @param string $source The source indication string.
|
178 |
-
*/
|
179 |
-
$source_i18n = (string) \apply_filters( 'the_seo_framework_feed_source_link_text', \_x( 'Source', 'The content source', 'autodescription' ) );
|
180 |
-
$content = '<p><a href="' . \esc_url( \get_permalink() ) . '" rel="nofollow">' . \esc_html( $source_i18n ) . '</a></p>';
|
181 |
-
|
182 |
-
return $content;
|
183 |
-
}
|
184 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package The_SEO_Framework\Classes
|
4 |
+
*/
|
5 |
+
namespace The_SEO_Framework;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The SEO Framework plugin
|
11 |
+
* Copyright (C) 2015 - 2017 Sybre Waaijer, CyberWire (https://cyberwire.nl/)
|
12 |
+
*
|
13 |
+
* This program is free software: you can redistribute it and/or modify
|
14 |
+
* it under the terms of the GNU General Public License version 3 as published
|
15 |
+
* by the Free Software Foundation.
|
16 |
+
*
|
17 |
+
* This program is distributed in the hope that it will be useful,
|
18 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
* GNU General Public License for more details.
|
21 |
+
*
|
22 |
+
* You should have received a copy of the GNU General Public License
|
23 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Class The_SEO_Framework\Feed
|
28 |
+
*
|
29 |
+
* Influences WordPress feeds.
|
30 |
+
* "Report Cybr for Feeding." - General EUW League of Legends player.
|
31 |
+
*
|
32 |
+
* @since 2.8.0
|
33 |
+
*/
|
34 |
+
class Feed extends Cache {
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Constructor, load parent constructor and run functions.
|
38 |
+
*/
|
39 |
+
protected function __construct() {
|
40 |
+
parent::__construct();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Initializes feed actions and hooks.
|
45 |
+
*
|
46 |
+
* @since 2.9.0
|
47 |
+
* @access private
|
48 |
+
*
|
49 |
+
* @return void Early if this request isn't for a feed.
|
50 |
+
*/
|
51 |
+
public function _init_feed_output() {
|
52 |
+
|
53 |
+
if ( ! $this->is_feed() )
|
54 |
+
return;
|
55 |
+
|
56 |
+
\add_filter( 'the_content_feed', array( $this, 'the_content_feed' ), 10, 2 );
|
57 |
+
|
58 |
+
//* Only add the feed link to the excerpt if we're only building excerpts.
|
59 |
+
if ( $this->rss_uses_excerpt() )
|
60 |
+
\add_filter( 'the_excerpt_rss', array( $this, 'the_content_feed' ), 10, 1 );
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Determines whether the WordPress excerpt RSS feed option is used.
|
66 |
+
*
|
67 |
+
* @since 2.6.0
|
68 |
+
*
|
69 |
+
* @return bool
|
70 |
+
*/
|
71 |
+
public function rss_uses_excerpt() {
|
72 |
+
return (bool) \get_option( 'rss_use_excerpt' );
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Changes feed's content based on options.
|
77 |
+
*
|
78 |
+
* This method converts the input $content to an excerpt and is able to add
|
79 |
+
* a nofollow backlink at the end of the feed.
|
80 |
+
*
|
81 |
+
* @since 2.5.2
|
82 |
+
*
|
83 |
+
* @param $content The feed's content.
|
84 |
+
* @param $feed_type The feed type (not used in excerpted content)
|
85 |
+
* @return string The modified feed entry.
|
86 |
+
*/
|
87 |
+
public function the_content_feed( $content = '', $feed_type = null ) {
|
88 |
+
|
89 |
+
if ( ! $content )
|
90 |
+
return '';
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Don't alter already-excerpts or descriptions.
|
94 |
+
* $feed_type is only set on 'the_content_feed' filter.
|
95 |
+
*/
|
96 |
+
if ( isset( $feed_type ) && $this->get_option( 'excerpt_the_feed' ) ) {
|
97 |
+
$content = $this->convert_feed_entry_to_excerpt( $content );
|
98 |
+
}
|
99 |
+
|
100 |
+
if ( $this->get_option( 'source_the_feed' ) ) {
|
101 |
+
$content .= PHP_EOL . $this->get_feed_entry_source_link();
|
102 |
+
}
|
103 |
+
|
104 |
+
return $content;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Converts feed content to excerpt.
|
109 |
+
*
|
110 |
+
* @since 2.9.0
|
111 |
+
*
|
112 |
+
* @param string $content The full feed entry content.
|
113 |
+
* @return string The excerpted feed.
|
114 |
+
*/
|
115 |
+
protected function convert_feed_entry_to_excerpt( $content = '' ) {
|
116 |
+
|
117 |
+
if ( ! $content )
|
118 |
+
return '';
|
119 |
+
|
120 |
+
//* Strip all code and lines.
|
121 |
+
$excerpt = $this->s_excerpt_raw( $content, false );
|
122 |
+
|
123 |
+
$excerpt_len = (int) mb_strlen( $excerpt );
|
124 |
+
/**
|
125 |
+
* Applies filters the_seo_framework_max_content_feed_length : The max excerpt length.
|
126 |
+
* @since 2.5.2
|
127 |
+
*/
|
128 |
+
$max_len = (int) \apply_filters( 'the_seo_framework_max_content_feed_length', 400 );
|
129 |
+
|
130 |
+
//* Generate excerpt.
|
131 |
+
$excerpt = $this->trim_excerpt( $excerpt, $excerpt_len, $max_len );
|
132 |
+
|
133 |
+
$h2_output = '';
|
134 |
+
|
135 |
+
if ( 0 === strpos( $content, '<h2>' ) ) {
|
136 |
+
//* Add the h2 title back
|
137 |
+
$h2_end = mb_strpos( $content, '</h2>' );
|
138 |
+
|
139 |
+
if ( false !== $h2_end ) {
|
140 |
+
//* Start of content, plus <h2>
|
141 |
+
$h2_start = 4;
|
142 |
+
//* Remove the length of <h2>, again.
|
143 |
+
$h2_end = $h2_end - $h2_start;
|
144 |
+
|
145 |
+
//* Fetch h2 content.
|
146 |
+
$h2_content = mb_substr( $content, $h2_start, $h2_end );
|
147 |
+
|
148 |
+
//* Remove the H2 content from the excerpt.
|
149 |
+
$count = 1;
|
150 |
+
$excerpt = str_replace( $h2_content, '', $excerpt, $count );
|
151 |
+
|
152 |
+
//* Wrap h2 content in h2 tags.
|
153 |
+
$h2_output = '<h2>' . $h2_content . '</h2>' . PHP_EOL;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
$content = $h2_output . '<p>' . trim( $excerpt ) . '</p>';
|
158 |
+
|
159 |
+
return $content;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Generates and returns feed source link.
|
164 |
+
*
|
165 |
+
* @since 2.9.0
|
166 |
+
* @since 3.0.0 Now uses plain permalink, rather than enhanced canonical URL.
|
167 |
+
*
|
168 |
+
* @return string The translatable feed entry source link.
|
169 |
+
*/
|
170 |
+
protected function get_feed_entry_source_link() {
|
171 |
+
/**
|
172 |
+
* Applies filters 'the_seo_framework_feed_source_link' : string
|
173 |
+
*
|
174 |
+
* @since 2.6.0
|
175 |
+
* @since 2.7.2 or 2.7.3: Escaped output.
|
176 |
+
*
|
177 |
+
* @param string $source The source indication string.
|
178 |
+
*/
|
179 |
+
$source_i18n = (string) \apply_filters( 'the_seo_framework_feed_source_link_text', \_x( 'Source', 'The content source', 'autodescription' ) );
|
180 |
+
$content = '<p><a href="' . \esc_url( \get_permalink() ) . '" rel="nofollow">' . \esc_html( $source_i18n ) . '</a></p>';
|
181 |
+
|
182 |
+
return $content;
|
183 |
+
}
|
184 |
+
}
|
inc/classes/site-options.class.php
CHANGED
@@ -401,6 +401,7 @@ class Site_Options extends Sanitize {
|
|
401 |
* Run before headers are sent.
|
402 |
*
|
403 |
* @since 2.6.0
|
|
|
404 |
*/
|
405 |
protected function pre_output_site_updated_plugin_notice() {
|
406 |
|
401 |
* Run before headers are sent.
|
402 |
*
|
403 |
* @since 2.6.0
|
404 |
+
* @securitycheck 3.0.3 OK.
|
405 |
*/
|
406 |
protected function pre_output_site_updated_plugin_notice() {
|
407 |
|
inc/compat/plugin-bbpress.php
CHANGED
@@ -197,3 +197,30 @@ function _bbpress_filter_custom_field_description( $description = '', $args = ar
|
|
197 |
|
198 |
return $description;
|
199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
return $description;
|
199 |
}
|
200 |
+
|
201 |
+
\add_filter( 'the_seo_framework_do_adjust_archive_query', __NAMESPACE__ . '\_bbpress_filter_do_adjust_query', 10, 2 );
|
202 |
+
/**
|
203 |
+
* Fixes bbPress exclusion of first reply.
|
204 |
+
*
|
205 |
+
* bbPress has a hard time maintaining WordPress' query after the original query.
|
206 |
+
* Reasons unknown.
|
207 |
+
* This function fixes the query alteration part.
|
208 |
+
*
|
209 |
+
* @since 3.0.3
|
210 |
+
* @access private
|
211 |
+
* @link <https://bbpress.trac.wordpress.org/ticket/2607> (regression)
|
212 |
+
*
|
213 |
+
* @param bool $do Whether to adjust the query.
|
214 |
+
* @param \WP_Query $wp_query The query. Passed by reference.
|
215 |
+
* @return bool
|
216 |
+
*/
|
217 |
+
function _bbpress_filter_do_adjust_query( $do, &$wp_query ) {
|
218 |
+
|
219 |
+
if ( \is_bbpress() && isset( $wp_query->query['post_type'] ) ) {
|
220 |
+
if ( in_array( 'reply', (array) $wp_query->query['post_type'], true ) ) {
|
221 |
+
$do = false;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
return $do;
|
226 |
+
}
|
inc/views/inpost/seo-settings-tt.php
CHANGED
@@ -66,6 +66,33 @@ $desc_len_parsed = html_entity_decode( $description_len );
|
|
66 |
$title_placeholder = $generated_doctitle;
|
67 |
$description_placeholder = $generated_description;
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
?>
|
70 |
<h3>
|
71 |
<?php
|
@@ -135,54 +162,37 @@ $description_placeholder = $generated_description;
|
|
135 |
<tr>
|
136 |
<th scope="row" valign="top"><?php esc_html_e( 'Robots Meta Settings', 'autodescription' ); ?></th>
|
137 |
<td>
|
138 |
-
|
139 |
-
|
140 |
-
printf(
|
141 |
-
/* translators: %s = noindex/nofollow/noarchive */
|
142 |
-
esc_html__( 'Apply %s to this term?', 'autodescription' ),
|
143 |
-
$this->code_wrap( 'noindex' )
|
144 |
-
);
|
145 |
-
$this->make_info(
|
146 |
-
__( 'This tells search engines not to show this page in their search results.', 'autodescription' ),
|
147 |
-
'https://support.google.com/webmasters/answer/93710?hl=' . $language
|
148 |
-
);
|
149 |
-
?>
|
150 |
-
</label>
|
151 |
-
|
152 |
-
<br>
|
153 |
-
|
154 |
-
<label for="autodescription-meta[nofollow]"><input name="autodescription-meta[nofollow]" id="autodescription-meta[nofollow]" type="checkbox" value="1" <?php checked( $nofollow ); ?> />
|
155 |
-
<?php
|
156 |
-
printf(
|
157 |
-
/* translators: %s = noindex/nofollow/noarchive */
|
158 |
-
esc_html__( 'Apply %s to this term?', 'autodescription' ),
|
159 |
-
$this->code_wrap( 'nofollow' )
|
160 |
-
);
|
161 |
-
$this->make_info(
|
162 |
-
__( 'This tells search engines not to follow links on this page.', 'autodescription' ),
|
163 |
-
'https://support.google.com/webmasters/answer/96569?hl=' . $language
|
164 |
-
);
|
165 |
?>
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
<?php
|
172 |
-
|
173 |
-
/* translators: %s = noindex/nofollow/noarchive */
|
174 |
-
esc_html__( 'Apply %s to this term?', 'autodescription' ),
|
175 |
-
$this->code_wrap( 'noarchive' )
|
176 |
-
);
|
177 |
-
$this->make_info(
|
178 |
-
__( 'This tells search engines not to follow links on this page.', 'autodescription' ),
|
179 |
-
'https://support.google.com/webmasters/answer/79812?hl=' . $language
|
180 |
-
);
|
181 |
-
?>
|
182 |
-
</label>
|
183 |
|
184 |
-
|
185 |
-
// Saved flag, if set then it won't fetch for Genesis meta anymore
|
186 |
?>
|
187 |
<label class="hidden" for="autodescription-meta[saved_flag]">
|
188 |
<input name="autodescription-meta[saved_flag]" id="autodescription-meta[saved_flag]" type="checkbox" value="1" checked='checked' />
|
66 |
$title_placeholder = $generated_doctitle;
|
67 |
$description_placeholder = $generated_description;
|
68 |
|
69 |
+
$robots_settings = array(
|
70 |
+
'noindex' => array(
|
71 |
+
'value' => $noindex,
|
72 |
+
'info' => $this->make_info(
|
73 |
+
__( 'This tells search engines not to show this page in their search results.', 'autodescription' ),
|
74 |
+
'https://support.google.com/webmasters/answer/93710?hl=' . $language,
|
75 |
+
false
|
76 |
+
),
|
77 |
+
),
|
78 |
+
'nofollow' => array(
|
79 |
+
'value' => $nofollow,
|
80 |
+
'info' => $this->make_info(
|
81 |
+
__( 'This tells search engines not to follow links on this page.', 'autodescription' ),
|
82 |
+
'https://support.google.com/webmasters/answer/96569?hl=' . $language,
|
83 |
+
false
|
84 |
+
),
|
85 |
+
),
|
86 |
+
'noarchive' => array(
|
87 |
+
'value' => $noarchive,
|
88 |
+
'info' => $this->make_info(
|
89 |
+
__( 'This tells search engines not to follow links on this page.', 'autodescription' ),
|
90 |
+
'https://support.google.com/webmasters/answer/79812?hl=' . $language,
|
91 |
+
false
|
92 |
+
),
|
93 |
+
),
|
94 |
+
);
|
95 |
+
|
96 |
?>
|
97 |
<h3>
|
98 |
<?php
|
162 |
<tr>
|
163 |
<th scope="row" valign="top"><?php esc_html_e( 'Robots Meta Settings', 'autodescription' ); ?></th>
|
164 |
<td>
|
165 |
+
<?php
|
166 |
+
foreach ( $robots_settings as $type => $data ) :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
?>
|
168 |
+
<p>
|
169 |
+
<?php
|
170 |
+
vprintf(
|
171 |
+
'<label for="%1$s"><input name="%1$s" id="%1$s" type="checkbox" value="1" %2$s />%3$s</label>',
|
172 |
+
array(
|
173 |
+
sprintf( 'autodescription-meta[%s]', esc_attr( $type ) ),
|
174 |
+
checked( $data['value'], true, false ),
|
175 |
+
vsprintf(
|
176 |
+
'%s %s',
|
177 |
+
array(
|
178 |
+
sprintf(
|
179 |
+
/* translators: %s = noindex/nofollow/noarchive */
|
180 |
+
esc_html__( 'Apply %s to this term?', 'autodescription' ),
|
181 |
+
//= Already escaped.
|
182 |
+
$this->code_wrap( $type )
|
183 |
+
),
|
184 |
+
//= Already escaped.
|
185 |
+
$data['info'],
|
186 |
+
)
|
187 |
+
),
|
188 |
+
)
|
189 |
+
);
|
190 |
+
?>
|
191 |
+
</p>
|
192 |
<?php
|
193 |
+
endforeach;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
+
// Output saved flag, if set then it won't fetch alternative meta anymore.
|
|
|
196 |
?>
|
197 |
<label class="hidden" for="autodescription-meta[saved_flag]">
|
198 |
<input name="autodescription-meta[saved_flag]" id="autodescription-meta[saved_flag]" type="checkbox" value="1" checked='checked' />
|
inc/views/metaboxes/title-metabox.php
CHANGED
@@ -153,42 +153,37 @@ switch ( $instance ) :
|
|
153 |
</p>
|
154 |
<?php $this->description( $home_page_has_option ); ?>
|
155 |
</fieldset>
|
156 |
-
<?php
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
<h4><?php esc_html_e( 'Remove Blogname from Title', 'autodescription' ); ?></h4>
|
164 |
-
<div id="tsf-title-additions-toggle">
|
165 |
-
<?php
|
166 |
-
$info = $this->make_info(
|
167 |
-
__( 'This might decouple your posts and pages from the rest of the website.', 'autodescription' ),
|
168 |
-
'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#3',
|
169 |
-
false
|
170 |
-
);
|
171 |
-
|
172 |
-
$this->wrap_fields(
|
173 |
-
$this->make_checkbox(
|
174 |
-
'title_rem_additions',
|
175 |
-
esc_html__( 'Remove Blogname from title?', 'autodescription' ) . ' ' . $info,
|
176 |
-
'',
|
177 |
-
false
|
178 |
-
),
|
179 |
-
true
|
180 |
-
);
|
181 |
-
?>
|
182 |
-
</div>
|
183 |
<?php
|
184 |
-
$this->
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
break;
|
189 |
|
190 |
case 'the_seo_framework_title_metabox_prefixes' :
|
191 |
-
|
192 |
//* Get translated category label, if it exists. Otherwise, fallback to translation.
|
193 |
$term_labels = $this->get_tax_labels( 'category' );
|
194 |
$label = isset( $term_labels->singular_name ) ? $term_labels->singular_name : __( 'Category', 'autodescription' );
|
153 |
</p>
|
154 |
<?php $this->description( $home_page_has_option ); ?>
|
155 |
</fieldset>
|
|
|
156 |
|
157 |
+
<hr>
|
158 |
+
|
159 |
+
<h4><?php esc_html_e( 'Remove Blogname from Title', 'autodescription' ); ?></h4>
|
160 |
+
<div id="tsf-title-additions-toggle">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
<?php
|
162 |
+
$info = $this->make_info(
|
163 |
+
__( 'This might decouple your posts and pages from the rest of the website.', 'autodescription' ),
|
164 |
+
'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#3',
|
165 |
+
false
|
166 |
+
);
|
167 |
+
|
168 |
+
$this->wrap_fields(
|
169 |
+
$this->make_checkbox(
|
170 |
+
'title_rem_additions',
|
171 |
+
esc_html__( 'Remove Blogname from title?', 'autodescription' ) . ' ' . $info,
|
172 |
+
'',
|
173 |
+
false,
|
174 |
+
! $this->can_manipulate_title() // Only add this option if the theme is doing it right.
|
175 |
+
),
|
176 |
+
true
|
177 |
+
);
|
178 |
+
?>
|
179 |
+
</div>
|
180 |
+
<?php
|
181 |
+
$this->description( __( 'Only use this option if you are aware of its SEO effects.', 'autodescription' ), false );
|
182 |
+
echo ' ';
|
183 |
+
$this->description( $home_page_has_option, false );
|
184 |
break;
|
185 |
|
186 |
case 'the_seo_framework_title_metabox_prefixes' :
|
|
|
187 |
//* Get translated category label, if it exists. Otherwise, fallback to translation.
|
188 |
$term_labels = $this->get_tax_labels( 'category' );
|
189 |
$label = isset( $term_labels->singular_name ) ? $term_labels->singular_name : __( 'Category', 'autodescription' );
|
lib/css/tsf-rtl.css
CHANGED
@@ -1023,22 +1023,28 @@ body.js .tsf-flex-tab-content.tsf-flex-tab-content-active {
|
|
1023 |
/**
|
1024 |
* General fields.
|
1025 |
*/
|
1026 |
-
.tsf-default-selected {
|
1027 |
border-color: #1c9d38;
|
1028 |
}
|
1029 |
-
|
1030 |
-
.tsf-default-selected:checked:before {
|
1031 |
color: #1c9d38;
|
1032 |
}
|
1033 |
|
1034 |
-
.tsf-warning-selected {
|
1035 |
border-color: #dd3811;
|
1036 |
}
|
1037 |
-
|
1038 |
-
.tsf-warning-selected:checked:before {
|
1039 |
color: #dd3811;
|
1040 |
}
|
1041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
.tsf-fields {
|
1043 |
font-size: 13px;
|
1044 |
line-height: 1.5;
|
1023 |
/**
|
1024 |
* General fields.
|
1025 |
*/
|
1026 |
+
input.tsf-default-selected {
|
1027 |
border-color: #1c9d38;
|
1028 |
}
|
1029 |
+
input.tsf-default-selected:checked:before {
|
|
|
1030 |
color: #1c9d38;
|
1031 |
}
|
1032 |
|
1033 |
+
input.tsf-warning-selected {
|
1034 |
border-color: #dd3811;
|
1035 |
}
|
1036 |
+
input.tsf-warning-selected:checked:before {
|
|
|
1037 |
color: #dd3811;
|
1038 |
}
|
1039 |
|
1040 |
+
label.tsf-disabled {
|
1041 |
+
color: #999;
|
1042 |
+
}
|
1043 |
+
label.tsf-disabled,
|
1044 |
+
input.tsf-disabled {
|
1045 |
+
cursor: default;
|
1046 |
+
}
|
1047 |
+
|
1048 |
.tsf-fields {
|
1049 |
font-size: 13px;
|
1050 |
line-height: 1.5;
|
lib/css/tsf-rtl.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.tsf-top-buttons,.tsf-top-wrap>h1,.tsf-top-wrap>h2{float:left}.tsf-notice{position:relative;clear:both}.tsf-notice.tsf-show-icon p:before{content:'';margin-left:12px;background:0 0;display:inline-block;font:400 14px/16px dashicons;speak:none;height:16px;text-align:center;vertical-align:middle;width:16px;line-height:14px;-webkit-font-smoothing:antialiased}.error.tsf-notice.tsf-show-icon p:before{color:#dd3811;content:"\f534"}.notice-warning.tsf-notice.tsf-show-icon p:before{color:#ffa01b;content:"\f227"}.updated.tsf-notice.tsf-show-icon p:before{color:#0cc34b;font-size:16px;content:"\f147"}a.tsf-dismiss{position:absolute;top:0;left:1px;border:none;margin:0;padding:9px;background:0 0;color:#b4b9be;cursor:pointer;text-decoration:none}a.tsf-dismiss:before{background:0 0;content:"\f153";display:block;font:400 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.tsf-dismiss:hover{color:#c00}table.wp-list-table .column-name{width:15%}table.wp-list-table .column-icl_translations,table.wp-list-table .column-is_in_stock,table.wp-list-table .column-price,table.wp-list-table .column-sku,th.column-tsf-seo-bar-wrap~th{width:8%}.tsf-seo-bar-item{text-decoration:none;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#tsf-title-wrap{position:relative;display:block;padding:0;height:auto;width:auto;overflow:hidden}#tsf-title-offset{visibility:hidden;height:0;display:inline-block;position:absolute;right:0;color:transparent;white-space:pre}#tsf-title-placeholder,#tsf-title-placeholder-prefix{position:absolute;color:#777;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;top:0;right:0;overflow:hidden;white-space:pre;text-overflow:ellipsis;will-change:left,right}.tsf-counter-wrap{margin-top:15px}.tsf-counter{font-weight:400;color:#666;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:contents}.tsf-count-bad{color:#dd3811}.tsf-count-okay{color:#ffa700}.tsf-count-good{color:#0cc34b}.tsf-counter-one{color:#fff;border-radius:4em;padding:0 .5em;min-width:2em;display:inline-block;text-align:center;vertical-align:baseline}.tsf-counter-one.tsf-count-bad{background-color:#dd3811}.tsf-counter-one.tsf-count-okay{background-color:#ffa700}.tsf-counter-one.tsf-count-good{background-color:#0cc34b}.tsf-tabs-content .tsf-pixel-counter-wrap{margin-right:1px;max-width:99%}.tsf-pixel-shadow-wrap{position:relative;overflow:hidden;width:0;height:0}.tsf-pixel-counter-wrap{border-bottom:1px solid #ccc;margin-top:12px;margin-bottom:3px}.tsf-pixel-counter-bar{padding-top:7px;display:block;height:3px;width:100%}.tsf-pixel-counter-fluid{display:block;pointer-events:none;height:3px;width:0;max-width:100%;background:#007bd2;box-shadow:0 1px 3px 0 #ccc;-webkit-transition:width .15s cubic-bezier(.4,0,.75,1);-o-transition:width .15s cubic-bezier(.4,0,.75,1);transition:width .15s cubic-bezier(.4,0,.75,1)}.tsf-pixel-counter-overflown .tsf-pixel-counter-fluid{background-color:#dd3811}.tsf-pixel-counter-fit .tsf-pixel-counter-fluid{background-color:#0cc34b}.tsf-description-pixel-counter-shadow,.tsf-title-pixel-counter-shadow{position:absolute;right:0;top:0;z-index:-100;overflow:visible;visibility:hidden;padding:0;margin:0;border:0;display:inline;text-decoration:none;white-space:nowrap;word-wrap:normal;zoom:1;text-overflow:clip;-webkit-transition:none;-moz-transition:none;-o-transition:none;-ms-transition:none;transition:none;font-size:18px;font-weight:600}.tsf-description-pixel-counter-shadow{font-size:13px;font-weight:400}#tsf-seo-bar-wrap{width:18%}th:last-of-type#tsf-seo-bar-wrap{width:160px}.tsf-seo-bar{display:block;width:95%;max-width:220px;border-radius:0;padding:3px;text-shadow:0 0 3px rgba(0,0,0,.3)}.tsf-seo-bar.tsf-100{width:100%}.tsf-seo-bar-inner-wrap{display:table;width:100%;border-radius:0;margin:0 auto;border-collapse:separate;border-spacing:0;vertical-align:middle}.tsf-seo-bar-section-wrap{display:table-cell;border-collapse:collapse}.tsf-seo-bar-item{display:table;width:100%;color:#fff;text-align:center;height:100%;min-width:12px;vertical-align:top;line-height:1.625em;box-shadow:2px 0 0 -1px rgba(0,0,0,.1) inset,-2px 0 0 -1px rgba(0,0,0,.1) inset}body.no-js .tsf-seo-bar-item{cursor:default}.tsf-seo-bar.pill,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap{border-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-item{box-shadow:2px 6px 3px -2px rgba(255,255,255,.2) inset,-2px -6px 3px -2px rgba(41,41,41,.2) inset,0 0 1px rgba(41,41,41,.6)}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type a{border-top-left-radius:30px;border-bottom-left-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap span.tsf-seo-bar-section-wrap:first-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap span.tsf-seo-bar-section-wrap:first-of-type a{border-top-right-radius:30px;border-bottom-right-radius:30px}.tsf-100{width:100%}.tsf-60{width:60%}.tsf-50{width:50%}.tsf-40{width:40%}.tsf-33{width:33.333%}.tsf-25{width:25%}.tsf-20{width:20%}.tsf-16{width:16.666%}.tsf-12-5{width:12.5%}.tsf-11{width:11.333%}.tsf-10{width:10%}.tsf-seo-bar-bad{background-color:#dd3811}.tsf-seo-bar-okay{background-color:#ffa700}.tsf-seo-bar-good{background-color:#0cc34b}.tsf-seo-bar-unknown{background-color:#007bd2}.tsf-tooltip-wrap{position:relative}.tsf-tooltip-item{cursor:help}a.tsf-tooltip-item{cursor:auto}.tsf-tooltip{position:absolute;padding:0;margin:0;bottom:0;left:0;z-index:900142;text-align:right;pointer-events:none;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-tooltip-down{bottom:auto;top:0}.tsf-tooltip-text-wrap{padding:10px 12px;font-size:1em;font-weight:500;line-height:1.625em;border-radius:3px;background:#007bd2;color:#fdfdfd;box-shadow:0 0 2px rgba(0,0,0,.6);text-shadow:none;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word;white-space:pre-line;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 150px;flex:1 0 150px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-is-primary-term,.tsf-nav-tab{font-weight:600}.tsf-tooltip-text span{text-decoration:underline}.tsf-tooltip-text br{display:block;width:100%;content:"\A"}.tsf-ajax:before,.tsf-tooltip-arrow:after,.tsf-tooltip-arrow:before{content:""}.tsf-tooltip-arrow{position:absolute;bottom:-8px;z-index:9999999;left:0;width:0;height:0}.tsf-tooltip-down .tsf-tooltip-arrow{bottom:auto;top:-8px}.tsf-tooltip-arrow:before{border-left:9px solid transparent;border-right:9px solid transparent;border-top:9px solid rgba(0,0,0,.25);position:absolute;bottom:-1px;left:-1px}.tsf-tooltip-arrow:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #007bd2;position:absolute;bottom:0;left:0}.tsf-tooltip-down .tsf-tooltip-arrow:before{bottom:auto;top:0;border-top:0;border-bottom:9px solid rgba(0,0,0,.25)}.tsf-tooltip-down .tsf-tooltip-arrow:after{bottom:auto;top:1px;border-top:0;border-bottom:8px solid #007bd2}.tsf-seo-bar-wrap.column-tsf-seo-bar-temp{overflow:initial!important;min-width:160px}#col-container,#col-right{overflow:initial}.tsf-metaboxes{box-sizing:border-box;max-width:690px;padding-bottom:20px}.tsf-top-wrap{width:100%;display:inline-block;vertical-align:top}.tsf-metaboxes .metabox-holder{clear:both}.tsf-bottom-buttons{text-align:left}.tsf-metaboxes .tsf-bottom-buttons input,.tsf-metaboxes .tsf-top-buttons input{margin-left:10px}#tsf-description-separator,#tsf-title-separator{display:table;width:100%;border-collapse:collapse;border-spacing:0}#tsf-description-separator input,#tsf-title-separator input{display:none;float:left;width:0;min-width:0;opacity:0}#tsf-description-separator label,#tsf-title-separator label{display:inline-block;width:auto;min-width:28px;min-height:28px;margin:3px;-moz-margin-end:1.5px;-moz-margin-start:1.5px;padding:0 4px;border:1px solid #ccc;line-height:28px;text-align:center;cursor:pointer;box-shadow:-1px -1px 1px #aaa inset;font-size:16px}#tsf-description-separator label.tsf-recommended,#tsf-title-separator label.tsf-recommended{border:1px solid #0cc34b;box-shadow:-1px -1px 1px #0cc34b inset}#tsf-description-separator input:hover+label,#tsf-description-separator label:hover,#tsf-title-separator input:hover+label,#tsf-title-separator label:hover{box-shadow:1px 1px 1px #aaa inset;background-color:#fff}#tsf-description-separator input:checked+label,#tsf-title-separator input:checked+label{box-shadow:1px 1px 1px #333 inset;background-color:#fff}#tsf-home-title-location,#tsf-title-location{display:block}#tsf-home-title-location label span,#tsf-title-location label span,#tsf-twitter-cards label span{display:inline-block;min-width:60px;vertical-align:baseline}#tsf-twitter-cards label span{min-width:150px}#tsf-home-title-location label .tsf-sep-js,#tsf-home-title-location label span.tsf-custom-blogname-js,#tsf-home-title-location label span.tsf-custom-tagline-js,#tsf-home-title-location label span.tsf-custom-title-js,#tsf-title-location label .tsf-sep-js{display:inline;min-width:0;white-space:pre}.tsf-nav-tab-wrapper,.tsf-tab-no-js{position:relative;clear:both;width:100%;display:inline-block;border-bottom:1px solid #ccc;line-height:inherit;padding:8px 12px 0;margin:-4px -12px}.tsf-nav-tab{float:right;border:1px solid #ccc;margin-right:.5em;margin-bottom:-1px;padding:5px 14px;font-size:12px;line-height:16px;background:#f1f1f1;color:#555}.tsf-dashicons-tabs{font-size:initial;display:inline;vertical-align:text-bottom}input.tsf-tabs-radio{display:none;width:0;height:0;position:absolute;left:-9001px}.tsf-active-tab,.tsf-tabs-radio:checked+label{background-color:inherit;border-bottom-color:#fff;color:#000}.tsf-tabs-content{margin:1.33em auto 0}.tsf-content-no-js{margin:1.33em auto}body.js .tsf-tabs-content{display:none}body.js .tsf-tabs-content.tsf-active-tab-content{display:block}#tsf-inpost-box .inside,.tsf-flex{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:flex-start;justify-content:flex-start}#tsf-inpost-box.closed .inside,body.js .tsf-flex-tab-content{display:none}#tsf-inpost-box .inside{margin:0;padding:0;-webkit-flex:1 0 100%;flex:1 0 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.tsf-flex-inside-wrap{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto}.tsf-flex-setting{width:100%;-webkit-flex-direction:row;flex-direction:row}.tsf-flex-setting-input,.tsf-flex-setting-label{background-color:#fff;padding:15px 12px;-webkit-flex:10 1 350px;flex:10 1 350px;box-shadow:0 0 0 1px #e9e9e9}.tsf-flex-setting-label{background-color:#f9f9f9;-webkit-flex:1 1 200px;flex:1 1 200px}.tsf-flex-setting-input{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:space-between;justify-content:space-between;-webkit-flex-grow:0;flex-grow:0}.tsf-flex-setting-label-inner-wrap{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item>*{margin-right:4px}.tsf-flex-setting-label-item>:last-child{margin-right:0}.tsf-social-image-buttons{margin-top:15px;margin-left:1px}.tsf-flex-setting-input textarea{max-height:250px}input[type=radio].tsf-flex-nav-tab-radio{display:none;width:0;height:0;margin:0;padding:0;position:absolute;left:-9001px}.tsf-flex-nav-tab-wrapper{background-color:#fcfcfc;border-bottom:2px solid #dadada;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 100%;flex:1 1 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;max-width:100%}.tsf-flex-nav-tab-inner{-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:1 0 auto;flex:1 0 auto}.tsf-flex-nav-tab{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto;max-width:125px}.tsf-flex-nav-tab-label{padding:12px;text-align:center;-webkit-flex-direction:row;flex-direction:row;box-shadow:0 0 0 0 transparent inset;-webkit-transition:box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out;transition:box-shadow .15s ease-out;-webkit-align-items:center;align-items:center;-webkit-align-content:space-between;align-content:space-between}.tsf-flex-nav-dashicon,.tsf-flex-nav-name{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.tsf-flex-nav-tab .tsf-flex-nav-tab-radio:checked+.tsf-flex-nav-tab-label{box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-transition:box-shadow .25s ease-in;-o-transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in}.tsf-flex-tab-content{-webkit-flex:1 0 100%;flex:1 0 100%;max-width:100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}body.js .tsf-flex-tab-content.tsf-flex-tab-content-active{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tsf-flex-tabs-content-no-js{background-color:#f3f3f3;border-bottom:1px solid #dadada;box-shadow:0 2px 0 0 #dadada inset}.tsf-flex-tab-no-js{-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;flex:1 1 100%}.tsf-flex-tab-no-js .tsf-flex-nav-tab{padding:12px;min-width:125px;box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:0 1 auto;flex:0 1 auto}#tsf-inpost-box .hndle .tsf-tooltip-wrap a{font-size:14px;line-height:1em}.tsf-primary-term-selector{margin:0;padding:0;float:left;line-height:inherit;display:inline-block}.tsf-primary-term-selector input{vertical-align:middle;height:14px;width:14px;min-width:14px;line-height:inherit;margin:0;padding:0;pointer-events:none}.tsf-primary-term-selector input:checked:before{width:6px;height:6px;margin:3px;line-height:inherit}.tsf-primary-term-selector-help-wrap{position:absolute;top:0;left:25px}.tsf-default-selected{border-color:#1c9d38}.tsf-default-selected:checked:before{color:#1c9d38}.tsf-warning-selected{border-color:#dd3811}.tsf-warning-selected:checked:before{color:#dd3811}.tsf-fields{font-size:13px;line-height:1.5;margin:1em 0}.tsf-fields .tsf-toblock{display:block;width:100%;margin-bottom:4px}.tsf-fields p.description{margin:7px 0 5px;color:#666}.tsf-option-spacer{margin:1em 0}.tsf-checkbox-wrapper{margin-top:15px}.tsf-checkbox-wrapper:first-child{margin-top:0}.tsf-metaboxes legend h4{margin:2px 0}.tsf-metaboxes legend p:last-of-type{margin-bottom:0}.tsf-counter .tsf-ajax{margin-right:3px}.tsf-ajax:before{display:inline-block;line-height:1;font-family:dashicons;font-style:normal;font-weight:400;font-size:1.225em;vertical-align:middle}.tsf-ajax.tsf-loading:before{content:"\f463";color:#007bd2;-webkit-animation:tsf-spin 1.5s linear infinite;-moz-animation:tsf-spin 1.5s linear infinite;-o-animation:tsf-spin 1.5s linear infinite;animation:tsf-spin 1.5s linear infinite}.tsf-ajax.tsf-error:before{content:"\f158";color:#dd3811}.tsf-ajax.tsf-success:before{content:"\f147";color:#0cc34b}a.tsf-set-social-image.button{margin-left:7px}#tsf-inpost-box input[type=text]::-webkit-input-placeholder,#tsf-inpost-box textarea::-webkit-input-placeholder,.tsf-metaboxes input[type=text]::-webkit-input-placeholder,.tsf-metaboxes textarea::-webkit-input-placeholder{-webkit-transition:color .33s ease-in,text-shadow .33s ease-in;-o-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]::-moz-placeholder,#tsf-inpost-box textarea::-moz-placeholder,.tsf-metaboxes input[type=text]::-moz-placeholder,.tsf-metaboxes textarea::-moz-placeholder{-moz-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:-ms-input-placeholder,#tsf-inpost-box textarea:-ms-input-placeholder,.tsf-metaboxes input[type=text]:-ms-input-placeholder,.tsf-metaboxes textarea:-ms-input-placeholder{transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:focus::-webkit-input-placeholder,#tsf-inpost-box textarea:focus::-webkit-input-placeholder,.tsf-metaboxes input[type=text]:focus::-webkit-input-placeholder,.tsf-metaboxes textarea:focus::-webkit-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus::-moz-placeholder,#tsf-inpost-box textarea:focus::-moz-placeholder,.tsf-metaboxe textarea:focus::-moz-placeholder,.tsf-metaboxes input[type=text]:focus::-moz-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus:-ms-input-placeholder,#tsf-inpost-box textarea:focus:-ms-input-placeholder,.tsf-metaboxes input[type=text]:focus:-ms-input-placeholder,.tsf-metaboxes textarea:focus:-ms-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}@-webkit-keyframes tsf-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes tsf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width:782px){.tsf-inpost-box p.tsf-fields,.tsf-metaboxes p.tsf-fields{line-height:2.8}#tsf-home-title-location label span,#tsf-title-location label span{min-width:40px}.wp-list-table .is-expanded td.tsf-seo-bar-wrap:not(.hidden){overflow:initial!important}.tsf-primary-term-selector input{height:18px;width:18px;min-width:18px}.tsf-primary-term-selector input:checked:before{width:8px;height:8px;margin:4px}}@media screen and (max-width:642px){.tsf-nav-desktop{display:none}}@media screen and (max-width:510px){.tsf-seo-bar.tsf-100{width:inherit}}@-moz-document url-prefix(){#tsf-description-separator label,#tsf-title-separator label{margin:3px 1px}@media only screen and (min-width:768px){.widefat tr td.column-title:nth-child(2):nth-last-child(n+6),.widefat tr td.title:nth-child(2):nth-last-child(n+6),.widefat tr th.column-title:nth-child(2):nth-last-child(n+6),.widefat tr th.title:nth-child(2):nth-last-child(n+6){min-width:1em;width:25%;max-width:100%;white-space:unset}}.tsf-default-selected{box-shadow:0 0 2px 0 #1c9d38}.tsf-warning-selected{box-shadow:0 0 2px 0 #dd3811}}.tsf-flex-hide-if-no-js,body.js .tsf-flex-hide-if-js{display:none}body.js .tsf-flex-hide-if-no-js{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
|
1 |
+
.tsf-top-buttons,.tsf-top-wrap>h1,.tsf-top-wrap>h2{float:left}.tsf-notice{position:relative;clear:both}.tsf-notice.tsf-show-icon p:before{content:'';margin-left:12px;background:0 0;display:inline-block;font:400 14px/16px dashicons;speak:none;height:16px;text-align:center;vertical-align:middle;width:16px;line-height:14px;-webkit-font-smoothing:antialiased}.error.tsf-notice.tsf-show-icon p:before{color:#dd3811;content:"\f534"}.notice-warning.tsf-notice.tsf-show-icon p:before{color:#ffa01b;content:"\f227"}.updated.tsf-notice.tsf-show-icon p:before{color:#0cc34b;font-size:16px;content:"\f147"}a.tsf-dismiss{position:absolute;top:0;left:1px;border:none;margin:0;padding:9px;background:0 0;color:#b4b9be;cursor:pointer;text-decoration:none}a.tsf-dismiss:before{background:0 0;content:"\f153";display:block;font:400 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.tsf-dismiss:hover{color:#c00}table.wp-list-table .column-name{width:15%}table.wp-list-table .column-icl_translations,table.wp-list-table .column-is_in_stock,table.wp-list-table .column-price,table.wp-list-table .column-sku,th.column-tsf-seo-bar-wrap~th{width:8%}.tsf-seo-bar-item{text-decoration:none;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#tsf-title-wrap{position:relative;display:block;padding:0;height:auto;width:auto;overflow:hidden}#tsf-title-offset{visibility:hidden;height:0;display:inline-block;position:absolute;right:0;color:transparent;white-space:pre}#tsf-title-placeholder,#tsf-title-placeholder-prefix{position:absolute;color:#777;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;top:0;right:0;overflow:hidden;white-space:pre;text-overflow:ellipsis;will-change:left,right}.tsf-counter-wrap{margin-top:15px}.tsf-counter{font-weight:400;color:#666;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:contents}.tsf-count-bad{color:#dd3811}.tsf-count-okay{color:#ffa700}.tsf-count-good{color:#0cc34b}.tsf-counter-one{color:#fff;border-radius:4em;padding:0 .5em;min-width:2em;display:inline-block;text-align:center;vertical-align:baseline}.tsf-counter-one.tsf-count-bad{background-color:#dd3811}.tsf-counter-one.tsf-count-okay{background-color:#ffa700}.tsf-counter-one.tsf-count-good{background-color:#0cc34b}.tsf-tabs-content .tsf-pixel-counter-wrap{margin-right:1px;max-width:99%}.tsf-pixel-shadow-wrap{position:relative;overflow:hidden;width:0;height:0}.tsf-pixel-counter-wrap{border-bottom:1px solid #ccc;margin-top:12px;margin-bottom:3px}.tsf-pixel-counter-bar{padding-top:7px;display:block;height:3px;width:100%}.tsf-pixel-counter-fluid{display:block;pointer-events:none;height:3px;width:0;max-width:100%;background:#007bd2;box-shadow:0 1px 3px 0 #ccc;-webkit-transition:width .15s cubic-bezier(.4,0,.75,1);-o-transition:width .15s cubic-bezier(.4,0,.75,1);transition:width .15s cubic-bezier(.4,0,.75,1)}.tsf-pixel-counter-overflown .tsf-pixel-counter-fluid{background-color:#dd3811}.tsf-pixel-counter-fit .tsf-pixel-counter-fluid{background-color:#0cc34b}.tsf-description-pixel-counter-shadow,.tsf-title-pixel-counter-shadow{position:absolute;right:0;top:0;z-index:-100;overflow:visible;visibility:hidden;padding:0;margin:0;border:0;display:inline;text-decoration:none;white-space:nowrap;word-wrap:normal;zoom:1;text-overflow:clip;-webkit-transition:none;-moz-transition:none;-o-transition:none;-ms-transition:none;transition:none;font-size:18px;font-weight:600}.tsf-description-pixel-counter-shadow{font-size:13px;font-weight:400}#tsf-seo-bar-wrap{width:18%}th:last-of-type#tsf-seo-bar-wrap{width:160px}.tsf-seo-bar{display:block;width:95%;max-width:220px;border-radius:0;padding:3px;text-shadow:0 0 3px rgba(0,0,0,.3)}.tsf-seo-bar.tsf-100{width:100%}.tsf-seo-bar-inner-wrap{display:table;width:100%;border-radius:0;margin:0 auto;border-collapse:separate;border-spacing:0;vertical-align:middle}.tsf-seo-bar-section-wrap{display:table-cell;border-collapse:collapse}.tsf-seo-bar-item{display:table;width:100%;color:#fff;text-align:center;height:100%;min-width:12px;vertical-align:top;line-height:1.625em;box-shadow:2px 0 0 -1px rgba(0,0,0,.1) inset,-2px 0 0 -1px rgba(0,0,0,.1) inset}body.no-js .tsf-seo-bar-item{cursor:default}.tsf-seo-bar.pill,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap{border-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-item{box-shadow:2px 6px 3px -2px rgba(255,255,255,.2) inset,-2px -6px 3px -2px rgba(41,41,41,.2) inset,0 0 1px rgba(41,41,41,.6)}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type a{border-top-left-radius:30px;border-bottom-left-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap span.tsf-seo-bar-section-wrap:first-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap span.tsf-seo-bar-section-wrap:first-of-type a{border-top-right-radius:30px;border-bottom-right-radius:30px}.tsf-100{width:100%}.tsf-60{width:60%}.tsf-50{width:50%}.tsf-40{width:40%}.tsf-33{width:33.333%}.tsf-25{width:25%}.tsf-20{width:20%}.tsf-16{width:16.666%}.tsf-12-5{width:12.5%}.tsf-11{width:11.333%}.tsf-10{width:10%}.tsf-seo-bar-bad{background-color:#dd3811}.tsf-seo-bar-okay{background-color:#ffa700}.tsf-seo-bar-good{background-color:#0cc34b}.tsf-seo-bar-unknown{background-color:#007bd2}.tsf-tooltip-wrap{position:relative}.tsf-tooltip-item{cursor:help}a.tsf-tooltip-item{cursor:auto}.tsf-tooltip{position:absolute;padding:0;margin:0;bottom:0;left:0;z-index:900142;text-align:right;pointer-events:none;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-tooltip-down{bottom:auto;top:0}.tsf-tooltip-text-wrap{padding:10px 12px;font-size:1em;font-weight:500;line-height:1.625em;border-radius:3px;background:#007bd2;color:#fdfdfd;box-shadow:0 0 2px rgba(0,0,0,.6);text-shadow:none;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word;white-space:pre-line;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 150px;flex:1 0 150px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-is-primary-term,.tsf-nav-tab{font-weight:600}.tsf-tooltip-text span{text-decoration:underline}.tsf-tooltip-text br{display:block;width:100%;content:"\A"}.tsf-ajax:before,.tsf-tooltip-arrow:after,.tsf-tooltip-arrow:before{content:""}.tsf-tooltip-arrow{position:absolute;bottom:-8px;z-index:9999999;left:0;width:0;height:0}.tsf-tooltip-down .tsf-tooltip-arrow{bottom:auto;top:-8px}.tsf-tooltip-arrow:before{border-left:9px solid transparent;border-right:9px solid transparent;border-top:9px solid rgba(0,0,0,.25);position:absolute;bottom:-1px;left:-1px}.tsf-tooltip-arrow:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #007bd2;position:absolute;bottom:0;left:0}.tsf-tooltip-down .tsf-tooltip-arrow:before{bottom:auto;top:0;border-top:0;border-bottom:9px solid rgba(0,0,0,.25)}.tsf-tooltip-down .tsf-tooltip-arrow:after{bottom:auto;top:1px;border-top:0;border-bottom:8px solid #007bd2}.tsf-seo-bar-wrap.column-tsf-seo-bar-temp{overflow:initial!important;min-width:160px}#col-container,#col-right{overflow:initial}.tsf-metaboxes{box-sizing:border-box;max-width:690px;padding-bottom:20px}.tsf-top-wrap{width:100%;display:inline-block;vertical-align:top}.tsf-metaboxes .metabox-holder{clear:both}.tsf-bottom-buttons{text-align:left}.tsf-metaboxes .tsf-bottom-buttons input,.tsf-metaboxes .tsf-top-buttons input{margin-left:10px}#tsf-description-separator,#tsf-title-separator{display:table;width:100%;border-collapse:collapse;border-spacing:0}#tsf-description-separator input,#tsf-title-separator input{display:none;float:left;width:0;min-width:0;opacity:0}#tsf-description-separator label,#tsf-title-separator label{display:inline-block;width:auto;min-width:28px;min-height:28px;margin:3px;-moz-margin-end:1.5px;-moz-margin-start:1.5px;padding:0 4px;border:1px solid #ccc;line-height:28px;text-align:center;cursor:pointer;box-shadow:-1px -1px 1px #aaa inset;font-size:16px}#tsf-description-separator label.tsf-recommended,#tsf-title-separator label.tsf-recommended{border:1px solid #0cc34b;box-shadow:-1px -1px 1px #0cc34b inset}#tsf-description-separator input:hover+label,#tsf-description-separator label:hover,#tsf-title-separator input:hover+label,#tsf-title-separator label:hover{box-shadow:1px 1px 1px #aaa inset;background-color:#fff}#tsf-description-separator input:checked+label,#tsf-title-separator input:checked+label{box-shadow:1px 1px 1px #333 inset;background-color:#fff}#tsf-home-title-location,#tsf-title-location{display:block}#tsf-home-title-location label span,#tsf-title-location label span,#tsf-twitter-cards label span{display:inline-block;min-width:60px;vertical-align:baseline}#tsf-twitter-cards label span{min-width:150px}#tsf-home-title-location label .tsf-sep-js,#tsf-home-title-location label span.tsf-custom-blogname-js,#tsf-home-title-location label span.tsf-custom-tagline-js,#tsf-home-title-location label span.tsf-custom-title-js,#tsf-title-location label .tsf-sep-js{display:inline;min-width:0;white-space:pre}.tsf-nav-tab-wrapper,.tsf-tab-no-js{position:relative;clear:both;width:100%;display:inline-block;border-bottom:1px solid #ccc;line-height:inherit;padding:8px 12px 0;margin:-4px -12px}.tsf-nav-tab{float:right;border:1px solid #ccc;margin-right:.5em;margin-bottom:-1px;padding:5px 14px;font-size:12px;line-height:16px;background:#f1f1f1;color:#555}.tsf-dashicons-tabs{font-size:initial;display:inline;vertical-align:text-bottom}input.tsf-tabs-radio{display:none;width:0;height:0;position:absolute;left:-9001px}.tsf-active-tab,.tsf-tabs-radio:checked+label{background-color:inherit;border-bottom-color:#fff;color:#000}.tsf-tabs-content{margin:1.33em auto 0}.tsf-content-no-js{margin:1.33em auto}body.js .tsf-tabs-content{display:none}body.js .tsf-tabs-content.tsf-active-tab-content{display:block}#tsf-inpost-box .inside,.tsf-flex{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:flex-start;justify-content:flex-start}#tsf-inpost-box.closed .inside,body.js .tsf-flex-tab-content{display:none}#tsf-inpost-box .inside{margin:0;padding:0;-webkit-flex:1 0 100%;flex:1 0 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.tsf-flex-inside-wrap{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto}.tsf-flex-setting{width:100%;-webkit-flex-direction:row;flex-direction:row}.tsf-flex-setting-input,.tsf-flex-setting-label{background-color:#fff;padding:15px 12px;-webkit-flex:10 1 350px;flex:10 1 350px;box-shadow:0 0 0 1px #e9e9e9}.tsf-flex-setting-label{background-color:#f9f9f9;-webkit-flex:1 1 200px;flex:1 1 200px}.tsf-flex-setting-input{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:space-between;justify-content:space-between;-webkit-flex-grow:0;flex-grow:0}.tsf-flex-setting-label-inner-wrap{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item>*{margin-right:4px}.tsf-flex-setting-label-item>:last-child{margin-right:0}.tsf-social-image-buttons{margin-top:15px;margin-left:1px}.tsf-flex-setting-input textarea{max-height:250px}input[type=radio].tsf-flex-nav-tab-radio{display:none;width:0;height:0;margin:0;padding:0;position:absolute;left:-9001px}.tsf-flex-nav-tab-wrapper{background-color:#fcfcfc;border-bottom:2px solid #dadada;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 100%;flex:1 1 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;max-width:100%}.tsf-flex-nav-tab-inner{-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:1 0 auto;flex:1 0 auto}.tsf-flex-nav-tab{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto;max-width:125px}.tsf-flex-nav-tab-label{padding:12px;text-align:center;-webkit-flex-direction:row;flex-direction:row;box-shadow:0 0 0 0 transparent inset;-webkit-transition:box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out;transition:box-shadow .15s ease-out;-webkit-align-items:center;align-items:center;-webkit-align-content:space-between;align-content:space-between}.tsf-flex-nav-dashicon,.tsf-flex-nav-name{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.tsf-flex-nav-tab .tsf-flex-nav-tab-radio:checked+.tsf-flex-nav-tab-label{box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-transition:box-shadow .25s ease-in;-o-transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in}.tsf-flex-tab-content{-webkit-flex:1 0 100%;flex:1 0 100%;max-width:100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}body.js .tsf-flex-tab-content.tsf-flex-tab-content-active{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tsf-flex-tabs-content-no-js{background-color:#f3f3f3;border-bottom:1px solid #dadada;box-shadow:0 2px 0 0 #dadada inset}.tsf-flex-tab-no-js{-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;flex:1 1 100%}.tsf-flex-tab-no-js .tsf-flex-nav-tab{padding:12px;min-width:125px;box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:0 1 auto;flex:0 1 auto}#tsf-inpost-box .hndle .tsf-tooltip-wrap a{font-size:14px;line-height:1em}.tsf-primary-term-selector{margin:0;padding:0;float:left;line-height:inherit;display:inline-block}.tsf-primary-term-selector input{vertical-align:middle;height:14px;width:14px;min-width:14px;line-height:inherit;margin:0;padding:0;pointer-events:none}.tsf-primary-term-selector input:checked:before{width:6px;height:6px;margin:3px;line-height:inherit}.tsf-primary-term-selector-help-wrap{position:absolute;top:0;left:25px}input.tsf-default-selected{border-color:#1c9d38}input.tsf-default-selected:checked:before{color:#1c9d38}input.tsf-warning-selected{border-color:#dd3811}input.tsf-warning-selected:checked:before{color:#dd3811}label.tsf-disabled{color:#999}input.tsf-disabled,label.tsf-disabled{cursor:default}.tsf-fields{font-size:13px;line-height:1.5;margin:1em 0}.tsf-fields .tsf-toblock{display:block;width:100%;margin-bottom:4px}.tsf-fields p.description{margin:7px 0 5px;color:#666}.tsf-option-spacer{margin:1em 0}.tsf-checkbox-wrapper{margin-top:15px}.tsf-checkbox-wrapper:first-child{margin-top:0}.tsf-metaboxes legend h4{margin:2px 0}.tsf-metaboxes legend p:last-of-type{margin-bottom:0}.tsf-counter .tsf-ajax{margin-right:3px}.tsf-ajax:before{display:inline-block;line-height:1;font-family:dashicons;font-style:normal;font-weight:400;font-size:1.225em;vertical-align:middle}.tsf-ajax.tsf-loading:before{content:"\f463";color:#007bd2;-webkit-animation:tsf-spin 1.5s linear infinite;-moz-animation:tsf-spin 1.5s linear infinite;-o-animation:tsf-spin 1.5s linear infinite;animation:tsf-spin 1.5s linear infinite}.tsf-ajax.tsf-error:before{content:"\f158";color:#dd3811}.tsf-ajax.tsf-success:before{content:"\f147";color:#0cc34b}a.tsf-set-social-image.button{margin-left:7px}#tsf-inpost-box input[type=text]::-webkit-input-placeholder,#tsf-inpost-box textarea::-webkit-input-placeholder,.tsf-metaboxes input[type=text]::-webkit-input-placeholder,.tsf-metaboxes textarea::-webkit-input-placeholder{-webkit-transition:color .33s ease-in,text-shadow .33s ease-in;-o-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]::-moz-placeholder,#tsf-inpost-box textarea::-moz-placeholder,.tsf-metaboxes input[type=text]::-moz-placeholder,.tsf-metaboxes textarea::-moz-placeholder{-moz-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:-ms-input-placeholder,#tsf-inpost-box textarea:-ms-input-placeholder,.tsf-metaboxes input[type=text]:-ms-input-placeholder,.tsf-metaboxes textarea:-ms-input-placeholder{transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:focus::-webkit-input-placeholder,#tsf-inpost-box textarea:focus::-webkit-input-placeholder,.tsf-metaboxes input[type=text]:focus::-webkit-input-placeholder,.tsf-metaboxes textarea:focus::-webkit-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus::-moz-placeholder,#tsf-inpost-box textarea:focus::-moz-placeholder,.tsf-metaboxe textarea:focus::-moz-placeholder,.tsf-metaboxes input[type=text]:focus::-moz-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus:-ms-input-placeholder,#tsf-inpost-box textarea:focus:-ms-input-placeholder,.tsf-metaboxes input[type=text]:focus:-ms-input-placeholder,.tsf-metaboxes textarea:focus:-ms-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}@-webkit-keyframes tsf-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes tsf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width:782px){.tsf-inpost-box p.tsf-fields,.tsf-metaboxes p.tsf-fields{line-height:2.8}#tsf-home-title-location label span,#tsf-title-location label span{min-width:40px}.wp-list-table .is-expanded td.tsf-seo-bar-wrap:not(.hidden){overflow:initial!important}.tsf-primary-term-selector input{height:18px;width:18px;min-width:18px}.tsf-primary-term-selector input:checked:before{width:8px;height:8px;margin:4px}}@media screen and (max-width:642px){.tsf-nav-desktop{display:none}}@media screen and (max-width:510px){.tsf-seo-bar.tsf-100{width:inherit}}@-moz-document url-prefix(){#tsf-description-separator label,#tsf-title-separator label{margin:3px 1px}@media only screen and (min-width:768px){.widefat tr td.column-title:nth-child(2):nth-last-child(n+6),.widefat tr td.title:nth-child(2):nth-last-child(n+6),.widefat tr th.column-title:nth-child(2):nth-last-child(n+6),.widefat tr th.title:nth-child(2):nth-last-child(n+6){min-width:1em;width:25%;max-width:100%;white-space:unset}}.tsf-default-selected{box-shadow:0 0 2px 0 #1c9d38}.tsf-warning-selected{box-shadow:0 0 2px 0 #dd3811}}.tsf-flex-hide-if-no-js,body.js .tsf-flex-hide-if-js{display:none}body.js .tsf-flex-hide-if-no-js{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
|
lib/css/tsf.css
CHANGED
@@ -1023,22 +1023,28 @@ body.js .tsf-flex-tab-content.tsf-flex-tab-content-active {
|
|
1023 |
/**
|
1024 |
* General fields.
|
1025 |
*/
|
1026 |
-
.tsf-default-selected {
|
1027 |
border-color: #1c9d38;
|
1028 |
}
|
1029 |
-
|
1030 |
-
.tsf-default-selected:checked:before {
|
1031 |
color: #1c9d38;
|
1032 |
}
|
1033 |
|
1034 |
-
.tsf-warning-selected {
|
1035 |
border-color: #dd3811;
|
1036 |
}
|
1037 |
-
|
1038 |
-
.tsf-warning-selected:checked:before {
|
1039 |
color: #dd3811;
|
1040 |
}
|
1041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
.tsf-fields {
|
1043 |
font-size: 13px;
|
1044 |
line-height: 1.5;
|
1023 |
/**
|
1024 |
* General fields.
|
1025 |
*/
|
1026 |
+
input.tsf-default-selected {
|
1027 |
border-color: #1c9d38;
|
1028 |
}
|
1029 |
+
input.tsf-default-selected:checked:before {
|
|
|
1030 |
color: #1c9d38;
|
1031 |
}
|
1032 |
|
1033 |
+
input.tsf-warning-selected {
|
1034 |
border-color: #dd3811;
|
1035 |
}
|
1036 |
+
input.tsf-warning-selected:checked:before {
|
|
|
1037 |
color: #dd3811;
|
1038 |
}
|
1039 |
|
1040 |
+
label.tsf-disabled {
|
1041 |
+
color: #999;
|
1042 |
+
}
|
1043 |
+
label.tsf-disabled,
|
1044 |
+
input.tsf-disabled {
|
1045 |
+
cursor: default;
|
1046 |
+
}
|
1047 |
+
|
1048 |
.tsf-fields {
|
1049 |
font-size: 13px;
|
1050 |
line-height: 1.5;
|
lib/css/tsf.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.tsf-notice{position:relative;clear:both}.tsf-notice.tsf-show-icon p:before{content:'';margin-right:12px;background:0 0;display:inline-block;font:400 14px/16px dashicons;speak:none;height:16px;text-align:center;vertical-align:middle;width:16px;line-height:14px;-webkit-font-smoothing:antialiased}.error.tsf-notice.tsf-show-icon p:before{color:#dd3811;content:"\f534"}.notice-warning.tsf-notice.tsf-show-icon p:before{color:#ffa01b;content:"\f227"}.updated.tsf-notice.tsf-show-icon p:before{color:#0cc34b;font-size:16px;content:"\f147"}a.tsf-dismiss{position:absolute;top:0;right:1px;border:none;margin:0;padding:9px;background:0 0;color:#b4b9be;cursor:pointer;text-decoration:none}a.tsf-dismiss:before{background:0 0;content:"\f153";display:block;font:400 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.tsf-dismiss:hover{color:#c00}table.wp-list-table .column-name{width:15%}table.wp-list-table .column-icl_translations,table.wp-list-table .column-is_in_stock,table.wp-list-table .column-price,table.wp-list-table .column-sku,th.column-tsf-seo-bar-wrap~th{width:8%}.tsf-seo-bar-item{text-decoration:none;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#tsf-title-wrap{position:relative;display:block;padding:0;height:auto;width:auto;overflow:hidden}#tsf-title-offset{visibility:hidden;height:0;display:inline-block;position:absolute;left:0;color:transparent;white-space:pre}#tsf-title-placeholder,#tsf-title-placeholder-prefix{position:absolute;color:#777;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;top:0;left:0;overflow:hidden;white-space:pre;text-overflow:ellipsis;will-change:left,right}.tsf-counter-wrap{margin-top:15px}.tsf-counter{font-weight:400;color:#666;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:contents}.tsf-count-bad{color:#dd3811}.tsf-count-okay{color:#ffa700}.tsf-count-good{color:#0cc34b}.tsf-counter-one{color:#fff;border-radius:4em;padding:0 .5em;min-width:2em;display:inline-block;text-align:center;vertical-align:baseline}.tsf-counter-one.tsf-count-bad{background-color:#dd3811}.tsf-counter-one.tsf-count-okay{background-color:#ffa700}.tsf-counter-one.tsf-count-good{background-color:#0cc34b}.tsf-tabs-content .tsf-pixel-counter-wrap{margin-left:1px;max-width:99%}.tsf-pixel-shadow-wrap{position:relative;overflow:hidden;width:0;height:0}.tsf-pixel-counter-wrap{border-bottom:1px solid #ccc;margin-top:12px;margin-bottom:3px}.tsf-pixel-counter-bar{padding-top:7px;display:block;height:3px;width:100%}.tsf-pixel-counter-fluid{display:block;pointer-events:none;height:3px;width:0;max-width:100%;background:#007bd2;box-shadow:0 1px 3px 0 #ccc;-webkit-transition:width .15s cubic-bezier(.4,0,.75,1);-o-transition:width .15s cubic-bezier(.4,0,.75,1);transition:width .15s cubic-bezier(.4,0,.75,1)}.tsf-pixel-counter-overflown .tsf-pixel-counter-fluid{background-color:#dd3811}.tsf-pixel-counter-fit .tsf-pixel-counter-fluid{background-color:#0cc34b}.tsf-description-pixel-counter-shadow,.tsf-title-pixel-counter-shadow{position:absolute;left:0;top:0;z-index:-100;overflow:visible;visibility:hidden;padding:0;margin:0;border:0;display:inline;text-decoration:none;white-space:nowrap;word-wrap:normal;zoom:1;text-overflow:clip;-webkit-transition:none;-moz-transition:none;-o-transition:none;-ms-transition:none;transition:none;font-size:18px;font-weight:600}.tsf-description-pixel-counter-shadow{font-size:13px;font-weight:400}#tsf-seo-bar-wrap{width:18%}th:last-of-type#tsf-seo-bar-wrap{width:160px}.tsf-seo-bar{display:block;width:95%;max-width:220px;border-radius:0;padding:3px;text-shadow:0 0 3px rgba(0,0,0,.3)}.tsf-seo-bar.tsf-100{width:100%}.tsf-seo-bar-inner-wrap{display:table;width:100%;border-radius:0;margin:0 auto;border-collapse:separate;border-spacing:0;vertical-align:middle}.tsf-seo-bar-section-wrap{display:table-cell;border-collapse:collapse}.tsf-seo-bar-item{display:table;width:100%;color:#fff;text-align:center;height:100%;min-width:12px;vertical-align:top;line-height:1.625em;box-shadow:2px 0 0 -1px rgba(0,0,0,.1) inset,-2px 0 0 -1px rgba(0,0,0,.1) inset}body.no-js .tsf-seo-bar-item{cursor:default}.tsf-seo-bar.pill,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap{border-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-item{box-shadow:2px 6px 3px -2px rgba(255,255,255,.2) inset,-2px -6px 3px -2px rgba(41,41,41,.2) inset,0 0 1px rgba(41,41,41,.6)}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:first-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:first-of-type .tsf-seo-bar-item{border-top-left-radius:30px;border-bottom-left-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type .tsf-seo-bar-item{border-top-right-radius:30px;border-bottom-right-radius:30px}.tsf-100{width:100%}.tsf-60{width:60%}.tsf-50{width:50%}.tsf-40{width:40%}.tsf-33{width:33.333%}.tsf-25{width:25%}.tsf-20{width:20%}.tsf-16{width:16.666%}.tsf-12-5{width:12.5%}.tsf-11{width:11.333%}.tsf-10{width:10%}.tsf-seo-bar-bad{background-color:#dd3811}.tsf-seo-bar-okay{background-color:#ffa700}.tsf-seo-bar-good{background-color:#0cc34b}.tsf-seo-bar-unknown{background-color:#007bd2}.tsf-tooltip-wrap{position:relative}.tsf-tooltip-item{cursor:help}a.tsf-tooltip-item{cursor:auto}.tsf-tooltip{position:absolute;padding:0;margin:0;bottom:0;left:0;z-index:900142;text-align:left;pointer-events:none;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-tooltip-down{bottom:auto;top:0}.tsf-tooltip-text-wrap{padding:10px 12px;font-size:1em;font-weight:500;line-height:1.625em;border-radius:3px;background:#007bd2;color:#fdfdfd;box-shadow:0 0 2px rgba(0,0,0,.6);text-shadow:none;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word;white-space:pre-line;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 150px;flex:1 0 150px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-is-primary-term,.tsf-nav-tab{font-weight:600}.tsf-tooltip-text span{text-decoration:underline}.tsf-tooltip-text br{display:block;width:100%;content:"\A"}.tsf-ajax:before,.tsf-tooltip-arrow:after,.tsf-tooltip-arrow:before{content:""}.tsf-tooltip-arrow{position:absolute;bottom:-8px;z-index:9999999;left:0;width:0;height:0}.tsf-tooltip-down .tsf-tooltip-arrow{bottom:auto;top:-8px}.tsf-tooltip-arrow:before{border-left:9px solid transparent;border-right:9px solid transparent;border-top:9px solid rgba(0,0,0,.25);position:absolute;bottom:-1px;left:-1px}.tsf-tooltip-arrow:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #007bd2;position:absolute;bottom:0;left:0}.tsf-tooltip-down .tsf-tooltip-arrow:before{bottom:auto;top:0;border-top:0;border-bottom:9px solid rgba(0,0,0,.25)}.tsf-tooltip-down .tsf-tooltip-arrow:after{bottom:auto;top:1px;border-top:0;border-bottom:8px solid #007bd2}.tsf-seo-bar-wrap.column-tsf-seo-bar-temp{overflow:initial!important;min-width:160px}#col-container,#col-right{overflow:initial}.tsf-metaboxes{box-sizing:border-box;max-width:690px;padding-bottom:20px}.tsf-top-wrap{width:100%;display:inline-block;vertical-align:top}.tsf-top-wrap>h1,.tsf-top-wrap>h2{float:left}.tsf-metaboxes .metabox-holder{clear:both}.tsf-top-buttons{float:right}.tsf-bottom-buttons{text-align:right}.tsf-metaboxes .tsf-bottom-buttons input,.tsf-metaboxes .tsf-top-buttons input{margin-left:10px}#tsf-description-separator,#tsf-title-separator{display:table;width:100%;border-collapse:collapse;border-spacing:0}#tsf-description-separator input,#tsf-title-separator input{display:none;float:left;width:0;min-width:0;opacity:0}#tsf-description-separator label,#tsf-title-separator label{display:inline-block;width:auto;min-width:28px;min-height:28px;margin:3px;-moz-margin-end:1.5px;-moz-margin-start:1.5px;padding:0 4px;border:1px solid #ccc;line-height:28px;text-align:center;cursor:pointer;box-shadow:-1px -1px 1px #aaa inset;font-size:16px}#tsf-description-separator label.tsf-recommended,#tsf-title-separator label.tsf-recommended{border:1px solid #0cc34b;box-shadow:-1px -1px 1px #0cc34b inset}#tsf-description-separator input:hover+label,#tsf-description-separator label:hover,#tsf-title-separator input:hover+label,#tsf-title-separator label:hover{box-shadow:1px 1px 1px #aaa inset;background-color:#fff}#tsf-description-separator input:checked+label,#tsf-title-separator input:checked+label{box-shadow:1px 1px 1px #333 inset;background-color:#fff}#tsf-home-title-location,#tsf-title-location{display:block}#tsf-home-title-location label span,#tsf-title-location label span,#tsf-twitter-cards label span{display:inline-block;min-width:60px;vertical-align:baseline}#tsf-twitter-cards label span{min-width:150px}#tsf-home-title-location label .tsf-sep-js,#tsf-home-title-location label span.tsf-custom-blogname-js,#tsf-home-title-location label span.tsf-custom-tagline-js,#tsf-home-title-location label span.tsf-custom-title-js,#tsf-title-location label .tsf-sep-js{display:inline;min-width:0;white-space:pre}.tsf-nav-tab-wrapper,.tsf-tab-no-js{position:relative;clear:both;width:100%;display:inline-block;border-bottom:1px solid #ccc;line-height:inherit;padding:8px 12px 0;margin:-4px -12px}.tsf-nav-tab{float:left;border:1px solid #ccc;margin-left:.5em;margin-bottom:-1px;padding:5px 14px;font-size:12px;line-height:16px;background:#f1f1f1;color:#555}.tsf-dashicons-tabs{font-size:initial;display:inline;vertical-align:text-bottom}input.tsf-tabs-radio{display:none;width:0;height:0;position:absolute;left:-9001px}.tsf-active-tab,.tsf-tabs-radio:checked+label{background-color:inherit;border-bottom-color:#fff;color:#000}.tsf-tabs-content{margin:1.33em auto 0}.tsf-content-no-js{margin:1.33em auto}body.js .tsf-tabs-content{display:none}body.js .tsf-tabs-content.tsf-active-tab-content{display:block}#tsf-inpost-box .inside,.tsf-flex{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:flex-start;justify-content:flex-start}#tsf-inpost-box.closed .inside,body.js .tsf-flex-tab-content{display:none}#tsf-inpost-box .inside{margin:0;padding:0;-webkit-flex:1 0 100%;flex:1 0 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.tsf-flex-inside-wrap{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto}.tsf-flex-setting{width:100%;-webkit-flex-direction:row;flex-direction:row}.tsf-flex-setting-input,.tsf-flex-setting-label{background-color:#fff;padding:15px 12px;-webkit-flex:10 1 350px;flex:10 1 350px;box-shadow:0 0 0 1px #e9e9e9}.tsf-flex-setting-label{background-color:#f9f9f9;-webkit-flex:1 1 200px;flex:1 1 200px}.tsf-flex-setting-input{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:space-between;justify-content:space-between;-webkit-flex-grow:0;flex-grow:0}.tsf-flex-setting-label-inner-wrap{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item>*{margin-right:4px}.tsf-flex-setting-label-item>:last-child{margin-right:0}.tsf-social-image-buttons{margin-top:15px;margin-left:1px}.tsf-flex-setting-input textarea{max-height:250px}input[type=radio].tsf-flex-nav-tab-radio{display:none;width:0;height:0;margin:0;padding:0;position:absolute;left:-9001px}.tsf-flex-nav-tab-wrapper{background-color:#fcfcfc;border-bottom:2px solid #dadada;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 100%;flex:1 1 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;max-width:100%}.tsf-flex-nav-tab-inner{-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:1 0 auto;flex:1 0 auto}.tsf-flex-nav-tab{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto;max-width:125px}.tsf-flex-nav-tab-label{padding:12px;text-align:center;-webkit-flex-direction:row;flex-direction:row;box-shadow:0 0 0 0 transparent inset;-webkit-transition:box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out;transition:box-shadow .15s ease-out;-webkit-align-items:center;align-items:center;-webkit-align-content:space-between;align-content:space-between}.tsf-flex-nav-dashicon,.tsf-flex-nav-name{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.tsf-flex-nav-tab .tsf-flex-nav-tab-radio:checked+.tsf-flex-nav-tab-label{box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-transition:box-shadow .25s ease-in;-o-transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in}.tsf-flex-tab-content{-webkit-flex:1 0 100%;flex:1 0 100%;max-width:100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}body.js .tsf-flex-tab-content.tsf-flex-tab-content-active{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tsf-flex-tabs-content-no-js{background-color:#f3f3f3;border-bottom:1px solid #dadada;box-shadow:0 2px 0 0 #dadada inset}.tsf-flex-tab-no-js{-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;flex:1 1 100%}.tsf-flex-tab-no-js .tsf-flex-nav-tab{padding:12px;min-width:125px;box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:0 1 auto;flex:0 1 auto}#tsf-inpost-box .hndle .tsf-tooltip-wrap a{font-size:14px;line-height:1em}.tsf-primary-term-selector{margin:0;padding:0;float:right;line-height:inherit;display:inline-block}.tsf-primary-term-selector input{vertical-align:middle;height:14px;width:14px;min-width:14px;line-height:inherit;margin:0;padding:0;pointer-events:none}.tsf-primary-term-selector input:checked:before{width:6px;height:6px;margin:3px;line-height:inherit}.tsf-primary-term-selector-help-wrap{position:absolute;top:0;right:25px}.tsf-default-selected{border-color:#1c9d38}.tsf-default-selected:checked:before{color:#1c9d38}.tsf-warning-selected{border-color:#dd3811}.tsf-warning-selected:checked:before{color:#dd3811}.tsf-fields{font-size:13px;line-height:1.5;margin:1em 0}.tsf-fields .tsf-toblock{display:block;width:100%;margin-bottom:4px}.tsf-fields p.description{margin:7px 0 5px;color:#666}.tsf-option-spacer{margin:1em 0}.tsf-checkbox-wrapper{margin-top:15px}.tsf-checkbox-wrapper:first-child{margin-top:0}.tsf-metaboxes legend h4{margin:2px 0}.tsf-metaboxes legend p:last-of-type{margin-bottom:0}.tsf-counter .tsf-ajax{margin-left:3px}.tsf-ajax:before{display:inline-block;line-height:1;font-family:dashicons;font-style:normal;font-weight:400;font-size:1.225em;vertical-align:middle}.tsf-ajax.tsf-loading:before{content:"\f463";color:#007bd2;-webkit-animation:tsf-spin 1.5s linear infinite;-moz-animation:tsf-spin 1.5s linear infinite;-o-animation:tsf-spin 1.5s linear infinite;animation:tsf-spin 1.5s linear infinite}.tsf-ajax.tsf-error:before{content:"\f158";color:#dd3811}.tsf-ajax.tsf-success:before{content:"\f147";color:#0cc34b}a.tsf-set-social-image.button{margin-right:7px}#tsf-inpost-box input[type=text]::-webkit-input-placeholder,#tsf-inpost-box textarea::-webkit-input-placeholder,.tsf-metaboxes input[type=text]::-webkit-input-placeholder,.tsf-metaboxes textarea::-webkit-input-placeholder{-webkit-transition:color .33s ease-in,text-shadow .33s ease-in;-o-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]::-moz-placeholder,#tsf-inpost-box textarea::-moz-placeholder,.tsf-metaboxes input[type=text]::-moz-placeholder,.tsf-metaboxes textarea::-moz-placeholder{-moz-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:-ms-input-placeholder,#tsf-inpost-box textarea:-ms-input-placeholder,.tsf-metaboxes input[type=text]:-ms-input-placeholder,.tsf-metaboxes textarea:-ms-input-placeholder{transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:focus::-webkit-input-placeholder,#tsf-inpost-box textarea:focus::-webkit-input-placeholder,.tsf-metaboxes input[type=text]:focus::-webkit-input-placeholder,.tsf-metaboxes textarea:focus::-webkit-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus::-moz-placeholder,#tsf-inpost-box textarea:focus::-moz-placeholder,.tsf-metaboxe textarea:focus::-moz-placeholder,.tsf-metaboxes input[type=text]:focus::-moz-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus:-ms-input-placeholder,#tsf-inpost-box textarea:focus:-ms-input-placeholder,.tsf-metaboxes input[type=text]:focus:-ms-input-placeholder,.tsf-metaboxes textarea:focus:-ms-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}@-webkit-keyframes tsf-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes tsf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width:782px){.tsf-inpost-box p.tsf-fields,.tsf-metaboxes p.tsf-fields{line-height:2.8}#tsf-home-title-location label span,#tsf-title-location label span{min-width:40px}.wp-list-table .is-expanded td.tsf-seo-bar-wrap:not(.hidden){overflow:initial!important}.tsf-primary-term-selector input{height:18px;width:18px;min-width:18px}.tsf-primary-term-selector input:checked:before{width:8px;height:8px;margin:4px}}@media screen and (max-width:642px){.tsf-nav-desktop{display:none}}@media screen and (max-width:510px){.tsf-seo-bar.tsf-100{width:inherit}}@-moz-document url-prefix(){#tsf-description-separator label,#tsf-title-separator label{margin:3px 1px}@media only screen and (min-width:768px){.widefat tr td.column-title:nth-child(2):nth-last-child(n+6),.widefat tr td.title:nth-child(2):nth-last-child(n+6),.widefat tr th.column-title:nth-child(2):nth-last-child(n+6),.widefat tr th.title:nth-child(2):nth-last-child(n+6){min-width:1em;width:25%;max-width:100%;white-space:unset}}.tsf-default-selected{box-shadow:0 0 2px 0 #1c9d38}.tsf-warning-selected{box-shadow:0 0 2px 0 #dd3811}}.tsf-flex-hide-if-no-js,body.js .tsf-flex-hide-if-js{display:none}body.js .tsf-flex-hide-if-no-js{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
|
1 |
+
.tsf-notice{position:relative;clear:both}.tsf-notice.tsf-show-icon p:before{content:'';margin-right:12px;background:0 0;display:inline-block;font:400 14px/16px dashicons;speak:none;height:16px;text-align:center;vertical-align:middle;width:16px;line-height:14px;-webkit-font-smoothing:antialiased}.error.tsf-notice.tsf-show-icon p:before{color:#dd3811;content:"\f534"}.notice-warning.tsf-notice.tsf-show-icon p:before{color:#ffa01b;content:"\f227"}.updated.tsf-notice.tsf-show-icon p:before{color:#0cc34b;font-size:16px;content:"\f147"}a.tsf-dismiss{position:absolute;top:0;right:1px;border:none;margin:0;padding:9px;background:0 0;color:#b4b9be;cursor:pointer;text-decoration:none}a.tsf-dismiss:before{background:0 0;content:"\f153";display:block;font:400 16px/20px dashicons;speak:none;height:20px;text-align:center;width:20px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a.tsf-dismiss:hover{color:#c00}table.wp-list-table .column-name{width:15%}table.wp-list-table .column-icl_translations,table.wp-list-table .column-is_in_stock,table.wp-list-table .column-price,table.wp-list-table .column-sku,th.column-tsf-seo-bar-wrap~th{width:8%}.tsf-seo-bar-item{text-decoration:none;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#tsf-title-wrap{position:relative;display:block;padding:0;height:auto;width:auto;overflow:hidden}#tsf-title-offset{visibility:hidden;height:0;display:inline-block;position:absolute;left:0;color:transparent;white-space:pre}#tsf-title-placeholder,#tsf-title-placeholder-prefix{position:absolute;color:#777;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;top:0;left:0;overflow:hidden;white-space:pre;text-overflow:ellipsis;will-change:left,right}.tsf-counter-wrap{margin-top:15px}.tsf-counter{font-weight:400;color:#666;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;will-change:contents}.tsf-count-bad{color:#dd3811}.tsf-count-okay{color:#ffa700}.tsf-count-good{color:#0cc34b}.tsf-counter-one{color:#fff;border-radius:4em;padding:0 .5em;min-width:2em;display:inline-block;text-align:center;vertical-align:baseline}.tsf-counter-one.tsf-count-bad{background-color:#dd3811}.tsf-counter-one.tsf-count-okay{background-color:#ffa700}.tsf-counter-one.tsf-count-good{background-color:#0cc34b}.tsf-tabs-content .tsf-pixel-counter-wrap{margin-left:1px;max-width:99%}.tsf-pixel-shadow-wrap{position:relative;overflow:hidden;width:0;height:0}.tsf-pixel-counter-wrap{border-bottom:1px solid #ccc;margin-top:12px;margin-bottom:3px}.tsf-pixel-counter-bar{padding-top:7px;display:block;height:3px;width:100%}.tsf-pixel-counter-fluid{display:block;pointer-events:none;height:3px;width:0;max-width:100%;background:#007bd2;box-shadow:0 1px 3px 0 #ccc;-webkit-transition:width .15s cubic-bezier(.4,0,.75,1);-o-transition:width .15s cubic-bezier(.4,0,.75,1);transition:width .15s cubic-bezier(.4,0,.75,1)}.tsf-pixel-counter-overflown .tsf-pixel-counter-fluid{background-color:#dd3811}.tsf-pixel-counter-fit .tsf-pixel-counter-fluid{background-color:#0cc34b}.tsf-description-pixel-counter-shadow,.tsf-title-pixel-counter-shadow{position:absolute;left:0;top:0;z-index:-100;overflow:visible;visibility:hidden;padding:0;margin:0;border:0;display:inline;text-decoration:none;white-space:nowrap;word-wrap:normal;zoom:1;text-overflow:clip;-webkit-transition:none;-moz-transition:none;-o-transition:none;-ms-transition:none;transition:none;font-size:18px;font-weight:600}.tsf-description-pixel-counter-shadow{font-size:13px;font-weight:400}#tsf-seo-bar-wrap{width:18%}th:last-of-type#tsf-seo-bar-wrap{width:160px}.tsf-seo-bar{display:block;width:95%;max-width:220px;border-radius:0;padding:3px;text-shadow:0 0 3px rgba(0,0,0,.3)}.tsf-seo-bar.tsf-100{width:100%}.tsf-seo-bar-inner-wrap{display:table;width:100%;border-radius:0;margin:0 auto;border-collapse:separate;border-spacing:0;vertical-align:middle}.tsf-seo-bar-section-wrap{display:table-cell;border-collapse:collapse}.tsf-seo-bar-item{display:table;width:100%;color:#fff;text-align:center;height:100%;min-width:12px;vertical-align:top;line-height:1.625em;box-shadow:2px 0 0 -1px rgba(0,0,0,.1) inset,-2px 0 0 -1px rgba(0,0,0,.1) inset}body.no-js .tsf-seo-bar-item{cursor:default}.tsf-seo-bar.pill,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap{border-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-item{box-shadow:2px 6px 3px -2px rgba(255,255,255,.2) inset,-2px -6px 3px -2px rgba(41,41,41,.2) inset,0 0 1px rgba(41,41,41,.6)}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:first-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:first-of-type .tsf-seo-bar-item{border-top-left-radius:30px;border-bottom-left-radius:30px}.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type,.tsf-seo-bar.pill .tsf-seo-bar-inner-wrap .tsf-seo-bar-section-wrap:last-of-type .tsf-seo-bar-item{border-top-right-radius:30px;border-bottom-right-radius:30px}.tsf-100{width:100%}.tsf-60{width:60%}.tsf-50{width:50%}.tsf-40{width:40%}.tsf-33{width:33.333%}.tsf-25{width:25%}.tsf-20{width:20%}.tsf-16{width:16.666%}.tsf-12-5{width:12.5%}.tsf-11{width:11.333%}.tsf-10{width:10%}.tsf-seo-bar-bad{background-color:#dd3811}.tsf-seo-bar-okay{background-color:#ffa700}.tsf-seo-bar-good{background-color:#0cc34b}.tsf-seo-bar-unknown{background-color:#007bd2}.tsf-tooltip-wrap{position:relative}.tsf-tooltip-item{cursor:help}a.tsf-tooltip-item{cursor:auto}.tsf-tooltip{position:absolute;padding:0;margin:0;bottom:0;left:0;z-index:900142;text-align:left;pointer-events:none;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-tooltip-down{bottom:auto;top:0}.tsf-tooltip-text-wrap{padding:10px 12px;font-size:1em;font-weight:500;line-height:1.625em;border-radius:3px;background:#007bd2;color:#fdfdfd;box-shadow:0 0 2px rgba(0,0,0,.6);text-shadow:none;word-wrap:break-word;overflow-wrap:break-word;word-break:break-word;white-space:pre-line;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 0 150px;flex:1 0 150px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start}.tsf-is-primary-term,.tsf-nav-tab{font-weight:600}.tsf-tooltip-text span{text-decoration:underline}.tsf-tooltip-text br{display:block;width:100%;content:"\A"}.tsf-ajax:before,.tsf-tooltip-arrow:after,.tsf-tooltip-arrow:before{content:""}.tsf-tooltip-arrow{position:absolute;bottom:-8px;z-index:9999999;left:0;width:0;height:0}.tsf-tooltip-down .tsf-tooltip-arrow{bottom:auto;top:-8px}.tsf-tooltip-arrow:before{border-left:9px solid transparent;border-right:9px solid transparent;border-top:9px solid rgba(0,0,0,.25);position:absolute;bottom:-1px;left:-1px}.tsf-tooltip-arrow:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #007bd2;position:absolute;bottom:0;left:0}.tsf-tooltip-down .tsf-tooltip-arrow:before{bottom:auto;top:0;border-top:0;border-bottom:9px solid rgba(0,0,0,.25)}.tsf-tooltip-down .tsf-tooltip-arrow:after{bottom:auto;top:1px;border-top:0;border-bottom:8px solid #007bd2}.tsf-seo-bar-wrap.column-tsf-seo-bar-temp{overflow:initial!important;min-width:160px}#col-container,#col-right{overflow:initial}.tsf-metaboxes{box-sizing:border-box;max-width:690px;padding-bottom:20px}.tsf-top-wrap{width:100%;display:inline-block;vertical-align:top}.tsf-top-wrap>h1,.tsf-top-wrap>h2{float:left}.tsf-metaboxes .metabox-holder{clear:both}.tsf-top-buttons{float:right}.tsf-bottom-buttons{text-align:right}.tsf-metaboxes .tsf-bottom-buttons input,.tsf-metaboxes .tsf-top-buttons input{margin-left:10px}#tsf-description-separator,#tsf-title-separator{display:table;width:100%;border-collapse:collapse;border-spacing:0}#tsf-description-separator input,#tsf-title-separator input{display:none;float:left;width:0;min-width:0;opacity:0}#tsf-description-separator label,#tsf-title-separator label{display:inline-block;width:auto;min-width:28px;min-height:28px;margin:3px;-moz-margin-end:1.5px;-moz-margin-start:1.5px;padding:0 4px;border:1px solid #ccc;line-height:28px;text-align:center;cursor:pointer;box-shadow:-1px -1px 1px #aaa inset;font-size:16px}#tsf-description-separator label.tsf-recommended,#tsf-title-separator label.tsf-recommended{border:1px solid #0cc34b;box-shadow:-1px -1px 1px #0cc34b inset}#tsf-description-separator input:hover+label,#tsf-description-separator label:hover,#tsf-title-separator input:hover+label,#tsf-title-separator label:hover{box-shadow:1px 1px 1px #aaa inset;background-color:#fff}#tsf-description-separator input:checked+label,#tsf-title-separator input:checked+label{box-shadow:1px 1px 1px #333 inset;background-color:#fff}#tsf-home-title-location,#tsf-title-location{display:block}#tsf-home-title-location label span,#tsf-title-location label span,#tsf-twitter-cards label span{display:inline-block;min-width:60px;vertical-align:baseline}#tsf-twitter-cards label span{min-width:150px}#tsf-home-title-location label .tsf-sep-js,#tsf-home-title-location label span.tsf-custom-blogname-js,#tsf-home-title-location label span.tsf-custom-tagline-js,#tsf-home-title-location label span.tsf-custom-title-js,#tsf-title-location label .tsf-sep-js{display:inline;min-width:0;white-space:pre}.tsf-nav-tab-wrapper,.tsf-tab-no-js{position:relative;clear:both;width:100%;display:inline-block;border-bottom:1px solid #ccc;line-height:inherit;padding:8px 12px 0;margin:-4px -12px}.tsf-nav-tab{float:left;border:1px solid #ccc;margin-left:.5em;margin-bottom:-1px;padding:5px 14px;font-size:12px;line-height:16px;background:#f1f1f1;color:#555}.tsf-dashicons-tabs{font-size:initial;display:inline;vertical-align:text-bottom}input.tsf-tabs-radio{display:none;width:0;height:0;position:absolute;left:-9001px}.tsf-active-tab,.tsf-tabs-radio:checked+label{background-color:inherit;border-bottom-color:#fff;color:#000}.tsf-tabs-content{margin:1.33em auto 0}.tsf-content-no-js{margin:1.33em auto}body.js .tsf-tabs-content{display:none}body.js .tsf-tabs-content.tsf-active-tab-content{display:block}#tsf-inpost-box .inside,.tsf-flex{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1 1 auto;flex:1 1 auto;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:flex-start;justify-content:flex-start}#tsf-inpost-box.closed .inside,body.js .tsf-flex-tab-content{display:none}#tsf-inpost-box .inside{margin:0;padding:0;-webkit-flex:1 0 100%;flex:1 0 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.tsf-flex-inside-wrap{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto}.tsf-flex-setting{width:100%;-webkit-flex-direction:row;flex-direction:row}.tsf-flex-setting-input,.tsf-flex-setting-label{background-color:#fff;padding:15px 12px;-webkit-flex:10 1 350px;flex:10 1 350px;box-shadow:0 0 0 1px #e9e9e9}.tsf-flex-setting-label{background-color:#f9f9f9;-webkit-flex:1 1 200px;flex:1 1 200px}.tsf-flex-setting-input{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:space-between;justify-content:space-between;-webkit-flex-grow:0;flex-grow:0}.tsf-flex-setting-label-inner-wrap{-webkit-justify-content:center;justify-content:center}.tsf-flex-setting-label-item>*{margin-right:4px}.tsf-flex-setting-label-item>:last-child{margin-right:0}.tsf-social-image-buttons{margin-top:15px;margin-left:1px}.tsf-flex-setting-input textarea{max-height:250px}input[type=radio].tsf-flex-nav-tab-radio{display:none;width:0;height:0;margin:0;padding:0;position:absolute;left:-9001px}.tsf-flex-nav-tab-wrapper{background-color:#fcfcfc;border-bottom:2px solid #dadada;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 100%;flex:1 1 100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;max-width:100%}.tsf-flex-nav-tab-inner{-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:1 0 auto;flex:1 0 auto}.tsf-flex-nav-tab{-webkit-flex-direction:row;flex-direction:row;-webkit-flex:1 1 auto;flex:1 1 auto;max-width:125px}.tsf-flex-nav-tab-label{padding:12px;text-align:center;-webkit-flex-direction:row;flex-direction:row;box-shadow:0 0 0 0 transparent inset;-webkit-transition:box-shadow .15s ease-out;-o-transition:box-shadow .15s ease-out;transition:box-shadow .15s ease-out;-webkit-align-items:center;align-items:center;-webkit-align-content:space-between;align-content:space-between}.tsf-flex-nav-dashicon,.tsf-flex-nav-name{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.tsf-flex-nav-tab .tsf-flex-nav-tab-radio:checked+.tsf-flex-nav-tab-label{box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-transition:box-shadow .25s ease-in;-o-transition:box-shadow .25s ease-in;transition:box-shadow .25s ease-in}.tsf-flex-tab-content{-webkit-flex:1 0 100%;flex:1 0 100%;max-width:100%;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}body.js .tsf-flex-tab-content.tsf-flex-tab-content-active{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tsf-flex-tabs-content-no-js{background-color:#f3f3f3;border-bottom:1px solid #dadada;box-shadow:0 2px 0 0 #dadada inset}.tsf-flex-tab-no-js{-webkit-align-items:baseline;align-items:baseline;-webkit-flex-direction:row;flex-direction:row;flex:1 1 100%}.tsf-flex-tab-no-js .tsf-flex-nav-tab{padding:12px;min-width:125px;box-shadow:0 -2px 0 0 #007bd2 inset;-webkit-flex-direction:row;flex-direction:row;-webkit-flex:0 1 auto;flex:0 1 auto}#tsf-inpost-box .hndle .tsf-tooltip-wrap a{font-size:14px;line-height:1em}.tsf-primary-term-selector{margin:0;padding:0;float:right;line-height:inherit;display:inline-block}.tsf-primary-term-selector input{vertical-align:middle;height:14px;width:14px;min-width:14px;line-height:inherit;margin:0;padding:0;pointer-events:none}.tsf-primary-term-selector input:checked:before{width:6px;height:6px;margin:3px;line-height:inherit}.tsf-primary-term-selector-help-wrap{position:absolute;top:0;right:25px}input.tsf-default-selected{border-color:#1c9d38}input.tsf-default-selected:checked:before{color:#1c9d38}input.tsf-warning-selected{border-color:#dd3811}input.tsf-warning-selected:checked:before{color:#dd3811}label.tsf-disabled{color:#999}input.tsf-disabled,label.tsf-disabled{cursor:default}.tsf-fields{font-size:13px;line-height:1.5;margin:1em 0}.tsf-fields .tsf-toblock{display:block;width:100%;margin-bottom:4px}.tsf-fields p.description{margin:7px 0 5px;color:#666}.tsf-option-spacer{margin:1em 0}.tsf-checkbox-wrapper{margin-top:15px}.tsf-checkbox-wrapper:first-child{margin-top:0}.tsf-metaboxes legend h4{margin:2px 0}.tsf-metaboxes legend p:last-of-type{margin-bottom:0}.tsf-counter .tsf-ajax{margin-left:3px}.tsf-ajax:before{display:inline-block;line-height:1;font-family:dashicons;font-style:normal;font-weight:400;font-size:1.225em;vertical-align:middle}.tsf-ajax.tsf-loading:before{content:"\f463";color:#007bd2;-webkit-animation:tsf-spin 1.5s linear infinite;-moz-animation:tsf-spin 1.5s linear infinite;-o-animation:tsf-spin 1.5s linear infinite;animation:tsf-spin 1.5s linear infinite}.tsf-ajax.tsf-error:before{content:"\f158";color:#dd3811}.tsf-ajax.tsf-success:before{content:"\f147";color:#0cc34b}a.tsf-set-social-image.button{margin-right:7px}#tsf-inpost-box input[type=text]::-webkit-input-placeholder,#tsf-inpost-box textarea::-webkit-input-placeholder,.tsf-metaboxes input[type=text]::-webkit-input-placeholder,.tsf-metaboxes textarea::-webkit-input-placeholder{-webkit-transition:color .33s ease-in,text-shadow .33s ease-in;-o-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]::-moz-placeholder,#tsf-inpost-box textarea::-moz-placeholder,.tsf-metaboxes input[type=text]::-moz-placeholder,.tsf-metaboxes textarea::-moz-placeholder{-moz-transition:color .33s ease-in,text-shadow .33s ease-in;transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:-ms-input-placeholder,#tsf-inpost-box textarea:-ms-input-placeholder,.tsf-metaboxes input[type=text]:-ms-input-placeholder,.tsf-metaboxes textarea:-ms-input-placeholder{transition:color .33s ease-in,text-shadow .33s ease-in}#tsf-inpost-box input[type=text]:focus::-webkit-input-placeholder,#tsf-inpost-box textarea:focus::-webkit-input-placeholder,.tsf-metaboxes input[type=text]:focus::-webkit-input-placeholder,.tsf-metaboxes textarea:focus::-webkit-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus::-moz-placeholder,#tsf-inpost-box textarea:focus::-moz-placeholder,.tsf-metaboxe textarea:focus::-moz-placeholder,.tsf-metaboxes input[type=text]:focus::-moz-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}#tsf-inpost-box input[type=text]:focus:-ms-input-placeholder,#tsf-inpost-box textarea:focus:-ms-input-placeholder,.tsf-metaboxes input[type=text]:focus:-ms-input-placeholder,.tsf-metaboxes textarea:focus:-ms-input-placeholder{color:transparent;text-shadow:0 0 1px rgba(114,119,124,.75)}@-webkit-keyframes tsf-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes tsf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width:782px){.tsf-inpost-box p.tsf-fields,.tsf-metaboxes p.tsf-fields{line-height:2.8}#tsf-home-title-location label span,#tsf-title-location label span{min-width:40px}.wp-list-table .is-expanded td.tsf-seo-bar-wrap:not(.hidden){overflow:initial!important}.tsf-primary-term-selector input{height:18px;width:18px;min-width:18px}.tsf-primary-term-selector input:checked:before{width:8px;height:8px;margin:4px}}@media screen and (max-width:642px){.tsf-nav-desktop{display:none}}@media screen and (max-width:510px){.tsf-seo-bar.tsf-100{width:inherit}}@-moz-document url-prefix(){#tsf-description-separator label,#tsf-title-separator label{margin:3px 1px}@media only screen and (min-width:768px){.widefat tr td.column-title:nth-child(2):nth-last-child(n+6),.widefat tr td.title:nth-child(2):nth-last-child(n+6),.widefat tr th.column-title:nth-child(2):nth-last-child(n+6),.widefat tr th.title:nth-child(2):nth-last-child(n+6){min-width:1em;width:25%;max-width:100%;white-space:unset}}.tsf-default-selected{box-shadow:0 0 2px 0 #1c9d38}.tsf-warning-selected{box-shadow:0 0 2px 0 #dd3811}}.tsf-flex-hide-if-no-js,body.js .tsf-flex-hide-if-js{display:none}body.js .tsf-flex-hide-if-no-js{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
|
lib/js/tsf.js
CHANGED
@@ -442,7 +442,7 @@ window.tsf = {
|
|
442 |
return;
|
443 |
}
|
444 |
|
445 |
-
let outerWidth = $input.outerWidth(),
|
446 |
verticalPadding = ( $input.outerHeight( true ) - $input.height() ) / 2,
|
447 |
horizontalPadding = ( outerWidth - $input.innerWidth() ) / 2;
|
448 |
|
@@ -469,13 +469,14 @@ window.tsf = {
|
|
469 |
totalIndent = 0,
|
470 |
prefixMaxWidth = 0;
|
471 |
|
|
|
|
|
472 |
if ( hasPrefixValue ) {
|
473 |
$prefixElement.css( fontStyleCSS );
|
474 |
$prefixElement.css( { 'maxWidth' : 'initial' } );
|
475 |
-
prefixMaxWidth = $prefixElement.
|
476 |
-
if ( prefixMaxWidth <
|
477 |
prefixMaxWidth = 0;
|
478 |
-
prefixOffset += leftOffset;
|
479 |
}
|
480 |
if ( hasAdditionsValue ) {
|
481 |
let textWidth = 0;
|
@@ -489,27 +490,30 @@ window.tsf = {
|
|
489 |
'letterSpacing' : fontStyleCSS.letterSpacing,
|
490 |
'fontSize' : fontStyleCSS.fontSize,
|
491 |
});
|
492 |
-
textWidth = $offsetTest.
|
493 |
})();
|
494 |
|
495 |
//= Input element width - Padding - input text width - prefix value width.
|
496 |
-
additionsMaxWidth = $input.
|
497 |
-
if ( additionsMaxWidth <
|
498 |
-
|
|
|
499 |
additionsMaxWidth = 0;
|
500 |
}
|
501 |
-
|
502 |
$additionsElement.css( fontStyleCSS );
|
|
|
503 |
|
504 |
switch ( hoverAdditionsPlacement ) {
|
505 |
case 'before' :
|
506 |
-
let additionsWidth = $additionsElement.
|
507 |
|
508 |
-
|
|
|
509 |
additionsWidth = 0;
|
|
|
510 |
|
511 |
-
totalIndent +=
|
512 |
-
prefixOffset +=
|
513 |
additionsOffset += leftOffset;
|
514 |
break;
|
515 |
|
@@ -518,6 +522,7 @@ window.tsf = {
|
|
518 |
break;
|
519 |
}
|
520 |
}
|
|
|
521 |
prefixMaxWidth = prefixMaxWidth < 0 ? 0 : prefixMaxWidth;
|
522 |
totalIndent += prefixMaxWidth;
|
523 |
|
@@ -867,32 +872,51 @@ window.tsf = {
|
|
867 |
* @param {!jQuery.Event}
|
868 |
* @return {undefined}
|
869 |
*/
|
870 |
-
const
|
871 |
let settingsChangedCache = tsf.settingsChanged;
|
872 |
-
triggerInput();
|
873 |
tsf.settingsChanged = settingsChangedCache;
|
874 |
}
|
875 |
-
jQuery( '#
|
876 |
-
jQuery( '#
|
877 |
-
jQuery( '#tsf-flex-inpost-tab-general' ).on( 'tsf-flex-tab-toggled', triggerUnregisteredTitleChange );
|
878 |
|
879 |
let unregisteredTriggerBuffer = 0;
|
880 |
/**
|
881 |
-
*
|
882 |
* @function
|
883 |
* @return {undefined}
|
884 |
*/
|
885 |
-
const
|
886 |
clearTimeout( unregisteredTriggerBuffer );
|
887 |
unregisteredTriggerBuffer = setTimeout( function() {
|
888 |
-
|
889 |
}, 50 );
|
890 |
}
|
891 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
892 |
|
893 |
/**
|
894 |
* Triggers additions hover update on tagline placement change.
|
895 |
-
*
|
896 |
* @function
|
897 |
* @return {undefined}
|
898 |
*/
|
@@ -922,7 +946,7 @@ window.tsf = {
|
|
922 |
updatePlaceholder();
|
923 |
triggerCounter();
|
924 |
}
|
925 |
-
//= The home page listens to a static preset value.
|
926 |
if ( ! tsf.states.isHome ) {
|
927 |
jQuery( '#edittag #name, #titlewrap #title' ).on( 'input', updateDefaultTitle );
|
928 |
}
|
@@ -947,11 +971,11 @@ window.tsf = {
|
|
947 |
let width = window.innerWidth;
|
948 |
if ( prevWidth < width ) {
|
949 |
if ( prevWidth <= 782 && width >= 782 ) {
|
950 |
-
|
951 |
}
|
952 |
} else {
|
953 |
if ( prevWidth >= 782 && width <= 782 ) {
|
954 |
-
|
955 |
}
|
956 |
}
|
957 |
prevWidth = width;
|
@@ -1083,8 +1107,8 @@ window.tsf = {
|
|
1083 |
jQuery( '#tsf-home-title-location .tsf-sep-js' ).show();
|
1084 |
}
|
1085 |
};
|
1086 |
-
jQuery( '#autodescription-site-settings\\[homepage_title_tagline\\]' ).on( 'input', adjustHomepageTaglineExampleOutput );
|
1087 |
-
jQuery( '#autodescription-site-settings\\[homepage_title_tagline\\]' ).trigger( 'input' );
|
1088 |
|
1089 |
/**
|
1090 |
* Toggles title prefixes for the Prefix Title example.
|
@@ -1272,6 +1296,37 @@ window.tsf = {
|
|
1272 |
}, 50 );
|
1273 |
}
|
1274 |
jQuery( window ).on( 'tsf-counter-updated', enqueueTriggerInput );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1275 |
},
|
1276 |
|
1277 |
/**
|
@@ -3147,13 +3202,13 @@ window.tsf = {
|
|
3147 |
// Deregister changes.
|
3148 |
tsf.onLoadUnregisterChange();
|
3149 |
|
|
|
|
|
|
|
3150 |
// Trigger tsf-ready event.
|
3151 |
tsf._triggerReady();
|
3152 |
|
3153 |
// #== Start After Change listener
|
3154 |
-
|
3155 |
-
// Do flex resize functionality.
|
3156 |
-
tsf._doFlexResizeListener();
|
3157 |
},
|
3158 |
|
3159 |
/**
|
442 |
return;
|
443 |
}
|
444 |
|
445 |
+
let outerWidth = $input.outerWidth( true ),
|
446 |
verticalPadding = ( $input.outerHeight( true ) - $input.height() ) / 2,
|
447 |
horizontalPadding = ( outerWidth - $input.innerWidth() ) / 2;
|
448 |
|
469 |
totalIndent = 0,
|
470 |
prefixMaxWidth = 0;
|
471 |
|
472 |
+
let elipsisWidth = 0; // TODO make this real? x-Browser incompatible!
|
473 |
+
|
474 |
if ( hasPrefixValue ) {
|
475 |
$prefixElement.css( fontStyleCSS );
|
476 |
$prefixElement.css( { 'maxWidth' : 'initial' } );
|
477 |
+
prefixMaxWidth = $prefixElement[0].getBoundingClientRect().width;
|
478 |
+
if ( prefixMaxWidth < elipsisWidth )
|
479 |
prefixMaxWidth = 0;
|
|
|
480 |
}
|
481 |
if ( hasAdditionsValue ) {
|
482 |
let textWidth = 0;
|
490 |
'letterSpacing' : fontStyleCSS.letterSpacing,
|
491 |
'fontSize' : fontStyleCSS.fontSize,
|
492 |
});
|
493 |
+
textWidth = $offsetTest[0].getBoundingClientRect().width;
|
494 |
})();
|
495 |
|
496 |
//= Input element width - Padding - input text width - prefix value width.
|
497 |
+
additionsMaxWidth = $input[0].getBoundingClientRect().width - horizontalPadding - leftOffset - textWidth - prefixMaxWidth;
|
498 |
+
if ( additionsMaxWidth < elipsisWidth ) {
|
499 |
+
//= Add width to the prefix element, so it may stay its size, and hide the additions.
|
500 |
+
prefixMaxWidth += additionsMaxWidth;
|
501 |
additionsMaxWidth = 0;
|
502 |
}
|
|
|
503 |
$additionsElement.css( fontStyleCSS );
|
504 |
+
$additionsElement.css( { 'maxWidth' : 'initial' } );
|
505 |
|
506 |
switch ( hoverAdditionsPlacement ) {
|
507 |
case 'before' :
|
508 |
+
let additionsWidth = $additionsElement[0].getBoundingClientRect().width;
|
509 |
|
510 |
+
additionsWidth = additionsMaxWidth < additionsWidth ? additionsMaxWidth : additionsWidth;
|
511 |
+
if ( additionsWidth < elipsisWidth )
|
512 |
additionsWidth = 0;
|
513 |
+
additionsMaxWidth = additionsWidth;
|
514 |
|
515 |
+
totalIndent += additionsMaxWidth;
|
516 |
+
prefixOffset += additionsMaxWidth;
|
517 |
additionsOffset += leftOffset;
|
518 |
break;
|
519 |
|
522 |
break;
|
523 |
}
|
524 |
}
|
525 |
+
prefixOffset += leftOffset;
|
526 |
prefixMaxWidth = prefixMaxWidth < 0 ? 0 : prefixMaxWidth;
|
527 |
totalIndent += prefixMaxWidth;
|
528 |
|
872 |
* @param {!jQuery.Event}
|
873 |
* @return {undefined}
|
874 |
*/
|
875 |
+
const triggerUnregisteredInput = function() {
|
876 |
let settingsChangedCache = tsf.settingsChanged;
|
877 |
+
triggerInput( true );
|
878 |
tsf.settingsChanged = settingsChangedCache;
|
879 |
}
|
880 |
+
jQuery( '#homepage-tab-general' ).on( 'tsf-tab-toggled', triggerUnregisteredInput );
|
881 |
+
jQuery( '#tsf-flex-inpost-tab-general' ).on( 'tsf-flex-tab-toggled', triggerUnregisteredInput );
|
|
|
882 |
|
883 |
let unregisteredTriggerBuffer = 0;
|
884 |
/**
|
885 |
+
* Enqueues doctitles input trigger.
|
886 |
* @function
|
887 |
* @return {undefined}
|
888 |
*/
|
889 |
+
const enqueueUnregisteredInputTrigger = function() {
|
890 |
clearTimeout( unregisteredTriggerBuffer );
|
891 |
unregisteredTriggerBuffer = setTimeout( function() {
|
892 |
+
triggerUnregisteredInput();
|
893 |
}, 50 );
|
894 |
}
|
895 |
+
//= Defer to prevent early trigger.
|
896 |
+
jQuery( window ).one( 'tsf-ready', function() {
|
897 |
+
jQuery( window ).on( 'tsf-flex-resize', enqueueUnregisteredInputTrigger );
|
898 |
+
} );
|
899 |
+
|
900 |
+
let postboxIds = [ 'autodescription-homepage-settings', 'tsf-inpost-box' ];
|
901 |
+
/**
|
902 |
+
* Enqueues doctitles input trigger synchronously.
|
903 |
+
* @function
|
904 |
+
* @param {!jQuery.Event} event
|
905 |
+
* @param {Element} elem
|
906 |
+
* @return {undefined}
|
907 |
+
*/
|
908 |
+
const triggerPostboxSynchronousUnregisteredInput = function( event, elem ) {
|
909 |
+
if ( postboxIds.indexOf( elem.id ) >= 0 ) {
|
910 |
+
let inside = elem.querySelector( '.inside' );
|
911 |
+
if ( inside.offsetHeight > 0 && inside.offsetWidth > 0 ) {
|
912 |
+
triggerUnregisteredInput();
|
913 |
+
}
|
914 |
+
}
|
915 |
+
}
|
916 |
+
jQuery( document ).on( 'postbox-toggled', triggerPostboxSynchronousUnregisteredInput );
|
917 |
|
918 |
/**
|
919 |
* Triggers additions hover update on tagline placement change.
|
|
|
920 |
* @function
|
921 |
* @return {undefined}
|
922 |
*/
|
946 |
updatePlaceholder();
|
947 |
triggerCounter();
|
948 |
}
|
949 |
+
//= The home page listens to a static preset value. Update all others.
|
950 |
if ( ! tsf.states.isHome ) {
|
951 |
jQuery( '#edittag #name, #titlewrap #title' ).on( 'input', updateDefaultTitle );
|
952 |
}
|
971 |
let width = window.innerWidth;
|
972 |
if ( prevWidth < width ) {
|
973 |
if ( prevWidth <= 782 && width >= 782 ) {
|
974 |
+
triggerUnregisteredInput();
|
975 |
}
|
976 |
} else {
|
977 |
if ( prevWidth >= 782 && width <= 782 ) {
|
978 |
+
triggerUnregisteredInput();
|
979 |
}
|
980 |
}
|
981 |
prevWidth = width;
|
1107 |
jQuery( '#tsf-home-title-location .tsf-sep-js' ).show();
|
1108 |
}
|
1109 |
};
|
1110 |
+
jQuery( '#autodescription-site-settings\\[homepage_title_tagline\\]' ).on( 'input.tsfInputTagline', adjustHomepageTaglineExampleOutput );
|
1111 |
+
jQuery( '#autodescription-site-settings\\[homepage_title_tagline\\]' ).trigger( 'input.tsfInputTagline' );
|
1112 |
|
1113 |
/**
|
1114 |
* Toggles title prefixes for the Prefix Title example.
|
1296 |
}, 50 );
|
1297 |
}
|
1298 |
jQuery( window ).on( 'tsf-counter-updated', enqueueTriggerInput );
|
1299 |
+
|
1300 |
+
/**
|
1301 |
+
* Triggers description input, without affecting change listeners.
|
1302 |
+
*
|
1303 |
+
* @function
|
1304 |
+
* @param {!jQuery.Event}
|
1305 |
+
* @return {undefined}
|
1306 |
+
*/
|
1307 |
+
const triggerUnregisteredInput = function() {
|
1308 |
+
let settingsChangedCache = tsf.settingsChanged;
|
1309 |
+
triggerInput();
|
1310 |
+
tsf.settingsChanged = settingsChangedCache;
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
let postboxIds = [ 'autodescription-homepage-settings', 'tsf-inpost-box' ];
|
1314 |
+
/**
|
1315 |
+
* Enqueues description input trigger synchronously.
|
1316 |
+
* @function
|
1317 |
+
* @param {!jQuery.Event} event
|
1318 |
+
* @param {Element} elem
|
1319 |
+
* @return {undefined}
|
1320 |
+
*/
|
1321 |
+
const triggerPostboxSynchronousUnregisteredInput = function( event, elem ) {
|
1322 |
+
if ( postboxIds.indexOf( elem.id ) >= 0 ) {
|
1323 |
+
let inside = elem.querySelector( '.inside' );
|
1324 |
+
if ( inside.offsetHeight > 0 && inside.offsetWidth > 0 ) {
|
1325 |
+
enqueueTriggerInput();
|
1326 |
+
}
|
1327 |
+
}
|
1328 |
+
}
|
1329 |
+
jQuery( document ).on( 'postbox-toggled', triggerPostboxSynchronousUnregisteredInput );
|
1330 |
},
|
1331 |
|
1332 |
/**
|
3202 |
// Deregister changes.
|
3203 |
tsf.onLoadUnregisterChange();
|
3204 |
|
3205 |
+
// Do flex resize functionality.
|
3206 |
+
tsf._doFlexResizeListener();
|
3207 |
+
|
3208 |
// Trigger tsf-ready event.
|
3209 |
tsf._triggerReady();
|
3210 |
|
3211 |
// #== Start After Change listener
|
|
|
|
|
|
|
3212 |
},
|
3213 |
|
3214 |
/**
|
lib/js/tsf.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
'use strict';window.tsf={nonces:tsfL10n.nonces,i18n:tsfL10n.i18n,states:tsfL10n.states,params:tsfL10n.params,other:tsfL10n.other,settingsChanged:!1,counterType:0,hasInput:!1,additionsClass:'',cropper:{},confirm:function(t){return confirm(t)},escapeString:function(t){if(!t.length)return'';var s={'&':'&','<':'<','>':'>','"':'"','\'':'''};return t.replace(/[&<>"']/g,function(a){return s[a]})},getStringLength:function(t){let s,a=0;return t.length&&(s=document.createElement('span'),s.innerHTML=tsf.escapeString(t),a=s.childNodes[0].nodeValue.length),+a},updatePixelCounter:function(t){let s=t.e,a=t.text,o=t.guideline,n=s.parentElement;if(n){let r=n.querySelector('.tsf-pixel-counter-bar'),l=n.querySelector('.tsf-pixel-counter-shadow');if(r&&l){l.innerHTML=tsf.escapeString(a);let d=l.offsetWidth,c='',g='',f='tsf-pixel-counter-fit',u='tsf-pixel-counter-overflown';d>o?(g=100*(o/(d+2*(d-o)/3))+'%',c=u):(g=100*(d/o)+'%',c=f);let x,y=r.querySelector('.tsf-pixel-counter-fluid');x=tsf.i18n.pixelsUsed.replace(/%1\$d/g,d),x=x.replace(/%2\$d/g,o),r.classList.remove(f,u),r.classList.add(c),r.dataset.desc=x,r.setAttribute('aria-label',x),y.style.width=g,tsf._triggerTooltipUpdate(r)}}},_initTitleInputs:function(){if(tsf.hasInput){let t=jQuery('#autodescription_title, #autodescription-meta\\[doctitle\\], #autodescription-site-settings\\[homepage_title\\]');if(t.length){let o,n,r,d,s=!1,a=!!navigator.userAgent.match(/Trident\/7\./),l='',c='',g=tsf.params.titleSeparator,f=tsf.params.objectTitle,u=tsf.states.useTagline,y=tsf.states.isRTL,x=tsf.states.isPrivate,v=tsf.states.isPasswordProtected;o=y?'after':'before';const b=function(){let X='before';tsf.states.isSettingsPage?y?'right'===jQuery('#tsf-home-title-location input:checked').val()&&(X='after'):'left'===jQuery('#tsf-home-title-location input:checked').val()&&(X='after'):tsf.states.isHome?y?'right'===tsf.params.titleLocation&&(X='after'):'left'===tsf.params.titleLocation&&(X='after'):y?'left'===tsf.params.titleLocation&&(X='after'):'right'===tsf.params.titleLocation&&(X='after'),n=X};b();const k=function(){let X='';if(!tsf.states.isSettingsPage)tsf.states.isHome?u&&(X=tsf.params.titleAdditions):u&&(X=tsf.params.titleAdditions);else if(u){let V=document.getElementById('autodescription-site-settings[homepage_title_tagline]'),G=V?V.value:'';X=G.length?G:tsf.params.blogDescription}X.length&&(X=tsf.escapeString(X),'before'===n?X=X+' '+g+' ':'after'===n?X=' '+g+' '+X:void 0),c=X.length?X:'',d=document.getElementById('tsf-title-placeholder'),c.length&&d&&(d.innerHTML=c)};k();const T=function(){let X='';x?X=tsf.i18n.privateTitle:v&&(X=tsf.i18n.protectedTitle),X.length&&(X=tsf.escapeString(X),'before'===o?X+=' ':'after'===o?X=' '+X:void 0),l=X.length?X:'',l.length&&r&&(r.innerHTML=l),r=document.getElementById('tsf-title-placeholder-prefix'),l.length&&r&&(r.innerHTML=l)};T();const C=function(X){if(d||r){let V=jQuery(X.target),G=V.val(),J=!!c.length,K=!!l.length;if(!J&&d&&(d.style.display='none'),!K&&r&&(r.style.display='none'),!J&&!K)return void V.css('text-indent','initial');if(!G.length)return V.css('text-indent','initial'),d&&(d.style.display='none'),void(r&&(r.style.display='none'));let Y=V.outerWidth(),Z=(V.outerHeight(!0)-V.height())/2,Q=(Y-V.innerWidth())/2,tt=y?'right':'left',et=(V.outerWidth(!0)-V.width())/2,it={display:V.css('display'),lineHeight:V.css('lineHeight'),fontFamily:V.css('fontFamily'),fontWeight:V.css('fontWeight'),fontSize:V.css('fontSize'),letterSpacing:V.css('letterSpacing'),paddingTop:Z+'px',paddingBottom:Z+'px'},st=jQuery(r),at=jQuery(d),ot=0,nt=0,rt=0,lt=0,pt=0;if(K&&(st.css(it),st.css({maxWidth:'initial'}),pt=st.width(),0>pt&&(pt=0),rt+=et),J){let ct=0;switch(function(){let gt=jQuery('#tsf-title-offset');gt.text(G),gt.css({fontFamily:it.fontFamily,fontWeight:it.fontWeight,letterSpacing:it.letterSpacing,fontSize:it.fontSize}),ct=gt.width()}(),ot=V.width()-Q-ct-pt,0>ot&&(pt-=-ot,ot=0),at.css(it),n){case'before':let gt=at.width();0>gt&&(gt=0),lt+=gt,rt+=gt,nt+=et;break;case'after':nt+=et+ct+pt;}}pt=0>pt?0:pt,lt+=pt;let dt;K&&(dt={},dt[tt]=rt+'px',dt.maxWidth=pt+'px',st.css(dt)),J&&(dt={},dt[tt]=nt+'px',dt.maxWidth=ot+'px',at.css(dt)),dt={},dt['text-indent']=lt+'px',V.css(dt)}},I=function(){let V='',G=!!c.length,J=!!l.length,K=c,Y=l;tsf.states.isTermEdit&&tsf.params.termName&&(Y=y?' :'+tsf.params.termName:tsf.params.termName+': ',J=tsf.states.useTermPrefix),V=f,J&&('before'===o?V=Y+V:'after'===o?V+=Y:void 0),G&&('before'===n?V=K+V:'after'===n?V+=K:void 0),a&&(s=!0);let Z=document.createElement('span');Z.innerHTML=V,t.prop('placeholder',Z.textContent),a&&setTimeout(function(){s=!1},0)},S=function(X){let V=document.getElementById(X.target.id+'_chars');if(V){let G=0,J=X.target,K='',Y=tsf.counterType,Z='',Q='';G=1>J.value.length?tsf.getStringLength(J.placeholder):(l?tsf.getStringLength(l):0)+tsf.getStringLength(J.value)+(c?tsf.getStringLength(c):0),25>G||75<=G?(K+='tsf-count-bad',Z=tsf.i18n.bad):42>G||55<G?(K+='tsf-count-okay',Z=tsf.i18n.okay):(K+='tsf-count-good',Z=tsf.i18n.good),Y&&1!=Y?2==Y?Q=Z:3==Y&&(Q=G.toString()+' - '+Z):Q=G.toString(),V.innerHTML=Q,tsf.additionsClass&&(K+=' '+tsf.additionsClass),V.className!==K&&(V.className=K)}},L=function(X){let V=document.getElementById(X.target.id+'_pixels');if(V){let G='';1>X.target.value.length?G=X.target.placeholder:(G=X.target.value,l.length&&('before'===o?G=l+G:'after'===o?G+=l:void 0),c.length&&('before'===n?G=c+G:'after'===n?G+=c:void 0));let J={e:V,text:G,guideline:tsf.params.titlePixelGuideline};tsf.updatePixelCounter(J)}};t.on('input.tsfUpdateTitles',function(X){return!s&&void(C(X),I(),S(X),L(X))});t.on('tsf-update-title-counter',function(X){S(X),L(X)});const j=function(){t.trigger('tsf-update-title-counter')},P=function(){t.trigger('input.tsfUpdateTitles')};P();const R=function(){k(),P()};jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').on('input',R),jQuery('#autodescription-site-settings\\[homepage_tagline\\]').on('change',R);let A=0;const D=function(){clearTimeout(A),A=setTimeout(function(){P()},50)};jQuery(window).on('tsf-counter-updated',D);jQuery('#tsf-title-tagline-toggle :input').on('click',function(X){let V=u;jQuery(X.target).is(':checked')?(jQuery('.tsf-custom-blogname-js').css('display','inline'),u=!0):(jQuery('.tsf-custom-blogname-js').css('display','none'),u=!1),V^u&&(k(),D())});jQuery('#visibility .save-post-visibility').on('click',function(){let V=jQuery('#visibility').find('input:radio:checked').val();switch(x=!1,v=!1,V){case'password':let G=jQuery('#visibility').find('#post_password').val();v=!!G&&!!G.length;break;case'private':x=!0;break;default:case'public':}T(),D()});jQuery('#tsf-title-separator :input').on('click',function(X){let V=jQuery(X.target).val(),G='';G='pipe'===V?'|':'dash'===V?'-':jQuery('<div/>').html('&'+V+';').text(),g=G,jQuery('.tsf-sep-js').text(' '+g+' '),k(),D()});const U=function(){let X=tsf.settingsChanged;P(),tsf.settingsChanged=X};jQuery('#autodescription-homepage-settings > button, #tsf-inpost-box > button').on('click',U),jQuery('#homepage-tab-general').on('tsf-tab-toggled',U),jQuery('#tsf-flex-inpost-tab-general').on('tsf-flex-tab-toggled',U);let B=0;jQuery(window).on('tsf-flex-resize',function(){clearTimeout(B),B=setTimeout(function(){U()},50)});jQuery('#tsf-home-title-location :input').on('click',function(){b(),k(),D()});tsf.states.isHome||jQuery('#edittag #name, #titlewrap #title').on('input',function(X){let V=X.target.value;V=V.trim(),f=V.length?V:tsf.params.untitledTitle,I(),j()});(function(){let X=0,V=window.innerWidth;window.addEventListener('resize',function(){clearTimeout(X),X=setTimeout(function(){let G=window.innerWidth;V<G?782>=V&&782<=G&&U():782<=V&&782>=G&&U(),V=G},50)})})()}}},_initUnboundTitleSettings:function(){if(tsf.hasInput){let t=jQuery('#autodescription_title, #autodescription-meta\\[doctitle\\], #autodescription-site-settings\\[homepage_title\\]');jQuery('#tsf-title-placeholder, #tsf-title-placeholder-prefix').on('click',function(d){let c=jQuery(d.target).siblings(t)[0];if('function'==typeof c.setSelectionRange){c.focus();let g=2*c.value.length;c.setSelectionRange(g,g)}else{let g=c.value;c.value='',c.focus(),c.value=g}});jQuery('#autodescription-site-settings\\[title_rem_additions\\]').on('click',function(d){jQuery(d.target).is(':checked')?jQuery('.tsf-title-additions-js').css('display','none'):jQuery('.tsf-title-additions-js').css('display','inline')});jQuery('#tsf-title-location input').on('click',function(d){let c=jQuery('.tsf-title-additions-example-left'),g=jQuery('.tsf-title-additions-example-right');'right'===jQuery(d.target).val()?(c.css('display','none'),g.css('display','inline')):(c.css('display','inline'),g.css('display','none'))});jQuery('#autodescription-site-settings\\[homepage_title\\]').on('input',function(d){let c=d.target.value||'',g=jQuery('.tsf-custom-title-js');0===c.length?g.text(tsf.params.objectTitle):g.text(c)});jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').on('input',function(d){let c=d.target.value||'',g=jQuery('.tsf-custom-tagline-js');0===c.length?(g.text(tsf.params.blogDescription),0===tsf.params.blogDescription.length?jQuery('#tsf-home-title-location .tsf-sep-js').hide():jQuery('#tsf-home-title-location .tsf-sep-js').show()):(g.text(c),jQuery('#tsf-home-title-location .tsf-sep-js').show())}),jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').trigger('input');jQuery('#title-prefixes-toggle :input').on('click',function(d){let c=jQuery(d.target),g=jQuery('.tsf-title-prefix-example');c.is(':checked')?g.css('display','none'):g.css('display','inline')})}},_initDescInputs:function(){if(tsf.hasInput){let t=jQuery('#autodescription_description, #autodescription-meta\\[description\\], #autodescription-site-settings\\[homepage_description\\]');if(t.length){let s=tsf.params.descriptionSeparator;jQuery('#tsf-description-separator input').on('click',function(g){let f=jQuery(g.target).val(),u='';u='pipe'===f?'|':'dash'===f?'-':jQuery('<div/>').html('&'+f+';').text(),s=u,jQuery('#autodescription-descsep-js').text(' '+s+' '),c()});const o=function(g){let f=document.getElementById(g.target.id+'_chars');if(f){let u=0,y=g.target,x='',v=tsf.counterType,b='',k='';u=1>y.value.length?tsf.getStringLength(y.placeholder):tsf.getStringLength(y.value),100>u||175<=u?(x+='tsf-count-bad',b=tsf.i18n.bad):137>u||155<u?(x+='tsf-count-okay',b=tsf.i18n.okay):(x+='tsf-count-good',b=tsf.i18n.good),v&&1!=v?2==v?k=b:3==v&&(k=u.toString()+' - '+b):k=u.toString(),f.innerHTML=k,tsf.additionsClass&&(x+=' '+tsf.additionsClass),f.className!==x&&(f.className=x)}},n=function(g){let f=document.getElementById(g.target.id+'_pixels');if(f){let u='';u=1>g.target.value.length?g.target.placeholder:g.target.value;let y={e:f,text:u,guideline:tsf.params.descPixelGuideline};tsf.updatePixelCounter(y)}};t.on('input.tsfUpdateDescriptions',function(g){o(g),n(g)});const l=function(){t.trigger('input.tsfUpdateDescriptions')};l();let d=0;const c=function(){clearTimeout(d),d=setTimeout(function(){l()},50)};jQuery(window).on('tsf-counter-updated',c)}}},_initCounters:function(){if(tsf.hasInput){jQuery('.tsf-counter').on('click',function(){++tsf.counterType,3<tsf.counterType&&(tsf.counterType=0),s();let r='.tsf-counter-wrap .tsf-ajax',l=0;tsf.resetAjaxLoader(r),tsf.setAjaxLoader(r);let d={method:'POST',url:ajaxurl,datatype:'json',data:{action:'the_seo_framework_update_counter',nonce:tsf.nonces.edit_posts,val:tsf.counterType},async:!0,success:function(c){switch(c=jQuery.parseJSON(c),'success'===c.type&&(l=1),l){case 0:tsf.unsetAjaxLoader(r,!1);break;case 1:tsf.unsetAjaxLoader(r,!0);break;default:tsf.resetAjaxLoader(r);}}};jQuery.ajax(d)});const s=function(){let n=tsf.counterType;1==n?(tsf.additionsClass='tsf-counter-one',tsf.counterType=1):2==n?(tsf.additionsClass='tsf-counter-two',tsf.counterType=2):3==n?(tsf.additionsClass='tsf-counter-three',tsf.counterType=3):(tsf.additionsClass='tsf-counter-zero',tsf.counterType=0),tsf._triggerCounterUpdate()};s();jQuery('#autodescription-site-settings\\[display_character_counter\\]').on('click',function(n){jQuery(n.target).is(':checked')?jQuery('.tsf-counter-wrap').show():jQuery('.tsf-counter-wrap').hide()});jQuery('#autodescription-site-settings\\[display_pixel_counter\\]').on('click',function(n){jQuery(n.target).is(':checked')?(jQuery('.tsf-pixel-counter-wrap').show(),tsf._triggerCounterUpdate()):jQuery('.tsf-pixel-counter-wrap').hide()})}},_initPrimaryTerm:function(){if(tsf.hasInput&&Object.keys(tsf.states.taxonomies).length){let t=tsf.states.taxonomies,s=wp.template('tsf-primary-term-selector'),a=wp.template('tsf-primary-term-selector-help'),o=document.createElement('span');o.classList.add('tsf-primary-term-selector'),o.classList.add('tsf-set-primary-term'),function(){let O=document.createElement('input');O.setAttribute('type','radio'),o.appendChild(O)}();let n={},r={},l={},d={},c={};const g=function(O){let U=jQuery('#'+O+'div'),B=s({taxonomy:t[O]});U.append(B)},f=function(O){let U=jQuery('#taxonomy-'+O),B=a({taxonomy:t[O]});U.append(B),u(O)},u=function(O){let U=document.getElementById('taxonomy-'+O),B=U.querySelectorAll('.tabs-panel'),q=Array.prototype.slice.call(B).filter(function(N){return 0<N.offsetWidth||0<N.offsetHeight||0<N.getClientRects().length})[0],F=q.scrollHeight>q.clientHeight?q.offsetWidth-q.clientWidth+25-2:25;tsf.states.isRTL?U.querySelector('.tsf-primary-term-selector-help-wrap').style.left=F+'px':U.querySelector('.tsf-primary-term-selector-help-wrap').style.right=F+'px'},y=function(O){u(O.data.taxonomy)},x=function(O){let U=o.cloneNode(!0);return U.setAttribute('title',t[O].i18n.makePrimary),U.setAttribute('aria-label',t[O].i18n.makePrimary),U},v=function(O,U){let B=document.getElementById('autodescription[_primary_term_'+O+']');B&&B instanceof Element&&(B.value=U)},b=function(O,U){return!U&&d[O]?d[O]:(d[O]=jQuery('#'+O+'checklist, #'+O+'checklist-pop'),d[O])},k=function(O,U){return n[O].filter('[value="'+U+'"]')},T=function(O,U){let B=k(O,U).closest('label');B.length?(B.addClass('tsf-is-primary-term'),B.find('.tsf-set-primary-term').each(function(q,F){F.setAttribute('title',t[O].i18n.primary),F.setAttribute('aria-label',t[O].i18n.primary),F.querySelector('input').checked=!0}),v(O,U),c[O]=U):I(O)},C=function(O){let U=b(O).find('label');U.removeClass('tsf-is-primary-term'),U.find('.tsf-set-primary-term').each(function(B,q){q.setAttribute('title',t[O].i18n.makePrimary),q.setAttribute('aria-label',t[O].i18n.makePrimary),q.querySelector('input').checked=!1}),v(O,'')},I=function(O){let B,U=l[O].first();U.length&&(B=U.val()||'',T(O,B),c[O]=B)},S=function(O){let U=O.data.taxonomy,B=jQuery(O.target).closest('label').find('input[type=checkbox]').val();return C(U),T(U,B),!1},L=function(O){let U=O.data.taxonomy;switch(O.target.checked?(j(U,O.target),W(U,O.target)):(P(U,O.target),E(U,O.target)),l[U].length){case 0:v(U,'');break;case 1:I(U);}},W=function(O,U){let B;k(O,U.value).each(function(q,F){B=jQuery(F).closest('label'),B.find('.tsf-primary-term-selector').length||B.append(x(O))})},E=function(O,U){let B,q;k(O,U.value).each(function(F,N){B=jQuery(N).closest('label'),q=B.hasClass('tsf-is-primary-term'),B.removeClass('tsf-is-primary-term'),B.find('.tsf-primary-term-selector').remove(),q&&I(O)})},j=function(O,U){r[O]=r[O].add('[value="'+U.value+'"]'),l[O]=l[O].add(U)},P=function(O,U){r[O]=r[O].not('[value="'+U.value+'"]'),l[O]=l[O].not('[value="'+U.value+'"]')},R=function(O){let U=b(O,1);n[O]=U.find('input[type=checkbox]'),r[O]=U.find('input[type=checkbox]:checked');let q,B={};l[O]=r[O],l[O].each(function(F,N){q=jQuery(N).val(),B[q]?l[O].splice(F,1):B[q]=!0})},A=function(O,U,B){B.hasOwnProperty('settings')&&B.settings.hasOwnProperty('what')&&(R(B.settings.what),D(B.settings.what),H(B.settings.what),u(B.settings.what))},D=function(O){let U='tsfShowPrimary'+O,B={taxonomy:O},q=b(O),F=jQuery('#'+O+'div'),N=jQuery('#'+O+'-tabs');q.off('click.'+U),q.on('click.'+U,'input[type="checkbox"]',B,L),q.on('click.'+U,'.tsf-primary-term-selector',B,S),F.off('wpListAddEnd.'+U),F.on('wpListAddEnd.'+U,'#'+O+'checklist',A),N.off('click.'+U),N.on('click.'+U,'a',B,y)},H=function(O){b(O).find('input[type="checkbox"]:checked').each(function(U,B){W(O,B)}),t[O].primary?T(O,t[O].primary):I(O)};(function(){for(let O in t)b(O).length&&(g(O),f(O),R(O),D(O),H(O))})()}},_initToolTips:function(){let t=0,s=!1;const a=function(){s=!0,clearTimeout(t),t=setTimeout(function(){s=!1},250)},o=function(y,x){x=x||!1;let v='pointerdown.tsfTT touchstart.tsfTT click.tsfTT',b=jQuery(y);x?(b.off('mousemove mouseleave mouseout tsf-tooltip-update'),jQuery(document.body).off(v)):(b.on({mousemove:d,mouseleave:c,mouseout:c}),jQuery(document.body).off(v).on(v,g)),b.on('tsf-tooltip-update',r)},n=function(y){o(y,!0)},r=function(y){if(y.target.classList.contains('tsf-tooltip-item')){let x=y.target.querySelector('.tsf-tooltip-text');x instanceof Element&&(x.innerHTML=y.target.dataset.desc)}},l=function(y){let x=jQuery(y.target),v=y.target.dataset.desc;if(v&&0===x.find('div').length){y.target.title='';let b=jQuery('<div class="tsf-tooltip"><span class="tsf-tooltip-text-wrap"><span class="tsf-tooltip-text">'+v+'</span></span><div class="tsf-tooltip-arrow"></div></div>');x.append(b);let k=x.closest('.tsf-tooltip-boundary');k=k.length&&k||jQuery(document.body);let T=x.outerHeight()+9,C=b.offset().top-T,I=k.offset().top-(k.prop('scrolltop')||0);I>C?(b.addClass('tsf-tooltip-down'),b.css('top',T+'px')):b.css('bottom',T+'px');let S=x.closest('.tsf-tooltip-wrap'),L=b.find('.tsf-tooltip-text-wrap'),W=L.find('.tsf-tooltip-text'),E=S.width(),j=L.outerWidth(!0),P=W.outerWidth(!0),R=L.offset().left,A=R+P,D=k.offset().left-(k.prop('scrollLeft')||0),H=D+k.outerWidth(),z='left';if(R<D){let O=D-R+12,U=parseInt(L.css('flex-basis'),10);O<-U&&(O=-U),b.css(z,O+'px'),b.data('overflow',O),b.data('overflowDir',z)}else if(A>H){let O=H-A-E-12,U=parseInt(L.css('flex-basis'),10);O<-U&&(O=-U),b.css(z,O+'px'),b.data('overflow',O),b.data('overflowDir',z)}else if(42>E){let O=-15;b.css(z,O+'px'),b.data('overflow',O),b.data('overflowDir',z)}else if(E>j){let O=y.originalEvent&&y.originalEvent.pageX||y.pageX,U=S.offset().left,q=O-U-j/2,F=q+j;0>q?q=0:F>E&&(q=E-P),b.css(z,q+'px'),b.data('adjust',q),b.data('adjustDir',z)}}},d=function(y){let x=jQuery(y.target),v=x.find('.tsf-tooltip'),b=v.find('.tsf-tooltip-arrow'),k=v.data('overflow'),T=v.data('overflowDir');if(k=parseInt(k,10),k=isNaN(k)?0:-Math.round(k),k)b.css(T,k+'px');else{let C=y.originalEvent&&y.originalEvent.pageX||y.pageX,I=7,S=16,L=x.closest('.tsf-tooltip-wrap'),W=C-L.offset().left-S/2,j=v.find('.tsf-tooltip-text-wrap'),P=j.outerWidth(!0),R=v.data('adjust'),A=v.data('adjustDir'),D=P-S-I;if(R=parseInt(R,10),R=isNaN(R)?0:Math.round(R),R&&(R='left'===A?-R:R,W+=R,D-R>L.outerWidth(!0))){let H=j.find('.tsf-tooltip-text'),z=H.outerWidth(!0);D=z-S-I}W<=I?b.css('left',I+'px'):W>=D?b.css('left',D+'px'):b.css('left',W+'px')}},c=function(y){s||(jQuery(y.target).find('.tsf-tooltip').remove(),n(y.target))},g=function(y){a();let k,v='.tsf-tooltip',b=jQuery(y.target);if(b.hasClass('tsf-tooltip-item')&&(k=b.find(v)),!k){let T=b.children('.tsf-tooltip-item');T.length&&(k=T.find(v))}k&&k.length?jQuery(v).not(k).remove():jQuery(v).remove()},f=function(y){if(!s){let x=!1;switch(y.type){case'mouseenter':break;case'pointerdown':case'touchstart':x=!0;break;default:}if(y.target.classList.contains('tsf-tooltip-item'))x&&g(y),l(y),d(y),o(y.target);else{let v=y.target.querySelector('.tsf-tooltip-item:hover'),b=new jQuery.Event(y.type);b.pageX=y.originalEvent&&y.originalEvent.pageX||y.pageX,v?(tsfL10n.states.debug&&console.log('Tooltip event warning: delegation'),jQuery(v).trigger(b)):(tsfL10n.states.debug&&console.log('Tooltip event warning: bubbling'),jQuery(y.target).closest('.tsf-tooltip-wrap').find('.tsf-tooltip-item:hover').trigger(b))}y.stopPropagation()}},u=function(){let y=jQuery('.tsf-tooltip-wrap');y.off('mouseenter pointerdown touchstart'),y.on('mouseenter pointerdown touchstart','.tsf-tooltip-item',f)};u(),jQuery(window).on('tsf-reset-tooltips',u),function(){let y=jQuery('#wpcontent');tsf.addTooltipBoundary(y)}()},addTooltipBoundary:function(t){jQuery(t).addClass('tsf-tooltip-boundary')},tabToggle:function(t){let s=jQuery(t.target);if(s.is(':checked')){let a=s.prop('id'),o=s.prop('name');if('undefined'!=typeof o){let n='tsf-active-tab-content',r=jQuery('#'+a+'-content'),l=jQuery('.'+n);if(!r.is(l)&&'undefined'!=typeof r){let d=jQuery('.'+o+'-content');d.fadeOut(150,function(){jQuery(this).removeClass(n)}),setTimeout(function(){r.addClass(n).fadeIn(250)},150),setTimeout(function(){jQuery('#'+a).trigger('tsf-tab-toggled')},175)}}}},flexTabToggle:function(t){let s=jQuery(t.target);if(s.is(':checked')){let a=s.prop('id'),o=s.prop('name');if('undefined'!=typeof o){let n='tsf-flex-tab-content-active',r=jQuery('#'+a+'-content'),l=jQuery('.'+n);if(!r.is(l)&&'undefined'!=typeof r){let d=jQuery('.'+o+'-content');d.fadeOut(150,function(){jQuery(this).removeClass(n)}),setTimeout(function(){r.addClass(n).fadeIn(250)},150),setTimeout(function(){jQuery('#'+a).trigger('tsf-flex-tab-toggled')},175)}}}},setTabsOnload:function(){if(tsf.hasInput)if(tsf.states.isSettingsPage){let t=jQuery('.tsf-nav-tab-wrapper .tsf-tab:nth-of-type(n+2) input:checked');t.length&&t.each(function(){let a=jQuery(this),o=a.prop('id'),n=a.prop('name');if('undefined'!=typeof n){let r='tsf-active-tab-content',l=jQuery('#'+o+'-content');if('undefined'!=typeof l){let d=jQuery('.'+n+'-content');d.removeClass(r),l.addClass(r),setTimeout(function(){jQuery('#'+o).trigger('tsf-tab-toggled')},20)}}})}else;},taglineToggleDesc:function(t){let s=jQuery(t.target),a=jQuery('#tsf-on-blogname-js');s.is(':checked')?a.css('display','inline'):a.css('display','none')},additionsToggleDesc:function(t){let s=jQuery(t.target),a=jQuery('#tsf-description-additions-js');s.is(':checked')?a.css('display','inline'):a.css('display','none')},taglineToggleOnload:function(){if(tsf.hasInput){let t=jQuery('#tsf-title-tagline-toggle :input'),s=jQuery('.tsf-custom-blogname-js'),a=jQuery('#tsf-description-additions-toggle :input'),o=jQuery('#tsf-description-additions-js'),n=jQuery('#tsf-description-onblogname-toggle :input'),r=jQuery('#tsf-on-blogname-js'),l=jQuery('#tsf-title-additions-toggle :input'),d=jQuery('.tsf-title-additions-js');t.is(':checked')?s.css('display','inline'):s.css('display','none'),a.is(':checked')?o.css('display','inline'):o.css('display','none'),n.is(':checked')?r.css('display','inline'):r.css('display','none'),l.is(':checked')?d.css('display','none'):d.css('display','inline')}},attachUnsavedChangesListener:function(){if(tsf.hasInput){let t=function(o){tsf.settingsChanged||tsf.registerChange(),jQuery(s).not(a).off(o.type,t)},s='.tsf-metaboxes :input, #tsf-inpost-box .inside :input',a='.tsf-tab :input, .tsf-flex-nav-tab :input';jQuery(s).not(a).on('change',t),s='.tsf-metaboxes input[type=text], .tsf-metaboxes textarea, #tsf-inpost-box .inside input[type=text], #tsf-inpost-box .inside textarea',a='.tsf-nav-tab-wrapper input, .tsf-flex-nav-tab-wrapper input',jQuery(s).not(a).on('input',t),window.onbeforeunload=function(){if(tsf.settingsChanged)return tsf.i18n.saveAlert},jQuery('.tsf-metaboxes input[type="submit"], #publishing-action input[type="submit"], #save-action input[type="submit"], a.submitdelete').click(function(){window.onbeforeunload=null})}},registerChange:function(){tsf.settingsChanged=!0},confirmedReset:function(){return confirm(tsf.i18n.confirmReset)},onLoadUnregisterChange:function(){tsf.settingsChanged=!1},dismissNotice:function(t){jQuery(t.target).parents('.tsf-notice').slideUp(200,function(){this.remove()})},setAjaxLoader:function(t){jQuery(t).toggleClass('tsf-loading')},unsetAjaxLoader:function(t,s){let a='tsf-success',o=2500;s||(a='tsf-error',o=5e3),jQuery(t).removeClass('tsf-loading').addClass(a).fadeOut(o)},resetAjaxLoader:function(t){jQuery(t).stop().empty().prop('class','tsf-ajax').css('opacity','1').removeProp('style')},openImageEditor:function(t){if(jQuery(t.target).prop('disabled')||'undefined'==typeof wp.media)return t.preventDefault(),void t.stopPropagation();let o,s=jQuery(t.target),a=s.data('inputid');if(o)return void o.open();t.preventDefault(),t.stopPropagation(),tsf.extendCropper();let n={suggestedWidth:s.data('width')||1200,suggestedHeight:s.data('height')||630,isFlex:'undefined'==typeof s.data('flex')?1:s.data('flex')};tsf.cropper.control={params:{flex_width:n.isFlex?4096:0,flex_height:n.isFlex?4096:0,width:n.suggestedWidth,height:n.suggestedHeight,isFlex:n.isFlex}},o=wp.media({button:{text:tsf.other[a].frame_button,close:!1},states:[new wp.media.controller.Library({title:tsf.other[a].frame_title,library:wp.media.query({type:'image'}),multiple:!1,date:!1,priority:20,suggestedWidth:n.suggestedWidth,suggestedHeight:n.suggestedHeight}),new tsf.cropper({imgSelectOptions:tsf.calculateImageSelectOptions})]});const r=function(){o.setState('cropper')};o.off('select',r),o.on('select',r);const l=function(g){let f=g.url,u=g.id,y=g.width,x=g.height;jQuery('#'+a+'-url').val(f),jQuery('#'+a+'-id').val(u)};o.off('cropped',l),o.on('cropped',l);const d=function(g){let f=g.get('url'),u=g.get('id'),y=g.get('width'),x=g.get('height');jQuery('#'+a+'-url').val(f),jQuery('#'+a+'-id').val(u)};o.off('skippedcrop',d),o.on('skippedcrop',d);const c=function(){jQuery('#'+a+'-select').text(tsf.other[a].change),jQuery('#'+a+'-url').prop('readonly',!0).css('opacity',0).animate({opacity:1},{queue:!0,duration:1000},'swing'),tsf.appendRemoveButton(s,a,!0),tsf.registerChange()};o.off('skippedcrop cropped',c),o.on('skippedcrop cropped',c),o.open()},appendRemoveButton:function(t,s,a){t&&s&&!jQuery('#'+s+'-remove').length&&(t.after('<a href="javascript:void(0)" id="'+s+'-remove" class="tsf-remove-social-image button button-small" data-inputid="'+s+'" title="'+tsf.other[s].remove_title+'">'+tsf.other[s].remove+'</a>'),a&&jQuery('#'+s+'-remove').css('opacity',0).animate({opacity:1},{queue:!0,duration:1000},'swing')),tsf.resetImageEditorActions()},removeEditorImage:function(t){let s=jQuery(t.target).data('inputid');if(!jQuery('#'+s+'-select').prop('disabled')){jQuery('#'+s+'-select').addClass('disabled').prop('disabled',!0),jQuery('#'+s+'-remove').addClass('disabled').prop('disabled',!0).fadeOut(500,function(){jQuery(this).remove(),jQuery('#'+s+'-select').text(tsf.other[s].select).removeClass('disabled').removeProp('disabled')});let a=jQuery('#'+s+'-url');a.val(''),a.data('readonly')||a.removeProp('readonly'),a.css('opacity',0).animate({opacity:1},{queue:!0,duration:500},'swing'),jQuery('#'+s+'-id').val(''),tsf.registerChange()}},extendCropper:function(){if('undefined'==typeof tsf.cropper.control){let t,a,s=wp.media.controller,o=wp.media.view;return a=o.Cropper.extend({className:'crop-content tsf-image',ready:function(){o.Cropper.prototype.ready.apply(this,arguments)},onImageLoad:function(){let r,n=this.controller.get('imgSelectOptions');'function'==typeof n&&(n=n(this.options.attachment,this.controller)),'undefined'==typeof n.aspectRatio&&(n=_.extend(n,{parent:this.$el,onInit:function(){this.parent.children().on('mousedown touchstart',function(l){l.shiftKey?r.setOptions({aspectRatio:'1:1'}):r.setOptions({aspectRatio:!1})})}})),this.trigger('image-loaded'),r=this.controller.imgSelect=this.$image.imgAreaSelect(n)}}),t=s.Cropper.extend({createCropContent:function(){this.cropperView=new a({controller:this,attachment:this.get('selection').first()}),this.cropperView.on('image-loaded',this.createCropToolbar,this),this.frame.content.set(this.cropperView)},doCrop:function(n){let r=n.get('cropDetails'),l=tsf.cropper.control;if(l.params.flex_width&&l.params.flex_height)if(r.width===r.height)r.width>l.params.flex_width&&(r.dst_width=r.dst_height=l.params.flex_width);else if(r.width>l.params.flex_width||r.height>l.params.flex_height)if(r.width>r.height){let d=r.width/l.params.flex_width;r.dst_width=l.params.flex_width,r.dst_height=Math.round(r.height/d)}else{let d=r.height/l.params.flex_height;r.dst_height=l.params.flex_height,r.dst_width=Math.round(r.width/d)}return'undefined'==typeof r.dst_width&&(r.dst_width=0,r.dst_height=0),wp.ajax.post('tsf-crop-image',{nonce:tsf.nonces.upload_files,id:n.get('id'),context:'tsf-image',cropDetails:r})}}),t.prototype.control={},void(tsf.cropper=t)}},calculateImageSelectOptions:function(t,s){let y,x,v,b,a=tsf.cropper.control,o=!!parseInt(a.params.flex_width,10),n=!!parseInt(a.params.flex_height,10),r=parseInt(a.params.width,10),l=parseInt(a.params.height,10),d=t.get('width'),c=t.get('height'),g=r/l,f=r,u=l;return b=a.params.isFlex?!tsf.mustBeCropped(a.params.flex_width,a.params.flex_height,d,c):g==d/c,s.set('control',a.params),s.set('canSkipCrop',b),d/c>g?(l=c,r=l*g):(r=d,l=r/g),y=(d-r)/2,x=(c-l)/2,v={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:d,imageHeight:c,minWidth:f>r?r:f,minHeight:u>l?l:u,x1:y,y1:x,x2:r+y,y2:l+x},a.params.isFlex?n||o?(n&&(v.minHeight=200,v.maxWidth=d),o&&(v.minWidth=200,v.maxHeight=c)):v.aspectRatio=r+':'+l:(v.handles='corners',v.aspectRatio=r+':'+l),v},mustBeCropped:function(t,s,a,o){return a<=t&&o<=s?!1:!0},resetImageEditorActions:function(){jQuery('.tsf-remove-social-image').off('click',tsf.removeEditorImage),jQuery('.tsf-remove-social-image').on('click',tsf.removeEditorImage)},setupImageEditorActions:function(){jQuery('.tsf-set-social-image').off('click',tsf.openImageEditor),jQuery('.tsf-remove-social-image').off('click',tsf.removeEditorImage),jQuery('.tsf-set-social-image').on('click',tsf.openImageEditor),jQuery('.tsf-remove-social-image').on('click',tsf.removeEditorImage)},checkImageEditorInput:function(){let t=jQuery('.tsf-set-social-image');if(t.length){let s='',a='';jQuery.each(t,function(o,n){s=jQuery(n).data('inputid'),a=jQuery('#'+s+'-id'),a.length&&0<a.val()&&(jQuery('#'+s+'-url').prop('readonly',!0),tsf.appendRemoveButton(jQuery(n),s,!1)),jQuery('#'+s+'-url').val()&&jQuery('#'+s+'-select').text(tsf.other[s].change)})}},setColorOnload:function(){let t=jQuery('.tsf-color-picker');t.length&&jQuery.each(t,function(s,a){let o=jQuery(a),n='',r=o.data('tsf-default-color');o.wpColorPicker({defaultColor:r,width:238,change:function(){n=o.wpColorPicker('color'),''==n&&(n=r),o.val(n),tsf.registerChange()},clear:function(){o.parent().siblings('.wp-color-result').css('backgroundColor',r),tsf.registerChange()},palettes:!1})})},_doFlexResizeListener:function(){if(jQuery('.tsf-flex').length){tsf._setResizeListeners();let t=0,s={},a=0,o=jQuery('.tsf-flex-nav-tab-wrapper'),n=jQuery(window);n.on('tsf-flex-resize',function(){clearTimeout(t);let r=0;t=setTimeout(function(){if(o.length){let l=jQuery('.tsf-flex-nav-tab-inner'),d=o.width(),c=l.width(),g=jQuery('.tsf-flex-nav-name');s.tabWrapper||(s.tabWrapper={},s.tabWrapper.outer=0,s.tabWrapper.inner=0,s.tabWrapper.shown=1),!s.tabWrapper.shown&&s.tabWrapper.outer<d&&(g.fadeIn(250),setTimeout(function(){c=l.width()},r)),setTimeout(function(){c>d?(g.hide(),s.tabWrapper.shown=0):s.tabWrapper.outer<d&&(g.fadeIn(250),s.tabWrapper.shown=1)},2*r),setTimeout(function(){s.tabWrapper.outer=d,s.tabWrapper.inner=c},3*r)}},a),r=10,a=75}),n.trigger('tsf-flex-resize')}},_setResizeListeners:function(){jQuery(window).on('resize orientationchange',tsf._triggerResize),jQuery('#collapse-menu').click(tsf._triggerResize),jQuery('.columns-prefs :input[type=radio]').change(tsf._triggerResize),jQuery('.meta-box-sortables').on('sortupdate',tsf._triggerResize)},_triggerTooltipReset:function(){jQuery(window).trigger('tsf-reset-tooltips')},_triggerTooltipUpdate:function(t){jQuery(t).trigger('tsf-tooltip-update')},_triggerResize:function(){jQuery(window).trigger('tsf-flex-resize')},_triggerCounterUpdate:function(){jQuery(window).trigger('tsf-counter-updated')},_triggerReady:function(){jQuery(document.body).trigger('tsf-ready')},_doReady:function(){tsf._initCounters(),tsf._initTitleInputs(),tsf._initUnboundTitleSettings(),tsf._initDescInputs(),tsf._initPrimaryTerm(),tsf.setTabsOnload(),tsf.taglineToggleOnload(),tsf._initToolTips(),tsf.setupImageEditorActions(),tsf.checkImageEditorInput(),tsf.setColorOnload(),tsf.attachUnsavedChangesListener(),tsf.onLoadUnregisterChange(),tsf._triggerReady(),tsf._doFlexResizeListener()},setupVars:function(){tsf.counterType=parseInt(tsf.states.counterType),tsf.hasInput=tsf.states.hasInput},ready:function(t){tsf.setupVars(),t('div.updated, div.error, div.notice-warning').insertAfter('div.tsf-top-wrap'),t(document.body).ready(tsf._doReady),t('.tsf-js-confirm-reset').on('click',tsf.confirmedReset),t('.tsf-tabs-radio').on('change',tsf.tabToggle),t('.tsf-flex-nav-tab-radio').on('change',tsf.flexTabToggle),t('#tsf-description-onblogname-toggle :input').on('click',tsf.taglineToggleDesc),t('#tsf-description-additions-toggle :input').on('click',tsf.additionsToggleDesc),t('.tsf-dismiss').on('click',tsf.dismissNotice)}},jQuery(tsf.ready);
|
1 |
+
'use strict';window.tsf={nonces:tsfL10n.nonces,i18n:tsfL10n.i18n,states:tsfL10n.states,params:tsfL10n.params,other:tsfL10n.other,settingsChanged:!1,counterType:0,hasInput:!1,additionsClass:'',cropper:{},confirm:function(t){return confirm(t)},escapeString:function(t){if(!t.length)return'';var s={'&':'&','<':'<','>':'>','"':'"','\'':'''};return t.replace(/[&<>"']/g,function(a){return s[a]})},getStringLength:function(t){let s,a=0;return t.length&&(s=document.createElement('span'),s.innerHTML=tsf.escapeString(t),a=s.childNodes[0].nodeValue.length),+a},updatePixelCounter:function(t){let s=t.e,a=t.text,o=t.guideline,n=s.parentElement;if(n){let r=n.querySelector('.tsf-pixel-counter-bar'),l=n.querySelector('.tsf-pixel-counter-shadow');if(r&&l){l.innerHTML=tsf.escapeString(a);let d=l.offsetWidth,c='',g='',f='tsf-pixel-counter-fit',u='tsf-pixel-counter-overflown';d>o?(g=100*(o/(d+2*(d-o)/3))+'%',c=u):(g=100*(d/o)+'%',c=f);let x,y=r.querySelector('.tsf-pixel-counter-fluid');x=tsf.i18n.pixelsUsed.replace(/%1\$d/g,d),x=x.replace(/%2\$d/g,o),r.classList.remove(f,u),r.classList.add(c),r.dataset.desc=x,r.setAttribute('aria-label',x),y.style.width=g,tsf._triggerTooltipUpdate(r)}}},_initTitleInputs:function(){if(tsf.hasInput){let t=jQuery('#autodescription_title, #autodescription-meta\\[doctitle\\], #autodescription-site-settings\\[homepage_title\\]');if(t.length){let o,n,r,d,s=!1,a=!!navigator.userAgent.match(/Trident\/7\./),l='',c='',g=tsf.params.titleSeparator,f=tsf.params.objectTitle,u=tsf.states.useTagline,y=tsf.states.isRTL,x=tsf.states.isPrivate,v=tsf.states.isPasswordProtected;o=y?'after':'before';const b=function(){let G='before';tsf.states.isSettingsPage?y?'right'===jQuery('#tsf-home-title-location input:checked').val()&&(G='after'):'left'===jQuery('#tsf-home-title-location input:checked').val()&&(G='after'):tsf.states.isHome?y?'right'===tsf.params.titleLocation&&(G='after'):'left'===tsf.params.titleLocation&&(G='after'):y?'left'===tsf.params.titleLocation&&(G='after'):'right'===tsf.params.titleLocation&&(G='after'),n=G};b();const k=function(){let G='';if(!tsf.states.isSettingsPage)tsf.states.isHome?u&&(G=tsf.params.titleAdditions):u&&(G=tsf.params.titleAdditions);else if(u){let J=document.getElementById('autodescription-site-settings[homepage_title_tagline]'),K=J?J.value:'';G=K.length?K:tsf.params.blogDescription}G.length&&(G=tsf.escapeString(G),'before'===n?G=G+' '+g+' ':'after'===n?G=' '+g+' '+G:void 0),c=G.length?G:'',d=document.getElementById('tsf-title-placeholder'),c.length&&d&&(d.innerHTML=c)};k();const C=function(){let G='';x?G=tsf.i18n.privateTitle:v&&(G=tsf.i18n.protectedTitle),G.length&&(G=tsf.escapeString(G),'before'===o?G+=' ':'after'===o?G=' '+G:void 0),l=G.length?G:'',l.length&&r&&(r.innerHTML=l),r=document.getElementById('tsf-title-placeholder-prefix'),l.length&&r&&(r.innerHTML=l)};C();const T=function(G){if(d||r){let J=jQuery(G.target),K=J.val(),Y=!!c.length,Z=!!l.length;if(!Y&&d&&(d.style.display='none'),!Z&&r&&(r.style.display='none'),!Y&&!Z)return void J.css('text-indent','initial');if(!K.length)return J.css('text-indent','initial'),d&&(d.style.display='none'),void(r&&(r.style.display='none'));let Q=J.outerWidth(!0),tt=(J.outerHeight(!0)-J.height())/2,et=(Q-J.innerWidth())/2,it=y?'right':'left',st=(J.outerWidth(!0)-J.width())/2,at={display:J.css('display'),lineHeight:J.css('lineHeight'),fontFamily:J.css('fontFamily'),fontWeight:J.css('fontWeight'),fontSize:J.css('fontSize'),letterSpacing:J.css('letterSpacing'),paddingTop:tt+'px',paddingBottom:tt+'px'},ot=jQuery(r),nt=jQuery(d),rt=0,lt=0,pt=0,dt=0,ct=0,gt=0;if(Z&&(ot.css(at),ot.css({maxWidth:'initial'}),ct=ot[0].getBoundingClientRect().width,ct<gt&&(ct=0)),Y){let ut=0;switch(function(){let ht=jQuery('#tsf-title-offset');ht.text(K),ht.css({fontFamily:at.fontFamily,fontWeight:at.fontWeight,letterSpacing:at.letterSpacing,fontSize:at.fontSize}),ut=ht[0].getBoundingClientRect().width}(),rt=J[0].getBoundingClientRect().width-et-st-ut-ct,rt<gt&&(ct+=rt,rt=0),nt.css(at),nt.css({maxWidth:'initial'}),n){case'before':let ht=nt[0].getBoundingClientRect().width;ht=rt<ht?rt:ht,ht<gt&&(ht=0),rt=ht,dt+=rt,pt+=rt,lt+=st;break;case'after':lt+=st+ut+ct;}}pt+=st,ct=0>ct?0:ct,dt+=ct;let ft;Z&&(ft={},ft[it]=pt+'px',ft.maxWidth=ct+'px',ot.css(ft)),Y&&(ft={},ft[it]=lt+'px',ft.maxWidth=rt+'px',nt.css(ft)),ft={},ft['text-indent']=dt+'px',J.css(ft)}},I=function(){let J='',K=!!c.length,Y=!!l.length,Z=c,Q=l;tsf.states.isTermEdit&&tsf.params.termName&&(Q=y?' :'+tsf.params.termName:tsf.params.termName+': ',Y=tsf.states.useTermPrefix),J=f,Y&&('before'===o?J=Q+J:'after'===o?J+=Q:void 0),K&&('before'===n?J=Z+J:'after'===n?J+=Z:void 0),a&&(s=!0);let tt=document.createElement('span');tt.innerHTML=J,t.prop('placeholder',tt.textContent),a&&setTimeout(function(){s=!1},0)},S=function(G){let J=document.getElementById(G.target.id+'_chars');if(J){let K=0,Y=G.target,Z='',Q=tsf.counterType,tt='',et='';K=1>Y.value.length?tsf.getStringLength(Y.placeholder):(l?tsf.getStringLength(l):0)+tsf.getStringLength(Y.value)+(c?tsf.getStringLength(c):0),25>K||75<=K?(Z+='tsf-count-bad',tt=tsf.i18n.bad):42>K||55<K?(Z+='tsf-count-okay',tt=tsf.i18n.okay):(Z+='tsf-count-good',tt=tsf.i18n.good),Q&&1!=Q?2==Q?et=tt:3==Q&&(et=K.toString()+' - '+tt):et=K.toString(),J.innerHTML=et,tsf.additionsClass&&(Z+=' '+tsf.additionsClass),J.className!==Z&&(J.className=Z)}},L=function(G){let J=document.getElementById(G.target.id+'_pixels');if(J){let K='';1>G.target.value.length?K=G.target.placeholder:(K=G.target.value,l.length&&('before'===o?K=l+K:'after'===o?K+=l:void 0),c.length&&('before'===n?K=c+K:'after'===n?K+=c:void 0));let Y={e:J,text:K,guideline:tsf.params.titlePixelGuideline};tsf.updatePixelCounter(Y)}};t.on('input.tsfUpdateTitles',function(G){return!s&&void(T(G),I(),S(G),L(G))});t.on('tsf-update-title-counter',function(G){S(G),L(G)});const j=function(){t.trigger('tsf-update-title-counter')},R=function(){t.trigger('input.tsfUpdateTitles')};R();const P=function(){k(),R()};jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').on('input',P),jQuery('#autodescription-site-settings\\[homepage_tagline\\]').on('change',P);let H=0;const A=function(){clearTimeout(H),H=setTimeout(function(){R()},50)};jQuery(window).on('tsf-counter-updated',A);jQuery('#tsf-title-tagline-toggle :input').on('click',function(G){let J=u;jQuery(G.target).is(':checked')?(jQuery('.tsf-custom-blogname-js').css('display','inline'),u=!0):(jQuery('.tsf-custom-blogname-js').css('display','none'),u=!1),J^u&&(k(),A())});jQuery('#visibility .save-post-visibility').on('click',function(){let J=jQuery('#visibility').find('input:radio:checked').val();switch(x=!1,v=!1,J){case'password':let K=jQuery('#visibility').find('#post_password').val();v=!!K&&!!K.length;break;case'private':x=!0;break;default:case'public':}C(),A()});jQuery('#tsf-title-separator :input').on('click',function(G){let J=jQuery(G.target).val(),K='';K='pipe'===J?'|':'dash'===J?'-':jQuery('<div/>').html('&'+J+';').text(),g=K,jQuery('.tsf-sep-js').text(' '+g+' '),k(),A()});const z=function(){let G=tsf.settingsChanged;R(!0),tsf.settingsChanged=G};jQuery('#homepage-tab-general').on('tsf-tab-toggled',z),jQuery('#tsf-flex-inpost-tab-general').on('tsf-flex-tab-toggled',z);let U=0;const q=function(){clearTimeout(U),U=setTimeout(function(){z()},50)};jQuery(window).one('tsf-ready',function(){jQuery(window).on('tsf-flex-resize',q)});let F=['autodescription-homepage-settings','tsf-inpost-box'];jQuery(document).on('postbox-toggled',function(G,J){if(0<=F.indexOf(J.id)){let K=J.querySelector('.inside');0<K.offsetHeight&&0<K.offsetWidth&&z()}});jQuery('#tsf-home-title-location :input').on('click',function(){b(),k(),A()});tsf.states.isHome||jQuery('#edittag #name, #titlewrap #title').on('input',function(G){let J=G.target.value;J=J.trim(),f=J.length?J:tsf.params.untitledTitle,I(),j()});(function(){let G=0,J=window.innerWidth;window.addEventListener('resize',function(){clearTimeout(G),G=setTimeout(function(){let K=window.innerWidth;J<K?782>=J&&782<=K&&z():782<=J&&782>=K&&z(),J=K},50)})})()}}},_initUnboundTitleSettings:function(){if(tsf.hasInput){let t=jQuery('#autodescription_title, #autodescription-meta\\[doctitle\\], #autodescription-site-settings\\[homepage_title\\]');jQuery('#tsf-title-placeholder, #tsf-title-placeholder-prefix').on('click',function(d){let c=jQuery(d.target).siblings(t)[0];if('function'==typeof c.setSelectionRange){c.focus();let g=2*c.value.length;c.setSelectionRange(g,g)}else{let g=c.value;c.value='',c.focus(),c.value=g}});jQuery('#autodescription-site-settings\\[title_rem_additions\\]').on('click',function(d){jQuery(d.target).is(':checked')?jQuery('.tsf-title-additions-js').css('display','none'):jQuery('.tsf-title-additions-js').css('display','inline')});jQuery('#tsf-title-location input').on('click',function(d){let c=jQuery('.tsf-title-additions-example-left'),g=jQuery('.tsf-title-additions-example-right');'right'===jQuery(d.target).val()?(c.css('display','none'),g.css('display','inline')):(c.css('display','inline'),g.css('display','none'))});jQuery('#autodescription-site-settings\\[homepage_title\\]').on('input',function(d){let c=d.target.value||'',g=jQuery('.tsf-custom-title-js');0===c.length?g.text(tsf.params.objectTitle):g.text(c)});jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').on('input.tsfInputTagline',function(d){let c=d.target.value||'',g=jQuery('.tsf-custom-tagline-js');0===c.length?(g.text(tsf.params.blogDescription),0===tsf.params.blogDescription.length?jQuery('#tsf-home-title-location .tsf-sep-js').hide():jQuery('#tsf-home-title-location .tsf-sep-js').show()):(g.text(c),jQuery('#tsf-home-title-location .tsf-sep-js').show())}),jQuery('#autodescription-site-settings\\[homepage_title_tagline\\]').trigger('input.tsfInputTagline');jQuery('#title-prefixes-toggle :input').on('click',function(d){let c=jQuery(d.target),g=jQuery('.tsf-title-prefix-example');c.is(':checked')?g.css('display','none'):g.css('display','inline')})}},_initDescInputs:function(){if(tsf.hasInput){let t=jQuery('#autodescription_description, #autodescription-meta\\[description\\], #autodescription-site-settings\\[homepage_description\\]');if(t.length){let s=tsf.params.descriptionSeparator;jQuery('#tsf-description-separator input').on('click',function(y){let x=jQuery(y.target).val(),v='';v='pipe'===x?'|':'dash'===x?'-':jQuery('<div/>').html('&'+x+';').text(),s=v,jQuery('#autodescription-descsep-js').text(' '+s+' '),c()});const o=function(y){let x=document.getElementById(y.target.id+'_chars');if(x){let v=0,b=y.target,k='',C=tsf.counterType,T='',I='';v=1>b.value.length?tsf.getStringLength(b.placeholder):tsf.getStringLength(b.value),100>v||175<=v?(k+='tsf-count-bad',T=tsf.i18n.bad):137>v||155<v?(k+='tsf-count-okay',T=tsf.i18n.okay):(k+='tsf-count-good',T=tsf.i18n.good),C&&1!=C?2==C?I=T:3==C&&(I=v.toString()+' - '+T):I=v.toString(),x.innerHTML=I,tsf.additionsClass&&(k+=' '+tsf.additionsClass),x.className!==k&&(x.className=k)}},n=function(y){let x=document.getElementById(y.target.id+'_pixels');if(x){let v='';v=1>y.target.value.length?y.target.placeholder:y.target.value;let b={e:x,text:v,guideline:tsf.params.descPixelGuideline};tsf.updatePixelCounter(b)}};t.on('input.tsfUpdateDescriptions',function(y){o(y),n(y)});const l=function(){t.trigger('input.tsfUpdateDescriptions')};l();let d=0;const c=function(){clearTimeout(d),d=setTimeout(function(){l()},50)};jQuery(window).on('tsf-counter-updated',c);let f=['autodescription-homepage-settings','tsf-inpost-box'];jQuery(document).on('postbox-toggled',function(y,x){if(0<=f.indexOf(x.id)){let v=x.querySelector('.inside');0<v.offsetHeight&&0<v.offsetWidth&&c()}})}}},_initCounters:function(){if(tsf.hasInput){jQuery('.tsf-counter').on('click',function(){++tsf.counterType,3<tsf.counterType&&(tsf.counterType=0),s();let r='.tsf-counter-wrap .tsf-ajax',l=0;tsf.resetAjaxLoader(r),tsf.setAjaxLoader(r);let d={method:'POST',url:ajaxurl,datatype:'json',data:{action:'the_seo_framework_update_counter',nonce:tsf.nonces.edit_posts,val:tsf.counterType},async:!0,success:function(c){switch(c=jQuery.parseJSON(c),'success'===c.type&&(l=1),l){case 0:tsf.unsetAjaxLoader(r,!1);break;case 1:tsf.unsetAjaxLoader(r,!0);break;default:tsf.resetAjaxLoader(r);}}};jQuery.ajax(d)});const s=function(){let n=tsf.counterType;1==n?(tsf.additionsClass='tsf-counter-one',tsf.counterType=1):2==n?(tsf.additionsClass='tsf-counter-two',tsf.counterType=2):3==n?(tsf.additionsClass='tsf-counter-three',tsf.counterType=3):(tsf.additionsClass='tsf-counter-zero',tsf.counterType=0),tsf._triggerCounterUpdate()};s();jQuery('#autodescription-site-settings\\[display_character_counter\\]').on('click',function(n){jQuery(n.target).is(':checked')?jQuery('.tsf-counter-wrap').show():jQuery('.tsf-counter-wrap').hide()});jQuery('#autodescription-site-settings\\[display_pixel_counter\\]').on('click',function(n){jQuery(n.target).is(':checked')?(jQuery('.tsf-pixel-counter-wrap').show(),tsf._triggerCounterUpdate()):jQuery('.tsf-pixel-counter-wrap').hide()})}},_initPrimaryTerm:function(){if(tsf.hasInput&&Object.keys(tsf.states.taxonomies).length){let t=tsf.states.taxonomies,s=wp.template('tsf-primary-term-selector'),a=wp.template('tsf-primary-term-selector-help'),o=document.createElement('span');o.classList.add('tsf-primary-term-selector'),o.classList.add('tsf-set-primary-term'),function(){let B=document.createElement('input');B.setAttribute('type','radio'),o.appendChild(B)}();let n={},r={},l={},d={},c={};const g=function(B){let z=jQuery('#'+B+'div'),U=s({taxonomy:t[B]});z.append(U)},f=function(B){let z=jQuery('#taxonomy-'+B),U=a({taxonomy:t[B]});z.append(U),u(B)},u=function(B){let z=document.getElementById('taxonomy-'+B),U=z.querySelectorAll('.tabs-panel'),q=Array.prototype.slice.call(U).filter(function(N){return 0<N.offsetWidth||0<N.offsetHeight||0<N.getClientRects().length})[0],F=q.scrollHeight>q.clientHeight?q.offsetWidth-q.clientWidth+25-2:25;tsf.states.isRTL?z.querySelector('.tsf-primary-term-selector-help-wrap').style.left=F+'px':z.querySelector('.tsf-primary-term-selector-help-wrap').style.right=F+'px'},y=function(B){u(B.data.taxonomy)},x=function(B){let z=o.cloneNode(!0);return z.setAttribute('title',t[B].i18n.makePrimary),z.setAttribute('aria-label',t[B].i18n.makePrimary),z},v=function(B,z){let U=document.getElementById('autodescription[_primary_term_'+B+']');U&&U instanceof Element&&(U.value=z)},b=function(B,z){return!z&&d[B]?d[B]:(d[B]=jQuery('#'+B+'checklist, #'+B+'checklist-pop'),d[B])},k=function(B,z){return n[B].filter('[value="'+z+'"]')},C=function(B,z){let U=k(B,z).closest('label');U.length?(U.addClass('tsf-is-primary-term'),U.find('.tsf-set-primary-term').each(function(q,F){F.setAttribute('title',t[B].i18n.primary),F.setAttribute('aria-label',t[B].i18n.primary),F.querySelector('input').checked=!0}),v(B,z),c[B]=z):I(B)},T=function(B){let z=b(B).find('label');z.removeClass('tsf-is-primary-term'),z.find('.tsf-set-primary-term').each(function(U,q){q.setAttribute('title',t[B].i18n.makePrimary),q.setAttribute('aria-label',t[B].i18n.makePrimary),q.querySelector('input').checked=!1}),v(B,'')},I=function(B){let U,z=l[B].first();z.length&&(U=z.val()||'',C(B,U),c[B]=U)},S=function(B){let z=B.data.taxonomy,U=jQuery(B.target).closest('label').find('input[type=checkbox]').val();return T(z),C(z,U),!1},L=function(B){let z=B.data.taxonomy;switch(B.target.checked?(j(z,B.target),W(z,B.target)):(R(z,B.target),E(z,B.target)),l[z].length){case 0:v(z,'');break;case 1:I(z);}},W=function(B,z){let U;k(B,z.value).each(function(q,F){U=jQuery(F).closest('label'),U.find('.tsf-primary-term-selector').length||U.append(x(B))})},E=function(B,z){let U,q;k(B,z.value).each(function(F,N){U=jQuery(N).closest('label'),q=U.hasClass('tsf-is-primary-term'),U.removeClass('tsf-is-primary-term'),U.find('.tsf-primary-term-selector').remove(),q&&I(B)})},j=function(B,z){r[B]=r[B].add('[value="'+z.value+'"]'),l[B]=l[B].add(z)},R=function(B,z){r[B]=r[B].not('[value="'+z.value+'"]'),l[B]=l[B].not('[value="'+z.value+'"]')},P=function(B){let z=b(B,1);n[B]=z.find('input[type=checkbox]'),r[B]=z.find('input[type=checkbox]:checked');let q,U={};l[B]=r[B],l[B].each(function(F,N){q=jQuery(N).val(),U[q]?l[B].splice(F,1):U[q]=!0})},H=function(B,z,U){U.hasOwnProperty('settings')&&U.settings.hasOwnProperty('what')&&(P(U.settings.what),A(U.settings.what),D(U.settings.what),u(U.settings.what))},A=function(B){let z='tsfShowPrimary'+B,U={taxonomy:B},q=b(B),F=jQuery('#'+B+'div'),N=jQuery('#'+B+'-tabs');q.off('click.'+z),q.on('click.'+z,'input[type="checkbox"]',U,L),q.on('click.'+z,'.tsf-primary-term-selector',U,S),F.off('wpListAddEnd.'+z),F.on('wpListAddEnd.'+z,'#'+B+'checklist',H),N.off('click.'+z),N.on('click.'+z,'a',U,y)},D=function(B){b(B).find('input[type="checkbox"]:checked').each(function(z,U){W(B,U)}),t[B].primary?C(B,t[B].primary):I(B)};(function(){for(let B in t)b(B).length&&(g(B),f(B),P(B),A(B),D(B))})()}},_initToolTips:function(){let t=0,s=!1;const a=function(){s=!0,clearTimeout(t),t=setTimeout(function(){s=!1},250)},o=function(y,x){x=x||!1;let v='pointerdown.tsfTT touchstart.tsfTT click.tsfTT',b=jQuery(y);x?(b.off('mousemove mouseleave mouseout tsf-tooltip-update'),jQuery(document.body).off(v)):(b.on({mousemove:d,mouseleave:c,mouseout:c}),jQuery(document.body).off(v).on(v,g)),b.on('tsf-tooltip-update',r)},n=function(y){o(y,!0)},r=function(y){if(y.target.classList.contains('tsf-tooltip-item')){let x=y.target.querySelector('.tsf-tooltip-text');x instanceof Element&&(x.innerHTML=y.target.dataset.desc)}},l=function(y){let x=jQuery(y.target),v=y.target.dataset.desc;if(v&&0===x.find('div').length){y.target.title='';let b=jQuery('<div class="tsf-tooltip"><span class="tsf-tooltip-text-wrap"><span class="tsf-tooltip-text">'+v+'</span></span><div class="tsf-tooltip-arrow"></div></div>');x.append(b);let k=x.closest('.tsf-tooltip-boundary');k=k.length&&k||jQuery(document.body);let C=x.outerHeight()+9,T=b.offset().top-C,I=k.offset().top-(k.prop('scrolltop')||0);I>T?(b.addClass('tsf-tooltip-down'),b.css('top',C+'px')):b.css('bottom',C+'px');let S=x.closest('.tsf-tooltip-wrap'),L=b.find('.tsf-tooltip-text-wrap'),W=L.find('.tsf-tooltip-text'),E=S.width(),j=L.outerWidth(!0),R=W.outerWidth(!0),P=L.offset().left,H=P+R,A=k.offset().left-(k.prop('scrollLeft')||0),D=A+k.outerWidth(),O='left';if(P<A){let B=A-P+12,z=parseInt(L.css('flex-basis'),10);B<-z&&(B=-z),b.css(O,B+'px'),b.data('overflow',B),b.data('overflowDir',O)}else if(H>D){let B=D-H-E-12,z=parseInt(L.css('flex-basis'),10);B<-z&&(B=-z),b.css(O,B+'px'),b.data('overflow',B),b.data('overflowDir',O)}else if(42>E){let B=-15;b.css(O,B+'px'),b.data('overflow',B),b.data('overflowDir',O)}else if(E>j){let B=y.originalEvent&&y.originalEvent.pageX||y.pageX,z=S.offset().left,q=B-z-j/2,F=q+j;0>q?q=0:F>E&&(q=E-R),b.css(O,q+'px'),b.data('adjust',q),b.data('adjustDir',O)}}},d=function(y){let x=jQuery(y.target),v=x.find('.tsf-tooltip'),b=v.find('.tsf-tooltip-arrow'),k=v.data('overflow'),C=v.data('overflowDir');if(k=parseInt(k,10),k=isNaN(k)?0:-Math.round(k),k)b.css(C,k+'px');else{let T=y.originalEvent&&y.originalEvent.pageX||y.pageX,I=7,S=16,L=x.closest('.tsf-tooltip-wrap'),W=T-L.offset().left-S/2,j=v.find('.tsf-tooltip-text-wrap'),R=j.outerWidth(!0),P=v.data('adjust'),H=v.data('adjustDir'),A=R-S-I;if(P=parseInt(P,10),P=isNaN(P)?0:Math.round(P),P&&(P='left'===H?-P:P,W+=P,A-P>L.outerWidth(!0))){let D=j.find('.tsf-tooltip-text'),O=D.outerWidth(!0);A=O-S-I}W<=I?b.css('left',I+'px'):W>=A?b.css('left',A+'px'):b.css('left',W+'px')}},c=function(y){s||(jQuery(y.target).find('.tsf-tooltip').remove(),n(y.target))},g=function(y){a();let k,v='.tsf-tooltip',b=jQuery(y.target);if(b.hasClass('tsf-tooltip-item')&&(k=b.find(v)),!k){let C=b.children('.tsf-tooltip-item');C.length&&(k=C.find(v))}k&&k.length?jQuery(v).not(k).remove():jQuery(v).remove()},f=function(y){if(!s){let x=!1;switch(y.type){case'mouseenter':break;case'pointerdown':case'touchstart':x=!0;break;default:}if(y.target.classList.contains('tsf-tooltip-item'))x&&g(y),l(y),d(y),o(y.target);else{let v=y.target.querySelector('.tsf-tooltip-item:hover'),b=new jQuery.Event(y.type);b.pageX=y.originalEvent&&y.originalEvent.pageX||y.pageX,v?(tsfL10n.states.debug&&console.log('Tooltip event warning: delegation'),jQuery(v).trigger(b)):(tsfL10n.states.debug&&console.log('Tooltip event warning: bubbling'),jQuery(y.target).closest('.tsf-tooltip-wrap').find('.tsf-tooltip-item:hover').trigger(b))}y.stopPropagation()}},u=function(){let y=jQuery('.tsf-tooltip-wrap');y.off('mouseenter pointerdown touchstart'),y.on('mouseenter pointerdown touchstart','.tsf-tooltip-item',f)};u(),jQuery(window).on('tsf-reset-tooltips',u),function(){let y=jQuery('#wpcontent');tsf.addTooltipBoundary(y)}()},addTooltipBoundary:function(t){jQuery(t).addClass('tsf-tooltip-boundary')},tabToggle:function(t){let s=jQuery(t.target);if(s.is(':checked')){let a=s.prop('id'),o=s.prop('name');if('undefined'!=typeof o){let n='tsf-active-tab-content',r=jQuery('#'+a+'-content'),l=jQuery('.'+n);if(!r.is(l)&&'undefined'!=typeof r){let d=jQuery('.'+o+'-content');d.fadeOut(150,function(){jQuery(this).removeClass(n)}),setTimeout(function(){r.addClass(n).fadeIn(250)},150),setTimeout(function(){jQuery('#'+a).trigger('tsf-tab-toggled')},175)}}}},flexTabToggle:function(t){let s=jQuery(t.target);if(s.is(':checked')){let a=s.prop('id'),o=s.prop('name');if('undefined'!=typeof o){let n='tsf-flex-tab-content-active',r=jQuery('#'+a+'-content'),l=jQuery('.'+n);if(!r.is(l)&&'undefined'!=typeof r){let d=jQuery('.'+o+'-content');d.fadeOut(150,function(){jQuery(this).removeClass(n)}),setTimeout(function(){r.addClass(n).fadeIn(250)},150),setTimeout(function(){jQuery('#'+a).trigger('tsf-flex-tab-toggled')},175)}}}},setTabsOnload:function(){if(tsf.hasInput)if(tsf.states.isSettingsPage){let t=jQuery('.tsf-nav-tab-wrapper .tsf-tab:nth-of-type(n+2) input:checked');t.length&&t.each(function(){let a=jQuery(this),o=a.prop('id'),n=a.prop('name');if('undefined'!=typeof n){let r='tsf-active-tab-content',l=jQuery('#'+o+'-content');if('undefined'!=typeof l){let d=jQuery('.'+n+'-content');d.removeClass(r),l.addClass(r),setTimeout(function(){jQuery('#'+o).trigger('tsf-tab-toggled')},20)}}})}else;},taglineToggleDesc:function(t){let s=jQuery(t.target),a=jQuery('#tsf-on-blogname-js');s.is(':checked')?a.css('display','inline'):a.css('display','none')},additionsToggleDesc:function(t){let s=jQuery(t.target),a=jQuery('#tsf-description-additions-js');s.is(':checked')?a.css('display','inline'):a.css('display','none')},taglineToggleOnload:function(){if(tsf.hasInput){let t=jQuery('#tsf-title-tagline-toggle :input'),s=jQuery('.tsf-custom-blogname-js'),a=jQuery('#tsf-description-additions-toggle :input'),o=jQuery('#tsf-description-additions-js'),n=jQuery('#tsf-description-onblogname-toggle :input'),r=jQuery('#tsf-on-blogname-js'),l=jQuery('#tsf-title-additions-toggle :input'),d=jQuery('.tsf-title-additions-js');t.is(':checked')?s.css('display','inline'):s.css('display','none'),a.is(':checked')?o.css('display','inline'):o.css('display','none'),n.is(':checked')?r.css('display','inline'):r.css('display','none'),l.is(':checked')?d.css('display','none'):d.css('display','inline')}},attachUnsavedChangesListener:function(){if(tsf.hasInput){let t=function(o){tsf.settingsChanged||tsf.registerChange(),jQuery(s).not(a).off(o.type,t)},s='.tsf-metaboxes :input, #tsf-inpost-box .inside :input',a='.tsf-tab :input, .tsf-flex-nav-tab :input';jQuery(s).not(a).on('change',t),s='.tsf-metaboxes input[type=text], .tsf-metaboxes textarea, #tsf-inpost-box .inside input[type=text], #tsf-inpost-box .inside textarea',a='.tsf-nav-tab-wrapper input, .tsf-flex-nav-tab-wrapper input',jQuery(s).not(a).on('input',t),window.onbeforeunload=function(){if(tsf.settingsChanged)return tsf.i18n.saveAlert},jQuery('.tsf-metaboxes input[type="submit"], #publishing-action input[type="submit"], #save-action input[type="submit"], a.submitdelete').click(function(){window.onbeforeunload=null})}},registerChange:function(){tsf.settingsChanged=!0},confirmedReset:function(){return confirm(tsf.i18n.confirmReset)},onLoadUnregisterChange:function(){tsf.settingsChanged=!1},dismissNotice:function(t){jQuery(t.target).parents('.tsf-notice').slideUp(200,function(){this.remove()})},setAjaxLoader:function(t){jQuery(t).toggleClass('tsf-loading')},unsetAjaxLoader:function(t,s){let a='tsf-success',o=2500;s||(a='tsf-error',o=5e3),jQuery(t).removeClass('tsf-loading').addClass(a).fadeOut(o)},resetAjaxLoader:function(t){jQuery(t).stop().empty().prop('class','tsf-ajax').css('opacity','1').removeProp('style')},openImageEditor:function(t){if(jQuery(t.target).prop('disabled')||'undefined'==typeof wp.media)return t.preventDefault(),void t.stopPropagation();let o,s=jQuery(t.target),a=s.data('inputid');if(o)return void o.open();t.preventDefault(),t.stopPropagation(),tsf.extendCropper();let n={suggestedWidth:s.data('width')||1200,suggestedHeight:s.data('height')||630,isFlex:'undefined'==typeof s.data('flex')?1:s.data('flex')};tsf.cropper.control={params:{flex_width:n.isFlex?4096:0,flex_height:n.isFlex?4096:0,width:n.suggestedWidth,height:n.suggestedHeight,isFlex:n.isFlex}},o=wp.media({button:{text:tsf.other[a].frame_button,close:!1},states:[new wp.media.controller.Library({title:tsf.other[a].frame_title,library:wp.media.query({type:'image'}),multiple:!1,date:!1,priority:20,suggestedWidth:n.suggestedWidth,suggestedHeight:n.suggestedHeight}),new tsf.cropper({imgSelectOptions:tsf.calculateImageSelectOptions})]});const r=function(){o.setState('cropper')};o.off('select',r),o.on('select',r);const l=function(g){let f=g.url,u=g.id,y=g.width,x=g.height;jQuery('#'+a+'-url').val(f),jQuery('#'+a+'-id').val(u)};o.off('cropped',l),o.on('cropped',l);const d=function(g){let f=g.get('url'),u=g.get('id'),y=g.get('width'),x=g.get('height');jQuery('#'+a+'-url').val(f),jQuery('#'+a+'-id').val(u)};o.off('skippedcrop',d),o.on('skippedcrop',d);const c=function(){jQuery('#'+a+'-select').text(tsf.other[a].change),jQuery('#'+a+'-url').prop('readonly',!0).css('opacity',0).animate({opacity:1},{queue:!0,duration:1000},'swing'),tsf.appendRemoveButton(s,a,!0),tsf.registerChange()};o.off('skippedcrop cropped',c),o.on('skippedcrop cropped',c),o.open()},appendRemoveButton:function(t,s,a){t&&s&&!jQuery('#'+s+'-remove').length&&(t.after('<a href="javascript:void(0)" id="'+s+'-remove" class="tsf-remove-social-image button button-small" data-inputid="'+s+'" title="'+tsf.other[s].remove_title+'">'+tsf.other[s].remove+'</a>'),a&&jQuery('#'+s+'-remove').css('opacity',0).animate({opacity:1},{queue:!0,duration:1000},'swing')),tsf.resetImageEditorActions()},removeEditorImage:function(t){let s=jQuery(t.target).data('inputid');if(!jQuery('#'+s+'-select').prop('disabled')){jQuery('#'+s+'-select').addClass('disabled').prop('disabled',!0),jQuery('#'+s+'-remove').addClass('disabled').prop('disabled',!0).fadeOut(500,function(){jQuery(this).remove(),jQuery('#'+s+'-select').text(tsf.other[s].select).removeClass('disabled').removeProp('disabled')});let a=jQuery('#'+s+'-url');a.val(''),a.data('readonly')||a.removeProp('readonly'),a.css('opacity',0).animate({opacity:1},{queue:!0,duration:500},'swing'),jQuery('#'+s+'-id').val(''),tsf.registerChange()}},extendCropper:function(){if('undefined'==typeof tsf.cropper.control){let t,a,s=wp.media.controller,o=wp.media.view;return a=o.Cropper.extend({className:'crop-content tsf-image',ready:function(){o.Cropper.prototype.ready.apply(this,arguments)},onImageLoad:function(){let r,n=this.controller.get('imgSelectOptions');'function'==typeof n&&(n=n(this.options.attachment,this.controller)),'undefined'==typeof n.aspectRatio&&(n=_.extend(n,{parent:this.$el,onInit:function(){this.parent.children().on('mousedown touchstart',function(l){l.shiftKey?r.setOptions({aspectRatio:'1:1'}):r.setOptions({aspectRatio:!1})})}})),this.trigger('image-loaded'),r=this.controller.imgSelect=this.$image.imgAreaSelect(n)}}),t=s.Cropper.extend({createCropContent:function(){this.cropperView=new a({controller:this,attachment:this.get('selection').first()}),this.cropperView.on('image-loaded',this.createCropToolbar,this),this.frame.content.set(this.cropperView)},doCrop:function(n){let r=n.get('cropDetails'),l=tsf.cropper.control;if(l.params.flex_width&&l.params.flex_height)if(r.width===r.height)r.width>l.params.flex_width&&(r.dst_width=r.dst_height=l.params.flex_width);else if(r.width>l.params.flex_width||r.height>l.params.flex_height)if(r.width>r.height){let d=r.width/l.params.flex_width;r.dst_width=l.params.flex_width,r.dst_height=Math.round(r.height/d)}else{let d=r.height/l.params.flex_height;r.dst_height=l.params.flex_height,r.dst_width=Math.round(r.width/d)}return'undefined'==typeof r.dst_width&&(r.dst_width=0,r.dst_height=0),wp.ajax.post('tsf-crop-image',{nonce:tsf.nonces.upload_files,id:n.get('id'),context:'tsf-image',cropDetails:r})}}),t.prototype.control={},void(tsf.cropper=t)}},calculateImageSelectOptions:function(t,s){let y,x,v,b,a=tsf.cropper.control,o=!!parseInt(a.params.flex_width,10),n=!!parseInt(a.params.flex_height,10),r=parseInt(a.params.width,10),l=parseInt(a.params.height,10),d=t.get('width'),c=t.get('height'),g=r/l,f=r,u=l;return b=a.params.isFlex?!tsf.mustBeCropped(a.params.flex_width,a.params.flex_height,d,c):g==d/c,s.set('control',a.params),s.set('canSkipCrop',b),d/c>g?(l=c,r=l*g):(r=d,l=r/g),y=(d-r)/2,x=(c-l)/2,v={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:d,imageHeight:c,minWidth:f>r?r:f,minHeight:u>l?l:u,x1:y,y1:x,x2:r+y,y2:l+x},a.params.isFlex?n||o?(n&&(v.minHeight=200,v.maxWidth=d),o&&(v.minWidth=200,v.maxHeight=c)):v.aspectRatio=r+':'+l:(v.handles='corners',v.aspectRatio=r+':'+l),v},mustBeCropped:function(t,s,a,o){return a<=t&&o<=s?!1:!0},resetImageEditorActions:function(){jQuery('.tsf-remove-social-image').off('click',tsf.removeEditorImage),jQuery('.tsf-remove-social-image').on('click',tsf.removeEditorImage)},setupImageEditorActions:function(){jQuery('.tsf-set-social-image').off('click',tsf.openImageEditor),jQuery('.tsf-remove-social-image').off('click',tsf.removeEditorImage),jQuery('.tsf-set-social-image').on('click',tsf.openImageEditor),jQuery('.tsf-remove-social-image').on('click',tsf.removeEditorImage)},checkImageEditorInput:function(){let t=jQuery('.tsf-set-social-image');if(t.length){let s='',a='';jQuery.each(t,function(o,n){s=jQuery(n).data('inputid'),a=jQuery('#'+s+'-id'),a.length&&0<a.val()&&(jQuery('#'+s+'-url').prop('readonly',!0),tsf.appendRemoveButton(jQuery(n),s,!1)),jQuery('#'+s+'-url').val()&&jQuery('#'+s+'-select').text(tsf.other[s].change)})}},setColorOnload:function(){let t=jQuery('.tsf-color-picker');t.length&&jQuery.each(t,function(s,a){let o=jQuery(a),n='',r=o.data('tsf-default-color');o.wpColorPicker({defaultColor:r,width:238,change:function(){n=o.wpColorPicker('color'),''==n&&(n=r),o.val(n),tsf.registerChange()},clear:function(){o.parent().siblings('.wp-color-result').css('backgroundColor',r),tsf.registerChange()},palettes:!1})})},_doFlexResizeListener:function(){if(jQuery('.tsf-flex').length){tsf._setResizeListeners();let t=0,s={},a=0,o=jQuery('.tsf-flex-nav-tab-wrapper'),n=jQuery(window);n.on('tsf-flex-resize',function(){clearTimeout(t);let r=0;t=setTimeout(function(){if(o.length){let l=jQuery('.tsf-flex-nav-tab-inner'),d=o.width(),c=l.width(),g=jQuery('.tsf-flex-nav-name');s.tabWrapper||(s.tabWrapper={},s.tabWrapper.outer=0,s.tabWrapper.inner=0,s.tabWrapper.shown=1),!s.tabWrapper.shown&&s.tabWrapper.outer<d&&(g.fadeIn(250),setTimeout(function(){c=l.width()},r)),setTimeout(function(){c>d?(g.hide(),s.tabWrapper.shown=0):s.tabWrapper.outer<d&&(g.fadeIn(250),s.tabWrapper.shown=1)},2*r),setTimeout(function(){s.tabWrapper.outer=d,s.tabWrapper.inner=c},3*r)}},a),r=10,a=75}),n.trigger('tsf-flex-resize')}},_setResizeListeners:function(){jQuery(window).on('resize orientationchange',tsf._triggerResize),jQuery('#collapse-menu').click(tsf._triggerResize),jQuery('.columns-prefs :input[type=radio]').change(tsf._triggerResize),jQuery('.meta-box-sortables').on('sortupdate',tsf._triggerResize)},_triggerTooltipReset:function(){jQuery(window).trigger('tsf-reset-tooltips')},_triggerTooltipUpdate:function(t){jQuery(t).trigger('tsf-tooltip-update')},_triggerResize:function(){jQuery(window).trigger('tsf-flex-resize')},_triggerCounterUpdate:function(){jQuery(window).trigger('tsf-counter-updated')},_triggerReady:function(){jQuery(document.body).trigger('tsf-ready')},_doReady:function(){tsf._initCounters(),tsf._initTitleInputs(),tsf._initUnboundTitleSettings(),tsf._initDescInputs(),tsf._initPrimaryTerm(),tsf.setTabsOnload(),tsf.taglineToggleOnload(),tsf._initToolTips(),tsf.setupImageEditorActions(),tsf.checkImageEditorInput(),tsf.setColorOnload(),tsf.attachUnsavedChangesListener(),tsf.onLoadUnregisterChange(),tsf._doFlexResizeListener(),tsf._triggerReady()},setupVars:function(){tsf.counterType=parseInt(tsf.states.counterType),tsf.hasInput=tsf.states.hasInput},ready:function(t){tsf.setupVars(),t('div.updated, div.error, div.notice-warning').insertAfter('div.tsf-top-wrap'),t(document.body).ready(tsf._doReady),t('.tsf-js-confirm-reset').on('click',tsf.confirmedReset),t('.tsf-tabs-radio').on('change',tsf.tabToggle),t('.tsf-flex-nav-tab-radio').on('change',tsf.flexTabToggle),t('#tsf-description-onblogname-toggle :input').on('click',tsf.taglineToggleDesc),t('#tsf-description-additions-toggle :input').on('click',tsf.additionsToggleDesc),t('.tsf-dismiss').on('click',tsf.dismissNotice)}},jQuery(tsf.ready);
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: Cybr
|
|
3 |
Donate link: https://theseoframework.com/donate/
|
4 |
Tags: SEO, XML Sitemap, Google, Open Graph, Schema.org, Twitter
|
5 |
Requires at least: 4.4.0
|
6 |
-
Tested up to: 4.9
|
7 |
Requires PHP: 5.3.0
|
8 |
-
Stable tag: 3.0.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -121,7 +121,7 @@ A caching plugin isn't even needed for this plugin as you won't notice a differe
|
|
121 |
* Detection of robots.txt and sitemap.xml files.
|
122 |
* Both up-to-date and outdated themes.
|
123 |
* Detection of various other popular SEO tools to prevent duplicated output.
|
124 |
-
* Translation plugins WPML, Polylang and qTranslate X.
|
125 |
* WooCommerce, for free, in all its glory.
|
126 |
|
127 |
= An additional sitemap =
|
@@ -224,15 +224,29 @@ Transporting Terms and Taxonomies SEO data isn't supported.
|
|
224 |
|
225 |
== Changelog ==
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
= 3.0.2 - Esteem =
|
228 |
|
229 |
**Release date:**
|
230 |
|
231 |
* November 23rd, 2017
|
232 |
|
233 |
-
**
|
|
|
|
|
234 |
|
235 |
-
|
236 |
|
237 |
= 3.0.1 - Renown =
|
238 |
|
@@ -240,11 +254,11 @@ Transporting Terms and Taxonomies SEO data isn't supported.
|
|
240 |
|
241 |
* November 20th, 2017
|
242 |
|
243 |
-
**
|
|
|
|
|
244 |
|
245 |
-
|
246 |
-
* On-site search canonical URLs are now correct when no blog page is assigned.
|
247 |
-
* Title placeholders can now render HTML characters correctly.
|
248 |
|
249 |
= 3.0.0 - Eminence =
|
250 |
|
@@ -260,7 +274,7 @@ Transporting Terms and Taxonomies SEO data isn't supported.
|
|
260 |
|
261 |
* Finally, after 8 months of preparation, experimenting, testing, and coding, TSF 3.0 is here.
|
262 |
* This update focuses on improved social site interaction, WordPress' API coherence, and optimizing UX.
|
263 |
-
* To improve social site interaction, social site links can be added
|
264 |
* The Open Graph protocol has been updated, so will your meta output.
|
265 |
* The canonical URL generation has been revised, and it now works mostly through WordPress' API.
|
266 |
* For improved UX we've added pixel counters, better tooltips, and admin color scheme adherence.
|
3 |
Donate link: https://theseoframework.com/donate/
|
4 |
Tags: SEO, XML Sitemap, Google, Open Graph, Schema.org, Twitter
|
5 |
Requires at least: 4.4.0
|
6 |
+
Tested up to: 4.9.1
|
7 |
Requires PHP: 5.3.0
|
8 |
+
Stable tag: 3.0.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
121 |
* Detection of robots.txt and sitemap.xml files.
|
122 |
* Both up-to-date and outdated themes.
|
123 |
* Detection of various other popular SEO tools to prevent duplicated output.
|
124 |
+
* Translation plugins like WPML, Polylang and qTranslate X.
|
125 |
* WooCommerce, for free, in all its glory.
|
126 |
|
127 |
= An additional sitemap =
|
224 |
|
225 |
== Changelog ==
|
226 |
|
227 |
+
= 3.0.3 - Diligence =
|
228 |
+
|
229 |
+
**Release date:**
|
230 |
+
|
231 |
+
* December 6th, 2017
|
232 |
+
|
233 |
+
**Summarized:**
|
234 |
+
|
235 |
+
* This update implements a workaround for an issue with bbPress, and various UI bugs have been fixed as well.
|
236 |
+
|
237 |
+
[View the detailed log](https://theseoframework.com/?p=2236#detailed).
|
238 |
+
|
239 |
= 3.0.2 - Esteem =
|
240 |
|
241 |
**Release date:**
|
242 |
|
243 |
* November 23rd, 2017
|
244 |
|
245 |
+
**Summarized:**
|
246 |
+
|
247 |
+
* This update fixes an issue with wpForo found in the 3.0 release of TSF.
|
248 |
|
249 |
+
[View the detailed log](https://theseoframework.com/?p=2231#detailed).
|
250 |
|
251 |
= 3.0.1 - Renown =
|
252 |
|
254 |
|
255 |
* November 20th, 2017
|
256 |
|
257 |
+
**Summarized:**
|
258 |
+
|
259 |
+
* This update fixes a few issues found in the 3.0 release of TSF.
|
260 |
|
261 |
+
[View the detailed log](https://theseoframework.com/?p=2225#detailed).
|
|
|
|
|
262 |
|
263 |
= 3.0.0 - Eminence =
|
264 |
|
274 |
|
275 |
* Finally, after 8 months of preparation, experimenting, testing, and coding, TSF 3.0 is here.
|
276 |
* This update focuses on improved social site interaction, WordPress' API coherence, and optimizing UX.
|
277 |
+
* To improve social site interaction, social site links can be added through author profile pages.
|
278 |
* The Open Graph protocol has been updated, so will your meta output.
|
279 |
* The canonical URL generation has been revised, and it now works mostly through WordPress' API.
|
280 |
* For improved UX we've added pixel counters, better tooltips, and admin color scheme adherence.
|