Created
February 11, 2013 20:40
-
-
Save wpperform/4757417 to your computer and use it in GitHub Desktop.
Genesis Simple Sidebars/Simple Menus support for Events Manager plugin
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: wpPERFORM.com Events Manager Genesis Simple Support | |
Description: Provides support for sidebars created with Genesis Simple Sidebars and menus created with Genesis Simple Menus for the Events Manager plugin | |
Version: 0.2 | |
License: GPL | |
Author: The wpPERFORM.com Team | |
Author URI: http://wpperform.com | |
*/ | |
// replaces supports for events CPT | |
function wpp_events_sidebar() { | |
$wpp_events_sidebar = array('custom-fields','title','editor','excerpt','comments','thumbnail','author','genesis-simple-sidebars','genesis-simple-menus'); | |
return $wpp_events_sidebar; | |
} | |
// replaces supports for location CPT | |
function wpp_events_location_sidebar() { | |
$wpp_events_location_sidebar = array('title','editor','excerpt','custom-fields','comments','thumbnail','author','genesis-simple-sidebars','genesis-simple-menus'); | |
return $wpp_events_location_sidebar; | |
} | |
// check if events function exists | |
if( function_exists( 'wp_events_plugin_init' ) ) { | |
// adds genesis simple sidebars and menus to regular events | |
// if recurring events are enabled, this filter adds genesis simple sidebars to them too | |
add_filter( 'em_cp_event_supports','wpp_events_sidebar' ); | |
// adds genesis simple sidebars and menus to locations if locations are enabled | |
if( get_option('dbem_locations_enabled', true) ) { | |
add_filter( 'em_cp_location_supports','wpp_events_location_sidebar' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment