]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/admin-post.php
WordPress 3.7.2
[autoinstalls/wordpress.git] / wp-admin / admin-post.php
index f4af998e334b21468f42da913f356bb1cab6915e..710399407382fa483e296d32adcc6eab7a2a070e 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * WordPress Administration Generic POST Handler.
+ * WordPress Generic Request (POST/GET) Handler
+ *
+ * Intended for form submission handling in themes and plugins.
  *
  * @package WordPress
  * @subpackage Administration
@@ -12,13 +14,17 @@ define('WP_ADMIN', true);
 if ( defined('ABSPATH') )
        require_once(ABSPATH . 'wp-load.php');
 else
-       require_once('../wp-load.php');
+       require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
+
+/** Allow for cross-domain requests (from the frontend). */
+send_origin_headers();
 
 require_once(ABSPATH . 'wp-admin/includes/admin.php');
 
 nocache_headers();
 
-do_action('admin_init');
+/** This action is documented in wp-admin/admin.php */
+do_action( 'admin_init' );
 
 $action = 'admin_post';
 
@@ -28,4 +34,12 @@ if ( !wp_validate_auth_cookie() )
 if ( !empty($_REQUEST['action']) )
        $action .= '_' . $_REQUEST['action'];
 
-do_action($action);
+/**
+ * Fires the requested handler action.
+ *
+ * admin_post_nopriv_{$_REQUEST['action']} is called for not-logged-in users.
+ * admin_post_{$_REQUEST['action']} is called for logged-in users.
+ *
+ * @since 2.6.0
+ */
+do_action( $action );