Action hook 'admin_post_nopriv'

in WP Core File wp-admin/admin-post.php at line 43

View Source

admin_post_nopriv

Action Hook
Description
Fires on a non-authenticated admin post request where no action is supplied.

Hook Information

File Location wp-admin/admin-post.php View on GitHub
Hook Type Action
Line Number 43

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into admin_post_nopriv
add_action('admin_post_nopriv', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-admin/admin-post.php:43 - How this hook is used in WordPress core
<?php
  38  		/**
  39  		 * Fires on a non-authenticated admin post request where no action is supplied.
  40  		 *
  41  		 * @since 2.6.0
  42  		 */
  43  		do_action( 'admin_post_nopriv' );
  44  	} else {
  45  		// If no action is registered, return a Bad Request response.
  46  		if ( ! has_action( "admin_post_nopriv_{$action}" ) ) {
  47  			wp_die( '', 400 );
  48  		}

PHP Documentation

<?php
/**
		 * Fires on a non-authenticated admin post request where no action is supplied.
		 *
		 * @since 2.6.0
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-admin/admin-post.php
Related Hooks

Related hooks will be displayed here in future updates.