WordPress.org

Make WordPress Core

Changeset 28351


Ignore:
Timestamp:
05/08/14 10:59:17 (3 years ago)
Author:
DrewAPicture
Message:

Rename the $action hook in wp-admin/admin-post.php to admin_post{$action}.

Also, clarify documentation of priv vs nopriv prefixing of the hook name.

See #26869.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-post.php

    r28350 r28351  
    2727do_action( 'admin_init' ); 
    2828 
    29 $action = 'admin_post'; 
     29$action = ''; 
    3030 
    3131if ( !wp_validate_auth_cookie() ) 
     
    3838 * Fires the requested handler action. 
    3939 * 
    40  * admin_post_nopriv_{$_REQUEST['action']} is called for not-logged-in users. 
    41  * admin_post_{$_REQUEST['action']} is called for logged-in users. 
     40 * The dynamic portion of the hook name, $action, refers to a combination 
     41 * of whether the user is logged-in or not, and the requested handler action. 
     42 * 
     43 * If the user is logged-out, '_nopriv' will be affixed to the 
     44 * base "admin_post" hook name. If a handler action was passed, that action 
     45 * will also be affixed. 
     46 *  
     47 * For example: 
     48 * Hook combinations fired for logged-out users: 
     49 * `admin_post_nopriv_{$action}` and `admin_post_nopriv` (no action supplied). 
     50 * 
     51 * Hook combinations fired for logged-in users: 
     52 * `admin_post_{$action}` and `admin_post` (no action supplied). 
    4253 * 
    4354 * @since 2.6.0 
    4455 */ 
    45 do_action( $action ); 
     56do_action( "admin_post{$action}" ); 
Note: See TracChangeset for help on using the changeset viewer.