Created
September 12, 2019 15:37
-
-
Save joshfeck/6b175e2ceeea60af1ae92011f15fdc42 to your computer and use it in GitHub Desktop.
Post Types Order for Event Espresso 4. Companion to the Post Types Order plugin. This plugin adds a page to re-order Event Espresso events
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 | |
/* | |
Plugin Name: Post Types Order for Event Espresso | |
Description: Companion to the Post Types Order plugin. This plugin adds a page to re-order Event Espresso events | |
Author: Event Espresso support staff | |
Version: 1.0 | |
*/ | |
add_filter( | |
'FHEE__EE_Register_CPTs__get_CPTs__cpts', | |
'ee_modify_show_ui_for_events_cpt' | |
); | |
function ee_modify_show_ui_for_events_cpt( $cpt_registry_array ) { | |
if ( isset( $cpt_registry_array['espresso_events'] ) ) { | |
$cpt_registry_array['espresso_events']['args']['show_ui'] = true; | |
$cpt_registry_array['espresso_events']['args']['show_in_menu'] = true; | |
$cpt_registry_array['espresso_events']['args']['show_in_admin_bar'] = false; | |
} | |
return $cpt_registry_array; | |
} | |
add_action('admin_menu', 'ee_add_reorder_page', 11); | |
function ee_add_reorder_page(){ | |
if(class_exists('CPTO')){ | |
add_submenu_page( | |
'espresso_events', | |
__('Re-Order Events'), | |
__('Re-Order Events'), | |
'ee_edit_events', | |
'order-post-types-espresso_events', | |
array('CPTO', 'SortPage') | |
); | |
} | |
remove_menu_page( | |
'edit.php?post_type=espresso_events' | |
); | |
remove_submenu_page( | |
'edit.php?post_type=espresso_events','post-new.php?post_type=espresso_events' | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment