mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Improve sanitize_post() performance. Perform raw filtering only once. Add filter check to eliminate double filtering. Props johanee. fixes #10972 see #10801
git-svn-id: https://develop.svn.wordpress.org/trunk@12062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2360,9 +2360,15 @@ class WP_Query {
|
||||
if ( !$q['suppress_filters'] )
|
||||
$this->posts = apply_filters('the_posts', $this->posts);
|
||||
|
||||
$this->post_count = count($this->posts);
|
||||
|
||||
// Sanitize before caching so it'll only get done once
|
||||
for ($i = 0; $i < $this->post_count; $i++) {
|
||||
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
|
||||
}
|
||||
|
||||
update_post_caches($this->posts);
|
||||
|
||||
$this->post_count = count($this->posts);
|
||||
if ($this->post_count > 0) {
|
||||
$this->post = $this->posts[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user