Changeset 63100 for branches/6.0/src/wp-includes/canonical.php
- Timestamp:
- 08/06/2026 07:38:52 PM (2 months ago)
- File:
-
- 1 edited
-
branches/6.0/src/wp-includes/canonical.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0/src/wp-includes/canonical.php
r53043 r63100 919 919 920 920 if ( get_query_var( 'name' ) ) { 921 $publicly_viewable_post_types = array_filter( get_post_types( array( 'exclude_from_search' => false ) ), 'is_post_type_viewable' ); 922 921 923 /** 922 924 * Filters whether to perform a strict guess for a 404 redirect. … … 939 941 if ( get_query_var( 'post_type' ) ) { 940 942 if ( is_array( get_query_var( 'post_type' ) ) ) { 941 // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare 942 $where .= " AND post_type IN ('" . join( "', '", esc_sql( get_query_var( 'post_type' ) ) ) . "')"; 943 $post_types = array_intersect( get_query_var( 'post_type' ), $publicly_viewable_post_types ); 944 if ( empty( $post_types ) ) { 945 return false; 946 } 947 $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $post_types ) ) . "')"; 943 948 } else { 949 if ( ! in_array( get_query_var( 'post_type' ), $publicly_viewable_post_types, true ) ) { 950 return false; 951 } 944 952 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 945 953 } 946 954 } else { 947 $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true )) ) . "')";955 $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $publicly_viewable_post_types ) ) . "')"; 948 956 } 949 957
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)