I have 61 Custom Message Templates but their names appear (I think) in the order they were created. I would very much like to see the list in alphabetical order. I have tried to find a way to do this to no avail. Is this possible?
Note: this is a continuation of a previous support topic. I did not have time to execute solution offered until now and that topic is now closed.
Last Post by Tony January 3, 2023 at 6:43 am
To recap:
I have 61 Custom Message Templates but their names appear (I think) in the order they were created. I would very much like to see the list in alphabetical order. I have tried to find a way to do this to no avail. Is this possible?
Tony wrote:
Oh, I see.
There are filters within EE which will allow you to set the sortable columns on that section.
So adding something like: https://gist.github.com/Pebblo/d40d5baa9aac23dc7b1493ac4335bdbb
To your site will change the ‘Template Name’ column header on that page to be clickable and allow you to sort ASC/DESC.
You can add that to a custom functions plugin on your site, we have some documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/
Post Link: Sort Custom Message Templates by Name
————————————————————-
So far:
* I got your document “How to Create a Site Specific Plugin for your WordPress Site”
* I installed FileZilla
* I was able to follow all the steps in that document (so far as I can tell)
* Here is the pho file I created:
====================================================================
<?php
/*
Plugin Name: Site plugin for Sort_Evnt_Esprsso_Ntfctns.com
Description: Site specific code to create a sort funtion on the Custom Notification Name
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
/* Stop Adding Functions */
====================================================================
* I found and activated the plugin “Site plugin for Sort_Evnt_Esprsso_Ntfctns.com” on my website.
* Still cannot sort on Custom Message Templates > Template Name
* Perhaps I did not understand: https://gist.github.com/Pebblo/d40d5baa9aac23dc7b1493ac4335bdbb
? You wrote “add something like . . . ” which kind of implies I should customize for my site but I do not know how to do that.
Looks like you’ve added a link to the gist into the plugin, is that correct?
You add the code itself into the plugin, not the like. So something like this:
<?php
/*
Plugin Name: Site plugin for Sort_Evnt_Esprsso_Ntfctns.com
Description: Site specific code to create a sort funtion on the Custom Notification Name
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
add_filter('FHEE_manage_event-espresso_page_espresso_messages_sortable_columns', 'tw_ee_messages_sortable_columns', 10, 2);
function tw_ee_messages_sortable_columns($sortable, $screen) {
if( $screen === 'espresso_messages_custom_mtps'){
$sortable['messenger'] = ['MTP_messenger' => false];
$sortable['name'] = ['MTP_name' => true];
}
return $sortable;
}
The support post ‘Sort Custom Message Templates by Name’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.