Make WordPress Core

Ticket #19867: 19867-04.diff

File 19867-04.diff, 1.0 KB (added by norcross, 9 years ago)

abstracts the args being passed to wp_dropdown_user and filters them before being passed into the query

  • users.php

     
    263263                        <?php _e('Delete all content.'); ?></label></li>
    264264                        <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
    265265                        <?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> ';
    266                         wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li>
     266                        // Set the arguments for querying users to assign deleted content to.
     267                        $delete_user_args = array(
     268                                'name' => 'reassign_user',
     269                                'exclude' => array_diff( $userids, array( $current_user->ID ) )
     270                        );
     271                        // Filter the arguments before passing into the query.
     272                        $delete_args = apply_filters( 'dropdown_delete_users_args', $delete_user_args );
     273                        // Run the query with our arguments.
     274                        wp_dropdown_users( $delete_user_args ); ?></li>
    267275                </ul></fieldset>
    268276        <?php endif;
    269277        /**