Modularize!

This commit is contained in:
Brian Miyaji
2015-01-28 14:02:35 +11:00
parent aa0eeae6cd
commit 87baaf7288
35 changed files with 1491 additions and 928 deletions

View File

@@ -23,29 +23,14 @@ class SP_Shortcodes {
'player_details' => __CLASS__ . '::player_details',
'player_statistics' => __CLASS__ . '::player_statistics',
'staff' => __CLASS__ . '::staff',
'event_calendar' => __CLASS__ . '::event_calendar',
'event_list' => __CLASS__ . '::event_list',
'event_blocks' => __CLASS__ . '::event_blocks',
'league_table' => __CLASS__ . '::league_table',
'player_list' => __CLASS__ . '::player_list',
'player_gallery' => __CLASS__ . '::player_gallery',
);
if ( 'yes' == get_option( 'sportspress_load_calendars_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'event_calendar' => __CLASS__ . '::event_calendar',
'event_list' => __CLASS__ . '::event_list',
'event_blocks' => __CLASS__ . '::event_blocks',
));
}
if ( 'yes' == get_option( 'sportspress_load_league_tables_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'league_table' => __CLASS__ . '::league_table',
));
}
if ( 'yes' == get_option( 'sportspress_load_player_lists_module', 'yes' ) ) {
$shortcodes = array_merge( $shortcodes, array(
'player_list' => __CLASS__ . '::player_list',
'player_gallery' => __CLASS__ . '::player_gallery',
));
}
foreach ( $shortcodes as $shortcode => $function ) {
add_shortcode( $shortcode, $function );
}