Filter hook 'show_network_site_users_add_new_form'

in WP Core File wp-admin/network/site-users.php at line 351

View Source

show_network_site_users_add_new_form

Filter Hook
Description
Filters whether to show the Add New User form on the Multisite Users screen. Note: While WordPress is moving towards simplifying labels by removing "New" from "Add New X" labels, we keep "Add New User" here to maintain a clear distinction from the "Add Existing User" section above.

Hook Information

File Location wp-admin/network/site-users.php View on GitHub
Hook Type Filter
Line Number 351

Hook Parameters

Type Name Description
bool $bool Whether to show the Add New User form. Default true.

Usage Examples

Basic Usage
<?php
// Hook into show_network_site_users_add_new_form
add_filter('show_network_site_users_add_new_form', 'my_custom_filter', 10, 1);

function my_custom_filter($bool) {
    // Your custom filtering logic here
    return $bool;
}

Source Code Context

wp-admin/network/site-users.php:351 - How this hook is used in WordPress core
<?php
 346   *
 347   * @since 3.1.0
 348   *
 349   * @param bool $bool Whether to show the Add New User form. Default true.
 350   */
 351  if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) :
 352  	?>
 353  <h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2>
 354  <form action="<?php echo esc_url( network_admin_url( 'site-users.php?action=newuser' ) ); ?>" id="newuser" method="post">
 355  	<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
 356  	<table class="form-table" role="presentation">

PHP Documentation

<?php
/**
 * Filters whether to show the Add New User form on the Multisite Users screen.
 *
 * Note: While WordPress is moving towards simplifying labels by removing "New" from "Add New X" labels,
 * we keep "Add New User" here to maintain a clear distinction from the "Add Existing User" section above.
 *
 * @since 3.1.0
 *
 * @param bool $bool Whether to show the Add New User form. Default true.
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/network/site-users.php
Related Hooks

Related hooks will be displayed here in future updates.