--- a/wp/wp-includes/class-wp-network-query.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/class-wp-network-query.php Tue Sep 27 16:37:53 2022 +0200
@@ -158,7 +158,7 @@
*
* @since 4.6.0
*
- * @param WP_Network_Query $this The WP_Network_Query instance (passed by reference).
+ * @param WP_Network_Query $query The WP_Network_Query instance (passed by reference).
*/
do_action_ref_array( 'parse_network_query', array( &$this ) );
}
@@ -193,7 +193,7 @@
*
* @since 4.6.0
*
- * @param WP_Network_Query $this Current instance of WP_Network_Query (passed by reference).
+ * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
*/
do_action_ref_array( 'pre_get_networks', array( &$this ) );
@@ -242,8 +242,8 @@
// $args can include anything. Only use the args defined in the query_var_defaults to compute the key.
$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );
- // Ignore the $fields argument as the queried result will be the same regardless.
- unset( $_args['fields'] );
+ // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless.
+ unset( $_args['fields'], $_args['update_network_cache'] );
$key = md5( serialize( $_args ) );
$last_changed = wp_cache_get_last_changed( 'networks' );
@@ -438,17 +438,17 @@
$groupby = '';
- $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
+ $clauses = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
/**
* Filters the network query clauses.
*
* @since 4.6.0
*
- * @param string[] $pieces An associative array of network query clauses.
- * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
+ * @param string[] $clauses An associative array of network query clauses.
+ * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
*/
- $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );
+ $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $clauses ), &$this ) );
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
@@ -480,7 +480,14 @@
$this->sql_clauses['orderby'] = $orderby;
$this->sql_clauses['limits'] = $limits;
- $this->request = "{$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']}";
+ $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 (int) $wpdb->get_var( $this->request );
@@ -524,14 +531,14 @@
*
* @global wpdb $wpdb WordPress database abstraction object.
*
- * @param string $string Search string.
+ * @param string $search Search string.
* @param string[] $columns Array of columns to search.
* @return string Search SQL.
*/
- protected function get_search_sql( $string, $columns ) {
+ protected function get_search_sql( $search, $columns ) {
global $wpdb;
- $like = '%' . $wpdb->esc_like( $string ) . '%';
+ $like = '%' . $wpdb->esc_like( $search ) . '%';
$searches = array();
foreach ( $columns as $column ) {