WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/23/2016 02:32:18 PM (5 years ago)
Author:
wonderboymusic
Message:

AJAX: add a new function, wp_doing_ajax(), which can replace... (wait for it...) DOING_AJAX checks via the constant.

Props Mte90, sebastian.pisula, swissspidy.
Fixes #25669.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r38313 r38334  
    633633         */
    634634        do_action( 'comment_duplicate_trigger', $commentdata );
    635         if ( defined( 'DOING_AJAX' ) ) {
     635        if ( wp_doing_ajax() ) {
    636636            die( __('Duplicate comment detected; it looks as though you’ve already said that!') );
    637637        }
     
    769769            do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );
    770770
    771             if ( defined('DOING_AJAX') )
     771            if ( wp_doing_ajax() )
    772772                die( __('You are posting comments too quickly. Slow down.') );
    773773
Note: See TracChangeset for help on using the changeset viewer.