Skip to content

Instantly share code, notes, and snippets.

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 wpperform/4757417 to your computer and use it in GitHub Desktop.
Save wpperform/4757417 to your computer and use it in GitHub Desktop.
Genesis Simple Sidebars/Simple Menus support for Events Manager plugin
<?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