Current Dir: /var/www/html/wp-admin/
[DIR] css [ delete | rename ]
[DIR] images [ delete | rename ]
[DIR] includes [ delete | rename ]
[DIR] js [ delete | rename ]
[DIR] maint [ delete | rename ]
[DIR] network [ delete | rename ]
[DIR] user [ delete | rename ]
[FILE] about.php [ edit | delete | rename ]
[FILE] admin-ajax.php [ edit | delete | rename ]
[FILE] admin-functions.php [ edit | delete | rename ]
[FILE] admin-post.php [ edit | delete | rename ]
[FILE] authorize-application.php [ edit | delete | rename ]
[FILE] credits.php [ edit | delete | rename ]
[FILE] custom-background.php [ edit | delete | rename ]
[FILE] customize.php [ edit | delete | rename ]
[FILE] edit-comments.php [ edit | delete | rename ]
[FILE] edit-form-comment.php [ edit | delete | rename ]
[FILE] edit-tags.php [ edit | delete | rename ]
[FILE] erase-personal-data.php [ edit | delete | rename ]
[FILE] export-personal-data.php [ edit | delete | rename ]
[FILE] export.php [ edit | delete | rename ]
[FILE] freedoms.php [ edit | delete | rename ]
[FILE] install.php [ edit | delete | rename ]
[FILE] link-manager.php [ edit | delete | rename ]
[FILE] load-styles.php [ edit | delete | rename ]
[FILE] media-new.php [ edit | delete | rename ]
[FILE] media-upload.php [ edit | delete | rename ]
[FILE] menu-header.php [ edit | delete | rename ]
[FILE] menu.php [ edit | delete | rename ]
[FILE] moderation.php [ edit | delete | rename ]
[FILE] ms-delete-site.php [ edit | delete | rename ]
[FILE] ms-edit.php [ edit | delete | rename ]
[FILE] ms-themes.php [ edit | delete | rename ]
[FILE] nav-menus.php [ edit | delete | rename ]
[FILE] options-discussion.php [ edit | delete | rename ]
[FILE] options-media.php [ edit | delete | rename ]
[FILE] options-permalink.php [ edit | delete | rename ]
[FILE] options-writing.php [ edit | delete | rename ]
[FILE] options.php [ edit | delete | rename ]
[FILE] plugins.php [ edit | delete | rename ]
[FILE] privacy-policy-guide.php [ edit | delete | rename ]
[FILE] revision.php [ edit | delete | rename ]
[FILE] setup-config.php [ edit | delete | rename ]
[FILE] site-editor.php [ edit | delete | rename ]
[FILE] site-health.php [ edit | delete | rename ]
[FILE] term.php [ edit | delete | rename ]
[FILE] theme-editor.php [ edit | delete | rename ]
[FILE] theme-install.php [ edit | delete | rename ]
[FILE] tools.php [ edit | delete | rename ]
[FILE] update-core.php [ edit | delete | rename ]
[FILE] update.php [ edit | delete | rename ]
[FILE] user-edit.php [ edit | delete | rename ]
[FILE] users.php [ edit | delete | rename ]
[FILE] widgets-form-blocks.php [ edit | delete | rename ]
[FILE] widgets-form.php [ edit | delete | rename ]
[FILE] widgets.php [ edit | delete | rename ]
Viewing: /var/www/html/wp-admin/admin-post.php
<?php
/**
* WordPress Generic Request (POST/GET) Handler
*
* Intended for form submission handling in themes and plugins.
*
* @package WordPress
* @subpackage Administration
*/
/** We are located in WordPress Administration Screens */
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
if ( defined( 'ABSPATH' ) ) {
require_once ABSPATH . 'wp-load.php';
} else {
require_once dirname( __DIR__ ) . '/wp-load.php';
}
/** Allow for cross-domain requests (from the front end). */
send_origin_headers();
require_once ABSPATH . 'wp-admin/includes/admin.php';
nocache_headers();
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
// Reject invalid parameters.
if ( ! is_scalar( $action ) ) {
wp_die( '', 400 );
}
if ( ! is_user_logged_in() ) {
if ( empty( $action ) ) {
/**
* Fires on a non-authenticated admin post request where no action is supplied.
*
* @since 2.6.0
*/
do_action( 'admin_post_nopriv' );
} else {
// If no action is registered, return a Bad Request response.
if ( ! has_action( "admin_post_nopriv_{$action}" ) ) {
wp_die( '', 400 );
}
/**
* Fires on a non-authenticated admin post request for the given action.
*
* The dynamic portion of the hook name, `$action`, refers to the given
* request action.
*
* @since 2.6.0
*/
do_action( "admin_post_nopriv_{$action}" );
}
} else {
if ( empty( $action ) ) {
/**
* Fires on an authenticated admin post request where no action is supplied.
*
* @since 2.6.0
*/
do_action( 'admin_post' );
} else {
// If no action is registered, return a Bad Request response.
if ( ! has_action( "admin_post_{$action}" ) ) {
wp_die( '', 400 );
}
/**
* Fires on an authenticated admin post request for the given action.
*
* The dynamic portion of the hook name, `$action`, refers to the given
* request action.
*
* @since 2.6.0
*/
do_action( "admin_post_{$action}" );
}
}