Add single event shortcode

This commit is contained in:
Brian Miyaji
2014-04-02 10:18:22 +11:00
parent cf519c4e25
commit c37ab3cdb8
10 changed files with 221 additions and 33 deletions

View File

@@ -16,12 +16,16 @@ class SP_Shortcodes {
public static function init() {
// Define shortcodes
$shortcodes = array(
'countdown' => __CLASS__ . '::countdown',
'event_list' => __CLASS__ . '::event_list',
'event_calendar' => __CLASS__ . '::event_calendar',
'league_table' => __CLASS__ . '::league_table',
'player_list' => __CLASS__ . '::player_list',
'player_gallery' => __CLASS__ . '::player_gallery',
'event' => __CLASS__ . '::event',
'countdown' => __CLASS__ . '::countdown',
'event_list' => __CLASS__ . '::event_list',
'event_calendar' => __CLASS__ . '::event_calendar',
// 'team' => __CLASS__ . '::team',
'league_table' => __CLASS__ . '::league_table',
// 'player' => __CLASS__ . '::player',
'player_list' => __CLASS__ . '::player_list',
'player_gallery' => __CLASS__ . '::player_gallery',
// 'staff' => __CLASS__ . '::staff',
);
foreach ( $shortcodes as $shortcode => $function ) {
@@ -57,6 +61,17 @@ class SP_Shortcodes {
return ob_get_clean();
}
/**
* Event shortcode.
*
* @access public
* @param mixed $atts
* @return string
*/
public static function event( $atts ) {
return self::shortcode_wrapper( array( 'SP_Shortcode_Event', 'output' ), $atts );
}
/**
* Countdown shortcode.
*
@@ -90,6 +105,17 @@ class SP_Shortcodes {
return self::shortcode_wrapper( array( 'SP_Shortcode_Event_List', 'output' ), $atts );
}
/**
* Team shortcode.
*
* @access public
* @param mixed $atts
* @return string
*/
public static function team( $atts ) {
return self::shortcode_wrapper( array( 'SP_Shortcode_Team', 'output' ), $atts );
}
/**
* League table shortcode.
*
@@ -101,6 +127,17 @@ class SP_Shortcodes {
return self::shortcode_wrapper( array( 'SP_Shortcode_League_Table', 'output' ), $atts );
}
/**
* Player shortcode.
*
* @access public
* @param mixed $atts
* @return string
*/
public static function player( $atts ) {
return self::shortcode_wrapper( array( 'SP_Shortcode_Player', 'output' ), $atts );
}
/**
* Player list shortcode.
*
@@ -122,4 +159,15 @@ class SP_Shortcodes {
public static function player_gallery( $atts ) {
return self::shortcode_wrapper( array( 'SP_Shortcode_Player_Gallery', 'output' ), $atts );
}
/**
* Staff shortcode.
*
* @access public
* @param mixed $atts
* @return string
*/
public static function staff( $atts ) {
return self::shortcode_wrapper( array( 'SP_Shortcode_Staff', 'output' ), $atts );
}
}