Support » Plugin: New User Approve » WordPress 4.4 – User Approved Filter Broke

Viewing 15 replies - 1 through 15 (of 17 total)
  • +1. Agreed. I was just coming here to ask for this functionality to be brought back/fixed!

    +1 Same problems with WordPress 4.4
    Any help would be greatly appreciated!

    If you need to use the filter, this is an ugly workaround that worked for me.

    Try use the filter and notice your url changes to something similar to…


    wp-admin/users.php?s&action=-1&new_role&pw-status-query-submit=Filter&new_user_approve_filter&paged=1&action2=-1&new_role2

    Change new_user_approve_filter to one of the following

    new_user_approve_filter=pending
    new_user_approve_filter=approved
    new_user_approve_filter=denied

    Making

    wp-admin/users.php?s&action=-1&new_role&pw-status-query-submit=Filter&new_user_approve_filter=pending&paged=1&action2=-1&new_role2

    wp-admin/users.php?s&action=-1&new_role&pw-status-query-submit=Filter&new_user_approve_filter=approved&paged=1&action2=-1&new_role2

    wp-admin/users.php?s&action=-1&new_role&pw-status-query-submit=Filter&new_user_approve_filter=denied&paged=1&action2=-1&new_role2

    Respectively…

    +1 I have also seen this since upgrading to WP 4.4 It has been going on a month and I was hoping for a plugin update to fix this.

    VaciDesign, where did you make these modifications?

    @bd.home just edit your browser url following my previous post.

    Here is another forum from 11 months ago… https://wordpress.org/support/topic/user-filter-not-working

    Okay this worked for me…

    wp-content/plugins/new-user-approve/includes/user-list.php

    Line 159 replace

    /**
    	 * Add a filter to the user table to filter by user status
    	 *
    	 * @uses restrict_manage_users
    	 */
    	public function status_filter() {
    		$filter_button = submit_button( __( 'Filter', 'new-user-approve' ), 'button', 'pw-status-query-submit', false, array( 'id' => 'pw-status-query-submit' ) );
    		$filtered_status = ( isset( $_GET['new_user_approve_filter'] ) ) ? esc_attr( $_GET['new_user_approve_filter'] ) : '';
    
    		?>
    		<label class="screen-reader-text"
    			   for="new_user_approve_filter"><?php _e( 'View all users', 'new-user-approve' ); ?></label>
    		<select id="new_user_approve_filter" name="new_user_approve_filter" style="float: none; margin: 0 0 0 15px;">
    			<option value=""><?php _e( 'View all users', 'new-user-approve' ); ?></option>
    			<?php foreach ( pw_new_user_approve()->get_valid_statuses() as $status ) : ?>
    				<option
    					value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $filtered_status ); ?>><?php echo esc_html( $status ); ?></option>
    			<?php endforeach; ?>
    		</select>
    		<?php echo apply_filters( 'new_user_approve_filter_button', $filter_button ); ?>
    		<style>
    			#pw-status-query-submit {
    				float: right;
    				margin: 2px 0 0 5px;
    			}
    		</style>
    	<?php
    	}

    with

    /**
    	 * Add a filter to the user table to filter by user status
    	 *
    	 * @uses restrict_manage_users
    	 */
    	public function status_filter() {
    		$filtered_status = ( isset( $_GET['new_user_approve_filter'] ) ) ? esc_attr( $_GET['new_user_approve_filter'] ) : '';
    
    		?>
    
    		<label class="screen-reader-text"
    			   for="new_user_approve_filter"><?php _e( 'View all users', 'new-user-approve' ); ?></label>
    		<select id="new_user_approve_filter" name="new_user_approve_filter" style="float: none; margin: 0 0 0 15px;">
    			<option value=""><?php _e( 'View all users', 'new-user-approve' ); ?></option>
    			<?php foreach ( pw_new_user_approve()->get_valid_statuses() as $status ) : ?>
    				<option
    					value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $filtered_status ); ?>><?php echo esc_html( $status ); ?></option>
    			<?php endforeach; ?>
    		</select>
    		<button type="button" name="filter_status" onclick="filterstatus()" id="filter_status" class="button" value="Filter">Filter</button>
    		<style>
    			#pw-status-query-submit {
    				float: right;
    				margin: 2px 0 0 5px;
    			}
    		</style>
    		<script>
    		function filterstatus() {
    			var url = window.location.href;
    			var finalurl = '';
    			var e = document.getElementById("new_user_approve_filter");
    			var strUser = e.options[e.selectedIndex].value;
    			finalurl = url.replace("&new_user_approve_filter=pending", "");
    			if(url.split('/').pop()=='users.php') {finalurl = finalurl.concat('?');}
    			finalurl = finalurl.concat('&new_user_approve_filter='+strUser);
    			window.location.href = finalurl;
    		}
    		</script>
    	<?php
    	}

    Brilliant! Thank you @VaciDesign, this worked!

    Yes;it’s wotks thank you @VaciDesign

    Even though it works, there’s a little logic hickup in the code that won’t break it but just for neatness sake you can change the line:

    finalurl = url.replace(“&new_user_approve_filter=pending”, “”);

    to

    finalurl = url.replace(“&new_user_approve_filter=pending”, “”);
    finalurl = finalurl.replace(“&new_user_approve_filter=approved”, “”);
    finalurl = finalurl.replace(“&new_user_approve_filter=denied”, “”);
    finalurl = finalurl.replace(“&new_user_approve_filter”, “”);

    Glad the solution worked for you!

    Any plan to fix the bug?

    Worked for me too. Thanks, VaciDesign!

    Hi
    i have new wp-and woocommerce but this plugin doesnt work.

    1 the filter doesnt work,every user enters free after registration
    2 there is the email for admin:ok
    3 if in Setting Woocommece i set Email for New User it arrive at once and then if i approve the new user ( already enterd) arrive alsoa new email to the customer
    4 if i in the Setting dont click the Eamil fo the new user….the email woocommerce for new user doesnt arrive and also dont arrive the email for customer if i approve ( always user already enterd).
    I ask helping…….bcz i need is plugin.
    thx in advance to all…..

    Chris Hardie

    (@chrishardie)

    This issue is also being tracked at https://github.com/picklewagon/new-user-approve/issues/42

    I created a non-Javascript patch that fixes the issue in https://github.com/picklewagon/new-user-approve/pull/43

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘WordPress 4.4 – User Approved Filter Broke’ is closed to new replies.