Merge globals into single file, load options, and add text settings page

This commit is contained in:
Brian Miyaji
2014-03-18 16:39:53 +11:00
parent ee33f7b630
commit 37ebe39620
25 changed files with 748 additions and 497 deletions

View File

@@ -2,8 +2,8 @@
if ( !function_exists( 'sportspress_events_list' ) ) {
function sportspress_events_list( $id = null, $args = '' ) {
$options = get_option( 'sportspress' );
$main_result = sportspress_array_value( $options, 'main_result', null );
global $sportspress_options;
$main_result = sportspress_array_value( $sportspress_options, 'main_result', null );
$defaults = array(
'show_all_events_link' => false,
@@ -125,3 +125,17 @@ if ( !function_exists( 'sportspress_events_list' ) ) {
}
}
function sportspress_events_list_shortcode( $atts ) {
if ( isset( $atts['id'] ) ):
$id = $atts['id'];
unset( $atts['id'] );
elseif( isset( $atts[0] ) ):
$id = $atts[0];
unset( $atts[0] );
else:
$id = null;
endif;
return sportspress_events_list( $id, $atts );
}
add_shortcode('events-list', 'sportspress_events_list_shortcode');