WordPress.org

Ready to get started?Download WordPress

Forums

ThreeWP Activity Monitor
Sort Login Statistics within User List (2 posts)

  1. whiteorb
    Member
    Posted 2 years ago #

    I'd like to sort the latest Login Statistics on the user list. I've tried retrieving the information from ThreeWP_Activity_Monitor.php but have been unsuccessful. I'm able to cause the list to sort but the information does not correspond appropriately. I think I may have the meta_key incorrect. Any idea how I could resolve this?

    http://i.imgur.com/h3ZWY.png

    function user_column_sortable($columns) {
              $custom = array(
          // meta column id => sortby value used in query
    		  '3wp_activity_monitor'    => 'latest_login',
              );
          return wp_parse_args($custom, $columns);
    }
    add_filter( 'manage_users_sortable_columns', 'user_column_sortable' );
    
    function sortable_user_column( $vars ) {
            if ( isset( $vars['orderby'] ) && 'latest_login' == $vars['orderby'] ) {
                    $vars = array_merge( $vars, array(
                            'meta_key' => latest_login,
                            'orderby' => 'meta_value'
                    ) );
            }
            return $vars;
    }
    add_filter( 'request', 'sortable_user_column' );

    http://wordpress.org/extend/plugins/threewp-activity-monitor/

  2. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    I doubt this will work, since the user data is not stored in the wp_usermeta table, but completely separately in wp_3wp_activity_monitor_user_statistics.

    It is stored in another table so that the plugin can be completely uninstalled without leaving behind any trash.

    You have a point, though. I'll see if I can solve this problem at the next update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic