+
'',
- 'table' => '',
- 'list' => ''
- );
-
- return apply_filters( 'sportspress_default_display_options', $defaults );
-
-} // end sportspress_default_display_options
-
-/**
- * Provides default values for the Statistics.
- */
function sportspress_default_stats() {
$defaults = array(
@@ -107,80 +58,19 @@ function sportspress_default_stats() {
return apply_filters( 'sportspress_default_stats', $defaults );
-} // end sportspress_default_stats
+}
-/**
- * Initializes the theme's display options page by registering the Sections,
- * Fields, and Settings.
- *
- * This function is registered with the 'admin_init' hook.
- */
-function sportspress_initialize_theme_options() {
-
- // If the theme options don't exist, create them.
- if ( false == get_option( 'sportspress_options' ) ) {
- add_option( 'sportspress_options', apply_filters( 'sportspress_default_display_options', sportspress_default_display_options() ) );
- } // end if
-
- // First, we register a section. This is necessary since all future options must belong to a
- add_settings_section(
- 'general_settings_section', // ID used to identify this section and with which to register options
- __( 'Display Options', 'sportspress' ), // Title to be displayed on the administration page
- '', // Callback used to render the description of the section
- 'sportspress_options' // Page on which to add this section of options
- );
-
- // Next, we'll introduce the fields for toggling the visibility of content elements.
- add_settings_field(
- 'staff', // ID used to identify the field throughout the theme
- __( 'Staff', 'sportspress' ), // The label to the left of the option interface element
- 'sportspress_toggle_staff_callback', // The name of the function responsible for rendering the option interface
- 'sportspress_options', // The page on which this option will be displayed
- 'general_settings_section'
- );
-
- add_settings_field(
- 'table',
- __( 'League Tables', 'sportspress' ),
- 'sportspress_toggle_table_callback',
- 'sportspress_options',
- 'general_settings_section'
- );
-
- add_settings_field(
- 'list',
- __( 'Player Lists', 'sportspress' ),
- 'sportspress_toggle_list_callback',
- 'sportspress_options',
- 'general_settings_section'
- );
-
- // Finally, we register the fields with WordPress
- register_setting(
- 'sportspress_options',
- 'sportspress_options'
- );
-
-} // end sportspress_initialize_theme_options
-add_action( 'admin_init', 'sportspress_initialize_theme_options' );
-
-/**
- * Initializes the theme's social options by registering the Sections,
- * Fields, and Settings.
- *
- * This function is registered with the 'admin_init' hook.
- */
function sportspress_intialize_stats() {
if( false == get_option( 'sportspress_stats' ) ) {
add_option( 'sportspress_stats', apply_filters( 'sportspress_default_stats', sportspress_default_stats() ) );
- } // end if
+ }
add_settings_section(
- 'sportspress_stats', // ID used to identify this section and with which to register options
- '', // Title to be displayed on the administration page
- '', // Callback used to render the description of the section
- 'sportspress_stats' // Page on which to add this section of options
+ 'sportspress_stats',
+ '',
+ '',
+ 'sportspress_stats'
);
add_settings_field(
@@ -212,49 +102,9 @@ function sportspress_intialize_stats() {
'sportspress_stats'
);
-} // end sportspress_intialize_stats
+}
add_action( 'admin_init', 'sportspress_intialize_stats' );
-/* ------------------------------------------------------------------------ *
- * Field Callbacks
- * ------------------------------------------------------------------------ */
-
-/**
- * This function renders the interface elements for toggling the visibility of the header element.
- *
- * It accepts an array or arguments and expects the first element in the array to be the description
- * to be displayed next to the checkbox.
- */
-function sportspress_toggle_staff_callback() {
-
- $options = get_option('sportspress_options');
-
- $html = '';
-
- echo $html;
-
-} // end sportspress_toggle_staff_callback
-
-function sportspress_toggle_table_callback() {
-
- $options = get_option('sportspress_options');
-
- $html = '';
-
- echo $html;
-
-} // end sportspress_toggle_table_callback
-
-function sportspress_toggle_list_callback() {
-
- $options = get_option('sportspress_options');
-
- $html = '';
-
- echo $html;
-
-} // end sportspress_toggle_list_callback
-
function sportspress_team_stats_callback() {
sportspress_render_option_field( 'sportspress_stats', 'team', 'textarea' );
}
@@ -267,36 +117,4 @@ function sportspress_player_stats_callback() {
sportspress_render_option_field( 'sportspress_stats', 'player', 'textarea' );
}
-/* ------------------------------------------------------------------------ *
- * Setting Callbacks
- * ------------------------------------------------------------------------ */
-
-/**
- * Sanitization callback for the social options. Since each of the social options are text inputs,
- * this function loops through the incoming option and strips all tags and slashes from the value
- * before serializing it.
- *
- * @params $input The unsanitized collection of options.
- *
- * @returns The collection of sanitized values.
- */
-function sportspress_sanitize_stats( $input ) {
-
- // Define the array for the updated options
- $output = array();
-
- // Loop through each of the options sanitizing the data
- foreach( $input as $key => $val ) {
-
- if( isset ( $input[$key] ) ) {
- $output[$key] = esc_url_raw( strip_tags( stripslashes( $input[$key] ) ) );
- } // end if
-
- } // end foreach
-
- // Return the new collection
- return apply_filters( 'sportspress_sanitize_stats', $output, $input );
-
-} // end sportspress_sanitize_stats
-
?>
\ No newline at end of file
diff --git a/sportspress.php b/sportspress.php
index cea65d50..fb687cae 100644
--- a/sportspress.php
+++ b/sportspress.php
@@ -6,7 +6,7 @@
Plugin Name: SportsPress
Plugin URI: http://sportspress.com/sportspress
Description: Currently in development.
-Version: 0.1
+Version: 1.0
Author: ThemeBoy
Author URI: http://sportspress.com
License: GPL2
@@ -18,7 +18,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
-define( 'SPORTSPRESS_VERSION', '0.1' );
+define( 'SPORTSPRESS_VERSION', '1.0' );
define( 'SPORTSPRESS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Libraries
diff --git a/table.php b/table.php
index c0716cab..24f2103b 100644
--- a/table.php
+++ b/table.php
@@ -3,7 +3,7 @@ function sp_table_cpt_init() {
$name = __( 'League Tables', 'sportspress' );
$singular_name = __( 'League Table', 'sportspress' );
$lowercase_name = __( 'league tables', 'sportspress' );
- $labels = sp_cpt_labels( $name, $singular_name, $lowercase_name );
+ $labels = sp_cpt_labels( $name, $singular_name, $lowercase_name, true );
$args = array(
'label' => $name,
'labels' => $labels,
@@ -11,7 +11,8 @@ function sp_table_cpt_init() {
'hierarchical' => false,
'supports' => array( 'title', 'author' ),
'register_meta_box_cb' => 'sp_table_meta_init',
- 'rewrite' => array( 'slug' => 'table' )
+ 'rewrite' => array( 'slug' => 'table' ),
+ 'show_in_menu' => 'edit.php?post_type=sp_team'
);
register_post_type( 'sp_table', $args );
}