Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] Sort Members by "Access Starts"

Simple Membership Plugin › Forums › Simple Membership Plugin › Sort Members by "Access Starts"

Tagged: access, customization, members, php, sort, sorting

  • This topic has 5 replies, 2 voices, and was last updated 6 years, 4 months ago by GreenBandana.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • December 21, 2019 at 7:31 pm #19504
    GreenBandana
    Participant

    I was able to edit the Members page code to add sorting by the header “Access Starts”:

    [your-site]/wp-admin/admin.php?page=simple_wp_membership

    Is there a hook I can add into the functions.php to ensure this change continues even when there are plugin updates?

    Thanks!

    December 26, 2019 at 1:07 am #19523
    admin
    Keymaster

    This is not a request we gotten before. Please let me know where you need an action or filter hook in the code and I will work on adding that for the next release.

    December 26, 2019 at 9:02 pm #19528
    GreenBandana
    Participant

    To be honest, I’m not that advanced of a developer to answer the question. I merely looked at the existing code and saw a possible “gap” and tried a solution, which appears to work. If the plugin itself can be updated, then a hook or filter would be unnecessary.

    In the class.swpm-members.php file, I added the following line which did not exist before.

    'subscription_starts' => array( 'subscription_starts', false ),

    in

    function get_sortable_columns() {
    		return array(
    			'member_id'     => array( 'member_id', true ), //True means already sorted
    			'user_name'     => array( 'user_name', false ),
    			'first_name'    => array( 'first_name', false ),
    			'last_name'     => array( 'last_name', false ),
    			'email'         => array( 'email', false ),
    			'alias'         => array( 'alias', false ),
    			'subscription_starts' => array( 'subscription_starts', false ),
    			'account_state' => array( 'account_state', false ),
    			'last_accessed' => array( 'last_accessed', false ),
    		);
    	}

    The “Access Starts” was included in get_columns() but not get_sortable_columns().

    As mentioned, if this can simply be added to the plugin for the next update, that would be perfect. Otherwise, if you can instruct what we would need to do to preserve this change, that would be great. From my research, it appears it would involve a hook or filter, but I don’t know more than this. Thank you!

    January 9, 2020 at 8:55 am #19583
    GreenBandana
    Participant

    Any thoughts on if this adjustment could be incorporated into a future update of the plugin?

    January 15, 2020 at 11:46 pm #19626
    admin
    Keymaster

    Thank you. This has been added in the new version of the plugin.

    January 16, 2020 at 4:11 am #19628
    GreenBandana
    Participant

    Fantastic, thank you!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy