237 | | $users_have_content = false; |
238 | | if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { |
239 | | $users_have_content = true; |
240 | | } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { |
241 | | $users_have_content = true; |
| 237 | /** |
| 238 | * Filter to setup `$users_have_content`, also known as the "users have content" flag, before WordPress default checks. |
| 239 | * |
| 240 | * @since 5.2.0 |
| 241 | * |
| 242 | * @param boolean $users_have_content The flag for users have content. Default is `false`. |
| 243 | * @param int[] $userids Array of IDs for users being deleted. |
| 244 | */ |
| 245 | $users_have_content = apply_filters( 'users_have_content', false, $userids ); |
| 246 | |
| 247 | if ( ! $users_have_content ) { |
| 248 | if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { |
| 249 | $users_have_content = true; |
| 250 | } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { |
| 251 | $users_have_content = true; |
| 252 | } |