WordPress.org

Make WordPress Core

Changeset 10720


Ignore:
Timestamp:
03/05/09 21:43:35 (5 years ago)
Author:
ryan
Message:

Fire nopriv actions from post and ajax handlers when user is not logged in.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r10719 r10720  
    3737            $x->send(); 
    3838    } 
     39 
     40    if ( !empty( $_POST['action']) ) 
     41        do_action( 'wp_ajax_nopriv_' . $_POST['action'] ); 
    3942 
    4043    die('-1'); 
  • trunk/wp-admin/admin-post.php

    r8618 r10720  
    1717require_once(ABSPATH . 'wp-admin/includes/admin.php'); 
    1818 
    19 if ( !wp_validate_auth_cookie() ) 
    20     wp_die(__('Cheatin’ uh?')); 
    21  
    2219nocache_headers(); 
    2320 
     
    2522 
    2623$action = 'admin_post'; 
     24 
     25if ( !wp_validate_auth_cookie() ) 
     26    $action .= '_nopriv'; 
     27 
    2728if ( !empty($_REQUEST['action']) ) 
    2829    $action .= '_' . $_REQUEST['action']; 
Note: See TracChangeset for help on using the changeset viewer.