Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author DBAR Productions

    (@dbar-productions)

    The sheets are sorted by date, more specifically the first date for each sheet.

    There is no built-in option to change that. However, there is a filter hook in place to allow themes or plugins to modify the sheets after they are retrieved from the database, and before the list of sheets is displayed.

    See line 241 of class-pta_sus_public.php for the filter hook. You can add a simple bit of code to your theme’s functions.php file to hook into that filter and sort the array of sheets by any field you want. The $sheets variable will be an array of sheet objects, so simplest way to sort would be with a custom usort function.

    Thread Starter ratputin

    (@ratputin)

    OK. I was thinking is was a short code option that I had missed.

    Thanks for the response.

    Plugin Author DBAR Productions

    (@dbar-productions)

    Here is the code you can copy and paste into to your theme’s functions.php file:

    function pta_custom_sort_by_title($a, $b) {
    	return strcmp($a->title, $b->title);
    }
    function pta_sus_sort_sheets_by_title($sheets, $atts) {
    	usort($sheets, 'pta_custom_sort_by_title');
    	return $sheets;
    }
    add_filter('pta_sus_display_active_sheets', 'pta_sus_sort_sheets_by_title', 10, 2);

    It’s best if you use a child theme so it doesn’t get erased the next time you update your theme.

    You could also put this code into a simple one-file plugin, I’ll send that to you via email.

    Thread Starter ratputin

    (@ratputin)

    That worked spectacularly well! Paypal Donation sent. Thank you for the excellent CS!

    Plugin Author DBAR Productions

    (@dbar-productions)

    Thanks for the very generous donation!

    We need more WordPress users like you!

    Thread Starter ratputin

    (@ratputin)

    Seeing as you:

    a) responded very quickly
    b) offered a solid solution
    c) were willing help me with it
    d) helped me make a deadline
    e) gave me a piece of code that I will be able to dissect and learn from

    Then it was too little. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sign up list order?’ is closed to new replies.