Changeset 49200 for trunk/src/wp-includes/canonical.php
- Timestamp:
- 10/18/2020 11:21:03 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r48872 r49200 896 896 // If any of post_type, year, monthnum, or day are set, use them to refine the query. 897 897 if ( get_query_var( 'post_type' ) ) { 898 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 898 if ( is_array( get_query_var( 'post_type' ) ) ) { 899 // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare 900 $where .= " AND post_type IN ('" . join( "', '", esc_sql( get_query_var( 'post_type' ) ) ) . "')"; 901 } else { 902 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 903 } 899 904 } else { 900 905 $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
Note: See TracChangeset
for help on using the changeset viewer.