diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
index c2892f16b1..39fc293e5e 100644
a
|
b
|
function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) { |
3281 | 3281 | |
3282 | 3282 | $non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' ); |
3283 | 3283 | if ( ! empty( $non_cached_ids ) ) { |
3284 | | $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
| 3284 | $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s) LIMIT %d", implode( ',', array_map( 'intval', $non_cached_ids ) ), count( $non_cached_ids ) ) ); |
3285 | 3285 | |
3286 | 3286 | update_comment_cache( $fresh_comments, $update_meta_cache ); |
3287 | 3287 | } |
diff --git a/src/wp-includes/ms-network.php b/src/wp-includes/ms-network.php
index 91001ab9a0..20e44f9523 100644
a
|
b
|
function _prime_network_caches( $network_ids ) { |
131 | 131 | |
132 | 132 | $non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' ); |
133 | 133 | if ( ! empty( $non_cached_ids ) ) { |
134 | | $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 134 | $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s) LIMIT %d", implode( ',', array_map( 'intval', $non_cached_ids ) ), count( $non_cached_ids ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
135 | 135 | |
136 | 136 | update_network_cache( $fresh_networks ); |
137 | 137 | } |
diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php
index 2c8c93cb86..2b2f5d60c4 100644
a
|
b
|
function _prime_site_caches( $ids, $update_meta_cache = true ) { |
352 | 352 | |
353 | 353 | $non_cached_ids = _get_non_cached_ids( $ids, 'sites' ); |
354 | 354 | if ( ! empty( $non_cached_ids ) ) { |
355 | | $fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 355 | $fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s) LIMIT %d", implode( ',', array_map( 'intval', $non_cached_ids ) ), count( $non_cached_ids ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
356 | 356 | |
357 | 357 | update_site_cache( $fresh_sites, $update_meta_cache ); |
358 | 358 | } |
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 91edacf76f..ca42889e57 100644
a
|
b
|
function _prime_post_caches( $ids, $update_term_cache = true, $update_meta_cache |
7673 | 7673 | |
7674 | 7674 | $non_cached_ids = _get_non_cached_ids( $ids, 'posts' ); |
7675 | 7675 | if ( ! empty( $non_cached_ids ) ) { |
7676 | | $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", implode( ',', $non_cached_ids ) ) ); |
| 7676 | $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s) LIMIT %d", implode( ',', $non_cached_ids ), count( $non_cached_ids ) ) ); |
7677 | 7677 | |
7678 | 7678 | update_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache ); |
7679 | 7679 | } |
diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index 5b1acb4fc6..25201952b0 100644
a
|
b
|
function _prime_term_caches( $term_ids, $update_meta_cache = true ) { |
3936 | 3936 | |
3937 | 3937 | $non_cached_ids = _get_non_cached_ids( $term_ids, 'terms' ); |
3938 | 3938 | if ( ! empty( $non_cached_ids ) ) { |
3939 | | $fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
| 3939 | $fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s) LIMIT %d", implode( ',', array_map( 'intval', $non_cached_ids ) ), count( $non_cached_ids ) ) ); |
3940 | 3940 | |
3941 | 3941 | update_term_cache( $fresh_terms, $update_meta_cache ); |
3942 | 3942 | |