Plugin Directory


Ignore:
Timestamp:
11/28/2026 01:28:33 AM (less than one hour ago)
Author:
rnzo
Message:

Bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vabelon/trunk/src/Routing/QueryLanguage.php

    r3827447 r3830701  
    1818defined( 'ABSPATH' ) || exit;
    1919
    20 /**
    21  * Query scoping.
    22  */
     20
    2321final class QueryLanguage {
    2422
    25         /**
    26          * Hook the scoping into WordPress.
    27          *
    28          * @return void
    29          */
     23        /** @return void */
    3024        public function register(): void {
    3125                add_action( 'pre_get_posts', array( $this, 'scope' ), 1 );
    … …  
    3529
    3630        /**
    37          * Limit a list query to one language.
    38          *
    39          * A request for one specific post is left alone: StaticPages sends it to its own address.
    40          *
    4131         * @param WP_Query $query Query about to run.
    4232         * @return void
    … …  
    4737                        return;
    4838                }
    49                 // WordPress leaves the post type empty on the blog index, search, feeds and most archives.
     39
    5040                $types = array_filter(
    5141                        (array) $query->get( 'post_type' ),
    … …  
    7666
    7767        /**
    78          * Keep the previous and next post links inside the language of the post being viewed.
    79          *
    8068         * @param mixed $where    WHERE clause of the adjacent post query; the posts table is aliased p.
    8169         * @param mixed $same     Unused.
    … …  
    10391                        return $default ? $where : $where . ' AND 1 = 0';
    10492                }
    105                 // $ids holds integers only, read from the language terms above.
     93
    10694                return $where . ' AND p.ID ' . ( $default ? 'NOT IN' : 'IN' ) . " ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( " . implode( ',', $ids ) . ' ) )';
    10795        }
Note: See TracChangeset for help on using the changeset viewer.