mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Coding Standards: Replace alias PHP functions with the canonical names.
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning. This replaces all uses of the following: * `join()` with `implode()` * `sizeof()` with `count()` * `is_writeable()` with `is_writable()` * `doubleval()` with a `(float)` cast In part, this is a follow-up to #47746. Props jrf. See #50767. git-svn-id: https://develop.svn.wordpress.org/trunk@49193 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2420,10 +2420,10 @@ class WP_Query {
|
||||
if ( empty( $in_search_post_types ) ) {
|
||||
$where .= ' AND 1=0 ';
|
||||
} else {
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
|
||||
}
|
||||
} elseif ( ! empty( $post_type ) && is_array( $post_type ) ) {
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", esc_sql( $post_type ) ) . "')";
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", esc_sql( $post_type ) ) . "')";
|
||||
} elseif ( ! empty( $post_type ) ) {
|
||||
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
@@ -2485,20 +2485,20 @@ class WP_Query {
|
||||
}
|
||||
|
||||
if ( ! empty( $e_status ) ) {
|
||||
$statuswheres[] = '(' . join( ' AND ', $e_status ) . ')';
|
||||
$statuswheres[] = '(' . implode( ' AND ', $e_status ) . ')';
|
||||
}
|
||||
if ( ! empty( $r_status ) ) {
|
||||
if ( ! empty( $q['perm'] ) && 'editable' === $q['perm'] && ! current_user_can( $edit_others_cap ) ) {
|
||||
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $r_status ) . '))';
|
||||
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $r_status ) . '))';
|
||||
} else {
|
||||
$statuswheres[] = '(' . join( ' OR ', $r_status ) . ')';
|
||||
$statuswheres[] = '(' . implode( ' OR ', $r_status ) . ')';
|
||||
}
|
||||
}
|
||||
if ( ! empty( $p_status ) ) {
|
||||
if ( ! empty( $q['perm'] ) && 'readable' === $q['perm'] && ! current_user_can( $read_private_cap ) ) {
|
||||
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $p_status ) . '))';
|
||||
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $p_status ) . '))';
|
||||
} else {
|
||||
$statuswheres[] = '(' . join( ' OR ', $p_status ) . ')';
|
||||
$statuswheres[] = '(' . implode( ' OR ', $p_status ) . ')';
|
||||
}
|
||||
}
|
||||
if ( $post_status_join ) {
|
||||
@@ -2669,7 +2669,7 @@ class WP_Query {
|
||||
$post_ids[] = (int) $comment->comment_post_ID;
|
||||
}
|
||||
|
||||
$post_ids = join( ',', $post_ids );
|
||||
$post_ids = implode( ',', $post_ids );
|
||||
$join = '';
|
||||
if ( $post_ids ) {
|
||||
$where = "AND {$wpdb->posts}.ID IN ($post_ids) ";
|
||||
|
||||
Reference in New Issue
Block a user