Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created November 10, 2022 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/d40d5baa9aac23dc7b1493ac4335bdbb to your computer and use it in GitHub Desktop.
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.
<?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