Action hook 'user_new_form'

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

View Source

user_new_form

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 664

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
add_action('user_new_form', 'my_custom_function', 10, 1);

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

Source Code Context

wp-admin/user-new.php:664 - How this hook is used in WordPress core
<?php
 659  	<?php } ?>
 660  </table>
 661  
 662  	<?php
 663  	/** This action is documented in wp-admin/user-new.php */
 664  	do_action( 'user_new_form', 'add-new-user' );
 665  	?>
 666  
 667  	<?php submit_button( __( 'Add User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
 668  
 669  </form>

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.