diff --git a/admin/includes/globals.php b/admin/includes/globals.php index 21d2e5c7..26bd5655 100644 --- a/admin/includes/globals.php +++ b/admin/includes/globals.php @@ -6,59 +6,6 @@ function sportspress_define_globals() { $sportspress_options = (array)get_option( 'sportspress', array() ); - // Text - global $sportspress_text_options; - - $sportspress_text_options = array( - __( 'Article', 'sportspress' ), - __( 'Current Team', 'sportspress' ), - __( 'Date', 'sportspress' ), - __( 'Details', 'sportspress' ), - __( 'days', 'sportspress' ), - __( 'Event', 'sportspress' ), - __( 'Friendly', 'sportspress' ), - __( 'hrs', 'sportspress' ), - __( 'League', 'sportspress' ), - __( 'mins', 'sportspress' ), - __( 'Nationality', 'sportspress' ), - __( 'Past Teams', 'sportspress' ), - __( 'Player', 'sportspress' ), - __( 'Position', 'sportspress' ), - __( 'Pos', 'sportspress' ), - __( 'Preview', 'sportspress' ), - __( 'Rank', 'sportspress' ), - __( 'Recap', 'sportspress' ), - __( 'Results', 'sportspress' ), - __( 'Season', 'sportspress' ), - __( 'secs', 'sportspress' ), - __( 'Staff', 'sportspress' ), - __( 'Substitute', 'sportspress' ), - __( 'Team', 'sportspress' ), - __( 'Teams', 'sportspress' ), - __( 'Time', 'sportspress' ), - __( 'Total', 'sportspress' ), - __( 'Venue', 'sportspress' ), - __( 'View all players', 'sportspress' ), - __( 'View all events', 'sportspress' ), - __( 'View full table', 'sportspress' ), - ); - - sort( $sportspress_text_options ); - - // Formats - global $sportspress_formats; - - $sportspress_formats = array( 'event' => array(), 'list' => array() ); - - $sportspress_formats['event']['league'] = __( 'League', 'sportspress' ); - $sportspress_formats['event']['friendly'] = __( 'Friendly', 'sportspress' ); - - $sportspress_formats['calendar']['calendar'] = __( 'Calendar', 'sportspress' ); - $sportspress_formats['calendar']['list'] = __( 'List', 'sportspress' ); - - $sportspress_formats['list']['list'] = __( 'List', 'sportspress' ); - $sportspress_formats['list']['gallery'] = __( 'Gallery', 'sportspress' ); - // Sports global $sportspress_sports; diff --git a/admin/settings/options-text.php b/admin/settings/options-text.php index 995cbcfe..ed6c1b5d 100644 --- a/admin/settings/options-text.php +++ b/admin/settings/options-text.php @@ -1,9 +1,10 @@ options =& $sportspress_options; - $this->strings =& $sportspress_text_options; add_action( 'admin_init', array( $this, 'page_init' ), 1 ); } @@ -21,6 +22,7 @@ class SportsPressTextSettingsPage { 'sportspress_text' ); + $this->strings =& SP()->text->strings; foreach ( $this->strings as $string ): add_settings_field( sanitize_title( $string ), diff --git a/includes/class-sp-countries.php b/includes/class-sp-countries.php index fabcd1ea..7bad13ee 100644 --- a/includes/class-sp-countries.php +++ b/includes/class-sp-countries.php @@ -25,7 +25,6 @@ class SP_Countries { * @return void */ public function __construct() { - $continents = array( __( 'Africa', 'sportspress' ) => array('AO','BF','BI','BJ','BW','CD','CF','CG','CI','CM','CV','DJ','DZ','EG','EH','ER','ET','GA','GH','GM','GN','GQ','GW','KE','KM','LR','LS','LY','MA','MG','ML','MR','MU','MZ','NA','NE','NG','RW','SC','SD','SL','SN','SO','ST','SZ','TD','TG','TN','TZ','UG','ZA','ZM','ZW'), __( 'Asia', 'sportspress' ) => array('AE','AF','AM','AZ','BD','BH','BN','BT','CN','CY','GE','HK','IL','IN','IQ','IR','JO','JP','KG','KH','KP','KR','KW','KZ','LA','LB','LK','MM','MN','MO','MV','MY','NP','OM','PH','PK','QA','SA','SG','TH','TJ','TM','TW','UZ','VN','YE'), diff --git a/includes/class-sp-formats.php b/includes/class-sp-formats.php new file mode 100644 index 00000000..7a514f29 --- /dev/null +++ b/includes/class-sp-formats.php @@ -0,0 +1,40 @@ +formats = apply_filters( 'sportspress_formats', array( + 'event' => array( + 'league' => __( 'League', 'sportspress' ), + 'friendly' => __( 'Friendly', 'sportspress' ), + ), + 'calendar' => array( + 'calendar' => __( 'Calendar', 'sportspress' ), + 'list' => __( 'List', 'sportspress' ), + ), + 'list' => array( + 'list' => __( 'List', 'sportspress' ), + 'gallery' => __( 'Gallery', 'sportspress' ), + ), + )); + } +} diff --git a/includes/class-sp-sports.php b/includes/class-sp-sports.php new file mode 100644 index 00000000..8a4e9bb4 --- /dev/null +++ b/includes/class-sp-sports.php @@ -0,0 +1,28 @@ +sports = apply_filters( 'sportspress_sports', array( + )); + } +} diff --git a/includes/class-sp-text.php b/includes/class-sp-text.php new file mode 100644 index 00000000..2ece5adb --- /dev/null +++ b/includes/class-sp-text.php @@ -0,0 +1,61 @@ +strings = apply_filters( 'sportspress_text', $strings ); + } +} diff --git a/sportspress.php b/sportspress.php index 14503367..2b754dbe 100644 --- a/sportspress.php +++ b/sportspress.php @@ -46,6 +46,11 @@ final class SportsPress { */ public $countries = null; + /** + * @var SP_Text $text + */ + public $text = null; + /** * Main SportsPress Instance * @@ -238,6 +243,7 @@ final class SportsPress { // Classes (used on all pages) include_once( 'includes/class-sp-countries.php' ); // Defines continents and countries + include_once( 'includes/class-sp-text.php' ); // Defines editable strings // Terms include_once( 'admin/terms/venue.php' ); @@ -318,6 +324,9 @@ final class SportsPress { // Load class instances $this->countries = new SP_Countries(); // Countries class + // Load class instances + $this->text = new SP_Text(); // Text class + // Init action do_action( 'sportspress_init' ); }