Code is Poetry.
WordPress' code just... wasn't. This is now dealt with. Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS. Fixes #41057. Built from https://develop.svn.wordpress.org/trunk@42343 git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -93,9 +93,9 @@ function set_query_var( $var, $value ) {
|
||||
* @param array|string $query Array or string of WP_Query arguments.
|
||||
* @return array List of post objects.
|
||||
*/
|
||||
function query_posts($query) {
|
||||
function query_posts( $query ) {
|
||||
$GLOBALS['wp_query'] = new WP_Query();
|
||||
return $GLOBALS['wp_query']->query($query);
|
||||
return $GLOBALS['wp_query']->query( $query );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -873,18 +873,18 @@ function wp_old_slug_redirect() {
|
||||
return;
|
||||
}
|
||||
|
||||
$query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
|
||||
$query = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, get_query_var( 'name' ) );
|
||||
|
||||
// if year, monthnum, or day have been specified, make our query more precise
|
||||
// just in case there are multiple identical _wp_old_slug values
|
||||
if ( get_query_var( 'year' ) ) {
|
||||
$query .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var( 'year' ) );
|
||||
$query .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) );
|
||||
}
|
||||
if ( get_query_var( 'monthnum' ) ) {
|
||||
$query .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var( 'monthnum' ) );
|
||||
$query .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) );
|
||||
}
|
||||
if ( get_query_var( 'day' ) ) {
|
||||
$query .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var( 'day' ) );
|
||||
$query .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) );
|
||||
}
|
||||
|
||||
$id = (int) $wpdb->get_var( $query );
|
||||
@@ -897,7 +897,7 @@ function wp_old_slug_redirect() {
|
||||
|
||||
if ( get_query_var( 'paged' ) > 1 ) {
|
||||
$link = user_trailingslashit( trailingslashit( $link ) . 'page/' . get_query_var( 'paged' ) );
|
||||
} elseif( is_embed() ) {
|
||||
} elseif ( is_embed() ) {
|
||||
$link = user_trailingslashit( trailingslashit( $link ) . 'embed' );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user