71 | | if ( is_user_logged_in() ) |
72 | | do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions |
73 | | else |
74 | | do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions |
75 | | |
| 74 | if ( is_user_logged_in() ) { |
| 75 | /** |
| 76 | * calls AJAX hooks for authenticated users |
| 77 | * |
| 78 | * wp_ajax_<my_action_here> is called with all authenticated ajax queries. |
| 79 | * @link http://codex.wordpress.org/AJAX_in_Plugins |
| 80 | * |
| 81 | * @since 2.1 |
| 82 | */ |
| 83 | do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions |
| 84 | } else { |
| 85 | /** |
| 86 | * calls AJAX hooks for non-authenticated users |
| 87 | * |
| 88 | * wp_ajax_nopriv_<my_action_here> is called for all non-authenticated queries |
| 89 | * @link http://codex.wordpress.org/AJAX_in_Plugins |
| 90 | * |
| 91 | * @since 2.8 |
| 92 | */ |
| 93 | do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions |
| 94 | } |