General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core. * `intval()` → `(int)` * `strval()` → `(string)` * `floatval()` → `(float)` Props ayeshrajans. Fixes #42918. Built from https://develop.svn.wordpress.org/trunk@49108 git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -456,7 +456,7 @@ class WP_Comment_Query {
|
||||
// If querying for a count only, there's nothing more to do.
|
||||
if ( $this->query_vars['count'] ) {
|
||||
// $comment_ids is actually a count in this case.
|
||||
return intval( $comment_ids );
|
||||
return (int) $comment_ids;
|
||||
}
|
||||
|
||||
$comment_ids = array_map( 'intval', $comment_ids );
|
||||
@@ -942,7 +942,7 @@ class WP_Comment_Query {
|
||||
$this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
|
||||
|
||||
if ( $this->query_vars['count'] ) {
|
||||
return intval( $wpdb->get_var( $this->request ) );
|
||||
return (int) $wpdb->get_var( $this->request );
|
||||
} else {
|
||||
$comment_ids = $wpdb->get_col( $this->request );
|
||||
return array_map( 'intval', $comment_ids );
|
||||
|
||||
Reference in New Issue
Block a user