Fix typos

This commit is contained in:
Brian Miyaji
2014-03-18 21:28:17 +11:00
parent 8112484074
commit 7725c80b6c
6 changed files with 18 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
function sportspress_admin_init() { function sportspress_admin_init() {
$post_types = array( $post_types = array(
'sp_event', 'sp_event',
'sp_calendar',
'sp_team', 'sp_team',
'sp_table', 'sp_table',
'sp_player', 'sp_player',

View File

@@ -4,7 +4,7 @@ function sportspress_define_globals() {
// Options // Options
global $sportspress_options; global $sportspress_options;
$sportspress_options = get_option( 'sportspress' ); $sportspress_options = (array)get_option( 'sportspress', array() );
// Continents // Continents
global $sportspress_continents; global $sportspress_continents;

View File

@@ -52,4 +52,4 @@ class SportsPressGeneralSettingsPage {
} }
if ( is_admin() ) if ( is_admin() )
$sportspress_event_settings_page = new SportsPressGeneralSettingsPage(); $sportspress_general_settings_page = new SportsPressGeneralSettingsPage();

View File

@@ -187,4 +187,4 @@ class SportsPressPlayerSettingsPage {
} }
if ( is_admin() ) if ( is_admin() )
$sportspress_event_settings_page = new SportsPressPlayerSettingsPage(); $sportspress_player_settings_page = new SportsPressPlayerSettingsPage();

View File

@@ -3,6 +3,7 @@ class SportsPressTextSettingsPage {
public function __construct() { public function __construct() {
global $sportspress_options; global $sportspress_options;
$this->options =& $sportspress_options; $this->options =& $sportspress_options;
$this->strings = array( $this->strings = array(
array( 'league', __( 'League', 'sportspress' ) ), array( 'league', __( 'League', 'sportspress' ) ),
array( 'season', __( 'Season', 'sportspress' ) ), array( 'season', __( 'Season', 'sportspress' ) ),
@@ -14,9 +15,16 @@ class SportsPressTextSettingsPage {
array( 'pos', __( 'Pos', 'sportspress' ) ), array( 'pos', __( 'Pos', 'sportspress' ) ),
array( 'current_team', __( 'Current Team', 'sportspress' ) ), array( 'current_team', __( 'Current Team', 'sportspress' ) ),
); );
usort( $this->strings, array( $this, 'compare_label' ) );
add_action( 'admin_init', array( $this, 'page_init' ), 1 ); add_action( 'admin_init', array( $this, 'page_init' ), 1 );
} }
private function compare_label( $a, $b ) {
return strcmp( $a[1], $b[1] );
}
function page_init() { function page_init() {
register_setting( register_setting(
'sportspress_text', 'sportspress_text',
@@ -25,8 +33,8 @@ class SportsPressTextSettingsPage {
); );
add_settings_section( add_settings_section(
'string', 'text',
__( 'Strings', 'sportspress' ), __( 'Text Settings', 'sportspress' ),
'', '',
'sportspress_text' 'sportspress_text'
); );
@@ -35,14 +43,14 @@ class SportsPressTextSettingsPage {
add_settings_field( add_settings_field(
$string[0], $string[0],
$string[1], $string[1],
array( $this, 'string_callback' ), array( $this, 'text_callback' ),
'sportspress_text', 'sportspress_text',
'string' 'text'
); );
endforeach; endforeach;
} }
public function string_callback( $test ) { public function text_callback( $test ) {
$string = array_shift( $this->strings ); $string = array_shift( $this->strings );
$key = $string[0]; $key = $string[0];
$placeholder = $string[1]; $placeholder = $string[1];

View File

@@ -52,7 +52,7 @@ function sportspress_options() {
function sportspress_options_validate( $input ) { function sportspress_options_validate( $input ) {
$options = (array)get_option( 'sportspress' ); $options = (array)get_option( 'sportspress', array() );
if ( isset( $input['sport'] ) && sportspress_array_value( $options, 'sport', null ) != sportspress_array_value( $input, 'sport', null ) ): if ( isset( $input['sport'] ) && sportspress_array_value( $options, 'sport', null ) != sportspress_array_value( $input, 'sport', null ) ):