Skip to content

Commit

Permalink
Don't load admin notice when DOING_AJAX
Browse files Browse the repository at this point in the history
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
boonebgorges committed May 2, 2014
1 parent 8474ba7 commit beeadb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/attachments.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit beeadb5

Please sign in to comment.