Permalink
Browse files

Don't load admin notice when DOING_AJAX

On certain setups, this could result in the check_is_protected() script running
many times on a pageload, which can be very slow.
  • Loading branch information...
1 parent 8474ba7 commit beeadb50411eacd7738cce87b16482cdaf9e2c0b @boonebgorges committed May 2, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 includes/attachments.php
View
@@ -670,6 +670,10 @@ public static function map_meta_cap_supp( $caps, $cap, $user_id, $args ) {
}
public function admin_notice_init() {
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
+ return;
+ }
+
if ( ! current_user_can( 'delete_users' ) ) {
return;
}

0 comments on commit beeadb5

Please sign in to comment.