Move sports presets class
This commit is contained in:
33
includes/admin/presets/class-sp-preset-baseball.php
Normal file
33
includes/admin/presets/class-sp-preset-baseball.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* SportsPress Baseball Preset
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! class_exists( 'SP_Preset_Baseball' ) ) :
|
||||
|
||||
/**
|
||||
* SP_Preset_Baseball
|
||||
*/
|
||||
class SP_Preset_Baseball extends SP_Preset_Sport {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'baseball';
|
||||
$this->label = __( 'Baseball', 'sportspress' );
|
||||
|
||||
add_filter( 'sportspress_sport_presets_array', array( $this, 'add_sport_preset' ), 20 );
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
return new SP_Preset_Baseball();
|
||||
33
includes/admin/presets/class-sp-preset-soccer.php
Normal file
33
includes/admin/presets/class-sp-preset-soccer.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* SportsPress Soccer Preset
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! class_exists( 'SP_Preset_Soccer' ) ) :
|
||||
|
||||
/**
|
||||
* SP_Preset_Soccer
|
||||
*/
|
||||
class SP_Preset_Soccer extends SP_Preset_Sport {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'soccer';
|
||||
$this->label = __( 'Association Football (Soccer)', 'sportspress' );
|
||||
|
||||
add_filter( 'sportspress_sport_presets_array', array( $this, 'add_sport_preset' ), 20 );
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
return new SP_Preset_Soccer();
|
||||
33
includes/admin/presets/class-sp-preset-sport.php
Normal file
33
includes/admin/presets/class-sp-preset-sport.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* SportsPress Sport Preset
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 0.8
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! class_exists( 'SP_Preset_Sport' ) ) :
|
||||
|
||||
/**
|
||||
* SP_Preset_Sport
|
||||
*/
|
||||
class SP_Preset_Sport {
|
||||
|
||||
protected $id = '';
|
||||
protected $label = '';
|
||||
|
||||
/**
|
||||
* Add this page to settings
|
||||
*/
|
||||
public function add_sport_preset( $presets ) {
|
||||
$presets[ $this->id ] = $this->label;
|
||||
|
||||
return $presets;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
Reference in New Issue
Block a user