Plugin Directory

Changeset 2578323


Ignore:
Timestamp:
08/04/2021 07:10:50 PM (5 years ago)
Author:
wpsecuredcom
Message:

Adding first version of my plugin

Location:
secured-wp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • secured-wp/tags/1.5/classes/Views/UsersList.php

    r2578321 r2578323  
    106106                 */
    107107                \add_filter( 'manage_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] );
    108                 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] );
     108
     109                /**
     110                 * External object cache means there is no way to use DB for sorting that column
     111                 * There is an add_filter('all' ... hook which could be used to store data in
     112                 * lets say UserMeta - but that is a bit extreme ...
     113                 */
     114                if ( ! \wp_using_ext_object_cache() ) {
     115                    \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] );
     116                    /**
     117                     * Sort option for locked users
     118                     */
     119                    \add_action( 'pre_user_query', [ __CLASS__, 'sortLockedUsers' ], 10, 1 );
     120                }
     121
    109122                \add_filter( 'manage_users_custom_column', [ __CLASS__, 'lockedUserColumnData' ], 10, 3 );
    110123
     
    112125                    \add_filter( 'wpmu_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] );
    113126                }
    114                 /**
    115                  * Sort option for locked users
    116                  */
    117                 \add_action( 'pre_user_query', [ __CLASS__, 'sortLockedUsers' ], 10, 1 );
    118127            }
    119128
  • secured-wp/trunk/classes/Views/UsersList.php

    r2578321 r2578323  
    106106                 */
    107107                \add_filter( 'manage_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] );
    108                 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] );
     108
     109                /**
     110                 * External object cache means there is no way to use DB for sorting that column
     111                 * There is an add_filter('all' ... hook which could be used to store data in
     112                 * lets say UserMeta - but that is a bit extreme ...
     113                 */
     114                if ( ! \wp_using_ext_object_cache() ) {
     115                    \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] );
     116                    /**
     117                     * Sort option for locked users
     118                     */
     119                    \add_action( 'pre_user_query', [ __CLASS__, 'sortLockedUsers' ], 10, 1 );
     120                }
     121
    109122                \add_filter( 'manage_users_custom_column', [ __CLASS__, 'lockedUserColumnData' ], 10, 3 );
    110123
     
    112125                    \add_filter( 'wpmu_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] );
    113126                }
    114                 /**
    115                  * Sort option for locked users
    116                  */
    117                 \add_action( 'pre_user_query', [ __CLASS__, 'sortLockedUsers' ], 10, 1 );
    118127            }
    119128
Note: See TracChangeset for help on using the changeset viewer.