PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
3.24.3 3.24.2 3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 All 107 releases
← All changes | src/Metadata/class-metadata-builder.php +4 -5 3.16.4 → 3.24.2 View file →
@@ -10,13 +10,12 @@
10 10
11 11 namespace Parsely\Metadata;
12 12
13 13 use Parsely\Parsely;
14 +use Parsely\Utils\Utils;
14 15 use WP_Post;
15 16 use WP_User;
16 17
17 -use function Parsely\Utils\get_default_category;
18 -
19 18 /**
20 19 * Abstract class that implements modular builders for Metadata.
21 20 *
22 21 * It should be extended in subclasses that implement a particular page view to render
@@ -365,9 +364,9 @@
365 364 $taxonomy_dropdown_choice = get_the_terms( $post_obj->ID, $parsely_options['custom_taxonomy_section'] );
366 365 // Get top-level taxonomy name for chosen taxonomy and assign to $parent_name; it will be used
367 366 // as the category value if 'use_top_level_cats' option is checked.
368 367 // Assign as the default category name if no value is checked for the chosen taxonomy.
369 - $category_name = get_cat_name( get_default_category() );
368 + $category_name = get_cat_name( Utils::get_default_category() );
370 369 if ( false !== $taxonomy_dropdown_choice && ! is_wp_error( $taxonomy_dropdown_choice ) ) {
371 370 if ( $parsely_options['use_top_level_cats'] ) {
372 371 $first_term = array_shift( $taxonomy_dropdown_choice );
373 372 if ( null !== $first_term ) {
@@ -411,9 +410,9 @@
411 410 */
412 411 private function get_top_level_term( int $term_id, string $taxonomy_name ) {
413 412 $parent = get_term_by( 'id', $term_id, $taxonomy_name );
414 413
415 - while ( false !== $parent && isset( $parent->parent ) && 0 !== $parent->parent ) {
414 + while ( false !== $parent && 0 !== $parent->parent ) {
416 415 $parent = get_term_by( 'id', $parent->parent, $taxonomy_name );
417 416 }
418 417
419 418 return $parent->name ?? false;
@@ -644,9 +643,9 @@
644 643 $tags = explode( '/', $last_tag );
645 644 }
646 645
647 646 // Remove default category name from tags if needed.
648 - $default_category_name = get_cat_name( get_default_category() );
647 + $default_category_name = get_cat_name( Utils::get_default_category() );
649 648 return array_diff( $tags, array( $default_category_name ) );
650 649 }
651 650
652 651 /**