Filter hook 'users_have_additional_content'

in WP Core File wp-admin/users.php at line 311

View Source

users_have_additional_content

Filter Hook
Description
Filters whether the users being deleted have additional content associated with them outside of the `post_author` and `link_owner` relationships.

Hook Information

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

Hook Parameters

Type Name Description
bool $users_have_additional_content Whether the users have additional content. Default false.
int[] $user_ids Array of IDs for users being deleted.

Usage Examples

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

function my_custom_filter($users_have_additional_content, $user_ids) {
    // Your custom filtering logic here
    return $users_have_additional_content;
}

Source Code Context

wp-admin/users.php:311 - How this hook is used in WordPress core
<?php
 306  		 * @since 5.2.0
 307  		 *
 308  		 * @param bool  $users_have_additional_content Whether the users have additional content. Default false.
 309  		 * @param int[] $user_ids                      Array of IDs for users being deleted.
 310  		 */
 311  		$users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $user_ids );
 312  
 313  		if ( $user_ids && ! $users_have_content ) {
 314  			if ( $wpdb->get_var(
 315  				"SELECT ID FROM {$wpdb->posts}
 316  				WHERE post_author IN( " . implode( ',', $user_ids ) . ' )

PHP Documentation

<?php
/**
		 * Filters whether the users being deleted have additional content
		 * associated with them outside of the `post_author` and `link_owner` relationships.
		 *
		 * @since 5.2.0
		 *
		 * @param bool  $users_have_additional_content Whether the users have additional content. Default false.
		 * @param int[] $user_ids                      Array of IDs for users being deleted.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/users.php
Related Hooks

Related hooks will be displayed here in future updates.