Created
August 24, 2016 20:04
-
-
Save cliffordp/ee497d1db33cd99960668c71cd08ee41 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Force loading Skeleton Styles on Community Events | |
* for https://theeventscalendar.com/support/forums/topic/skeleton-styles-community-events/ | |
* By Barry 2016-08-24 | |
* From https://gist.github.com/cliffordp/ee497d1db33cd99960668c71cd08ee41 | |
*/ | |
class CE_Skeleton_Styles { | |
static function init() { | |
add_filter( 'tribe_get_single_option', 'CE_Skeleton_Styles::filter_style_mode', 10, 3 ); | |
} | |
static function filter_style_mode( $option, $unused, $option_name ) { | |
if ( 'stylesheetOption' !== $option_name || ! self::is_community_view() ) return $option; | |
remove_filter( 'tribe_get_single_option', 'CE_Skeleton_Styles::filter_style_mode' ); | |
return 'skeleton'; | |
} | |
static function is_community_view() { | |
return ( | |
class_exists( 'Tribe__Events__Community__Main' ) && | |
( tribe_is_community_edit_event_page() || tribe_is_community_my_events_page() ) | |
); | |
} | |
} | |
CE_Skeleton_Styles::init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment