- Timestamp:
- 12/01/2017 11:35:31 AM (7 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-ajax.php
r42343 r42349 147 147 add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 ); 148 148 149 $action = ( isset( $_REQUEST['action'] ) ) ? $_REQUEST['action'] : ''; 150 149 151 if ( is_user_logged_in() ) { 150 152 // If no action is registered, return a Bad Request response. 151 if ( ! has_action( 'wp_ajax_' . $_REQUEST['action']) ) {153 if ( ! has_action( "wp_ajax_{$action}" ) ) { 152 154 wp_die( '0', 400 ); 153 155 } … … 156 158 * Fires authenticated Ajax actions for logged-in users. 157 159 * 158 * The dynamic portion of the hook name, `$ _REQUEST['action']`,159 * refersto the name of the Ajax action callback being fired.160 * The dynamic portion of the hook name, `$action`, refers 161 * to the name of the Ajax action callback being fired. 160 162 * 161 163 * @since 2.1.0 162 164 */ 163 do_action( 'wp_ajax_' . $_REQUEST['action']);165 do_action( "wp_ajax_{$action}" ); 164 166 } else { 165 167 // If no action is registered, return a Bad Request response. 166 if ( ! has_action( 'wp_ajax_nopriv_' . $_REQUEST['action']) ) {168 if ( ! has_action( "wp_ajax_nopriv_{$action}" ) ) { 167 169 wp_die( '0', 400 ); 168 170 } … … 171 173 * Fires non-authenticated Ajax actions for logged-out users. 172 174 * 173 * The dynamic portion of the hook name, `$ _REQUEST['action']`,174 * refersto the name of the Ajax action callback being fired.175 * The dynamic portion of the hook name, `$action`, refers 176 * to the name of the Ajax action callback being fired. 175 177 * 176 178 * @since 2.8.0 177 179 */ 178 do_action( 'wp_ajax_nopriv_' . $_REQUEST['action']);180 do_action( "wp_ajax_nopriv_{$action}" ); 179 181 } 180 182 // Default status -
trunk/src/wp-admin/admin.php
r42343 r42349 373 373 374 374 if ( ! empty( $_REQUEST['action'] ) ) { 375 $action = $_REQUEST['action']; 376 375 377 /** 376 378 * Fires when an 'action' request variable is sent. 377 379 * 378 * The dynamic portion of the hook name, `$ _REQUEST['action']`,379 * refers tothe action derived from the `GET` or `POST` request.380 * The dynamic portion of the hook name, `$action`, refers to 381 * the action derived from the `GET` or `POST` request. 380 382 * 381 383 * @since 2.6.0 382 384 */ 383 do_action( 'admin_action_' . $_REQUEST['action']);384 } 385 do_action( "admin_action_{$action}" ); 386 } -
trunk/src/wp-admin/network/edit.php
r38657 r42349 11 11 require_once( dirname( __FILE__ ) . '/admin.php' ); 12 12 13 if ( empty( $_GET['action'] ) ) { 13 $action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : ''; 14 15 if ( empty( $action ) ) { 14 16 wp_redirect( network_admin_url() ); 15 17 exit; … … 29 31 * Fires the requested handler action. 30 32 * 31 * The dynamic portion of the hook name, `$ _GET['action']`, refers to the name32 * of the requested action .33 * The dynamic portion of the hook name, `$action`, refers to the name 34 * of the requested action derived from the `GET` request. 33 35 * 34 36 * @since 3.1.0 35 37 */ 36 do_action( 'network_admin_edit_' . $_GET['action']);38 do_action( "network_admin_edit_{$action}" ); 37 39 38 40 wp_redirect( network_admin_url() ); -
trunk/src/wp-admin/network/sites.php
r42343 r42349 279 279 $msg = ''; 280 280 if ( isset( $_GET['updated'] ) ) { 281 switch ( $_GET['updated'] ) { 281 $action = $_GET['updated']; 282 283 switch ( $action ) { 282 284 case 'all_notspam': 283 285 $msg = __( 'Sites removed from spam.' ); … … 315 317 default: 316 318 /** 317 * Filters a specific, non-default site-updated message in the Network admin.318 * 319 * The dynamic portion of the hook name, `$ _GET['updated']`, refers to the320 * non-defaultsite update action.319 * Filters a specific, non-default, site-updated message in the Network admin. 320 * 321 * The dynamic portion of the hook name, `$action`, refers to the non-default 322 * site update action. 321 323 * 322 324 * @since 3.1.0 … … 324 326 * @param string $msg The update message. Default 'Settings saved'. 325 327 */ 326 $msg = apply_filters( 'network_sites_updated_message_' . $_GET['updated'], __( 'Settings saved.' ) );328 $msg = apply_filters( "network_sites_updated_message_{$action}", __( 'Settings saved.' ) ); 327 329 break; 328 330 }
Note: See TracChangeset
for help on using the changeset viewer.