PluginProbe
Polylang / 2.6.2
Polylang v2.6.2
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/model.php +5 -7 2.7.22.6.2 View file →
@@ -181,9 +181,8 @@
181 181 $this->cache->set( 'language:' . $lang->term_id, $lang );
182 182 $this->cache->set( 'language:' . $lang->tl_term_id, $lang );
183 183 $this->cache->set( 'language:' . $lang->slug, $lang );
184 184 $this->cache->set( 'language:' . $lang->locale, $lang );
185 - $this->cache->set( 'language:' . $lang->w3c, $lang );
186 185 }
187 186 $return = $this->cache->get( 'language:' . $value );
188 187 }
189 188
@@ -427,9 +426,8 @@
427 426 public function term_exists( $term_name, $taxonomy, $parent, $language ) {
428 427 global $wpdb;
429 428
430 429 $term_name = trim( wp_unslash( $term_name ) );
431 - $term_name = _wp_specialchars( $term_name );
432 430
433 431 $select = "SELECT t.term_id FROM $wpdb->terms AS t";
434 432 $join = " INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id";
435 433 $join .= $this->term->join_clause();
@@ -449,15 +447,15 @@
449 447 *
450 448 * @since 1.2
451 449 *
452 450 * @param object $lang PLL_Language instance.
453 - * @param array $q WP_Query arguments ( accepted: post_type, m, year, monthnum, day, author, author_name, post_format, post_status ).
451 + * @param array $q WP_Query arguments ( accepted: post_type, m, year, monthnum, day, author, author_name, post_format ).
454 452 * @return int
455 453 */
456 454 public function count_posts( $lang, $q = array() ) {
457 455 global $wpdb;
458 456
459 - $q = wp_parse_args( $q, array( 'post_type' => 'post', 'post_status' => 'publish' ) );
457 + $q = wp_parse_args( $q, array( 'post_type' => 'post' ) );
460 458
461 459 if ( ! is_array( $q['post_type'] ) ) {
462 460 $q['post_type'] = array( $q['post_type'] );
463 461 }
@@ -477,9 +475,9 @@
477 475
478 476 if ( false === $counts ) {
479 477 $select = "SELECT pll_tr.term_taxonomy_id, COUNT( * ) AS num_posts FROM {$wpdb->posts}";
480 478 $join = $this->post->join_clause();
481 - $where = sprintf( " WHERE post_status = '%s'", esc_sql( $q['post_status'] ) );
479 + $where = " WHERE post_status = 'publish'";
482 480 $where .= sprintf( " AND {$wpdb->posts}.post_type IN ( '%s' )", join( "', '", esc_sql( $q['post_type'] ) ) );
483 481 $where .= $this->post->where_clause( $this->get_languages_list() );
484 482 $groupby = ' GROUP BY pll_tr.term_taxonomy_id';
485 483
@@ -611,9 +609,9 @@
611 609 }
612 610
613 611 if ( ! empty( $o ) && is_object( $this->$o ) && method_exists( $this->$o, $f ) ) {
614 612 if ( WP_DEBUG ) {
615 - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
613 + $debug = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
616 614 $i = 1 + empty( $debug[1]['line'] ); // the file and line are in $debug[2] if the function was called using call_user_func
617 615
618 616 trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions
619 617 sprintf(
@@ -628,9 +626,9 @@
628 626 }
629 627 return call_user_func_array( array( $this->$o, $f ), $args );
630 628 }
631 629
632 - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
630 + $debug = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
633 631 trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions
634 632 sprintf(
635 633 'Call to undefined function PLL()->model->%1$s() in %2$s on line %3$s' . "\nError handler",
636 634 esc_html( $func ),