Initialize settings classes

This commit is contained in:
Brian Miyaji
2014-03-27 03:10:04 +11:00
parent 690ba1463f
commit d3b27c8c73
33 changed files with 6294 additions and 89 deletions

View File

@@ -0,0 +1,69 @@
<?php
/**
* SportsPress General Settings
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 0.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'SP_Settings_General' ) ) :
/**
* SP_Admin_Settings_General
*/
class SP_Settings_General extends SP_Settings_Page {
/**
* Constructor.
*/
public function __construct() {
$this->id = 'general';
$this->label = __( 'General', 'sportspress' );
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
}
/**
* Get settings array
*
* @return array
*/
public function get_settings() {
return apply_filters( 'sportspress_general_settings', array(
array( 'title' => __( 'General Options', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
array(
'title' => __( 'Tables', 'sportspress' ),
'desc' => __( 'Responsive', 'sportspress' ),
'id' => 'sportspress_tables_responsive',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
),
array(
'desc' => __( 'Sortable', 'sportspress' ),
'id' => 'sportspress_tables_sortable',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'show_if_checked' => 'option',
),
array( 'type' => 'sectionend', 'id' => 'general_options' ),
)); // End general settings
}
}
endif;
return new SP_Settings_General();