Action hook 'user_new_form_tag'

in WP Core File wp-admin/user-new.php at line 522

View Source

user_new_form_tag

Action Hook
Description
Fires at the end of the new user form. Passes a contextual string to make both types of new user forms uniquely targetable. Contexts are 'add-existing-user' (Multisite), and 'add-new-user' (single site and network admin).

Hook Information

File Location wp-admin/user-new.php View on GitHub
Hook Type Action
Line Number 522

Hook Parameters

Type Name Description
string $type A contextual string specifying which type of new user form the hook follows.

Usage Examples

Basic Usage
<?php
// Hook into user_new_form_tag
add_action('user_new_form_tag', 'my_custom_function', 10, 1);

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

Source Code Context

wp-admin/user-new.php:522 - How this hook is used in WordPress core
<?php
 517  	?>
 518  <p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p>
 519  <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"
 520  	<?php
 521  	/** This action is documented in wp-admin/user-new.php */
 522  	do_action( 'user_new_form_tag' );
 523  	?>
 524  >
 525  <input name="action" type="hidden" value="createuser" />
 526  	<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
 527  	<?php

PHP Documentation

<?php
/**
	 * Fires at the end of the new user form.
	 *
	 * Passes a contextual string to make both types of new user forms
	 * uniquely targetable. Contexts are 'add-existing-user' (Multisite),
	 * and 'add-new-user' (single site and network admin).
	 *
	 * @since 3.7.0
	 *
	 * @param string $type A contextual string specifying which type of new user form the hook follows.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-admin/user-new.php
Related Hooks

Related hooks will be displayed here in future updates.