WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Admin sort (4 posts)

  1. Hockeyguy1925
    Member
    Posted 1 year ago #

    Hi Tobias,
    Just out of curiosity, as I was unable to locate any documentation on this.I have two questions. 1)Currently on back end in admin area of tablepress, the list of tables currently sort by table ID. I know I can click on Table name to sort by that, but is there a spot you can lead me to within files that I can change sorting to always sort by table name. 2) is there a spot within php files that I can change number of tables shown per page in backend?

    If I have some how missed documentation on this please lead me to it and I will gladly read.

    Thank you, as always, for your great work and continuous effort on this project. I put review and rating in this morning.

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your questions.

    I'll start with the second one, as that's pretty easy :-) This is core WordPress functionality, so you'll just to click on the "Screen Options" tab in the top right corner of the screen. There, you can select, how many tables you want to see on the "All tables" screen.

    Setting a default sort order is more tricky and does indeed require a code change in TablePress. Now, just so that you know, I generally don't recommend this, as you would lose this change after each update of TablePress and would have to re-apply it.
    The necessary change is in the file /views/view-list.php. There, change line 663 from

    wp_reset_vars( array( 'orderby', 'order', 's' ) );

    to

    wp_reset_vars( array( 'orderby', 'order', 's' ) );
    if ( ! $orderby && ! $order ) {
      $orderby = 'name';
      $order = 'asc';
    }

    Regards,
    Tobias

  3. Hockeyguy1925
    Member
    Posted 1 year ago #

    Thanks Tobias. Works perfectly. I will save email so I have a copy of code for customization.

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    very nice! :-) Great to hear that this helped!

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags