Created
November 10, 2022 16:12
-
-
Save Pebblo/d40d5baa9aac23dc7b1493ac4335bdbb to your computer and use it in GitHub Desktop.
An example of how to set the Custom Message Templates list table to have the 'Name' column as a sortable column.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include the opening PHP tag if you already have 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment