D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
cwd
/
wp-content
/
themes
/
aeen
/
inc
/
customizer
/
Filename :
customizer.php
back
Copy
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\aeen\Customizer; /** * Adds the individual sections, settings, and controls to the theme customizer */ class RDTheme_Customizer { // Get our default values protected $defaults; protected static $instance = null; public function __construct() { // Get our Customizer defaults // Register Panels add_action( 'customize_register', array( $this, 'add_customizer_panels' ) ); // Register sections add_action( 'customize_register', array( $this, 'add_customizer_sections' ) ); } public static function instance() { if (null == self::$instance) { self::$instance = new self(); } return self::$instance; } public function populated_default_data() { $this->defaults = rttheme_generate_defaults(); } /** * Customizer Panels */ public function add_customizer_panels( $wp_customize ) { // Add Layput Panel $wp_customize->add_panel( 'rttheme_layouts_defaults', array( 'title' => __( 'Layout Settings', 'aeen' ), 'description' => esc_html__( 'Adjust the overall layout for your site.', 'aeen' ), 'priority' => 5, ) ); // Add General Panel $wp_customize->add_panel( 'rttheme_blog_settings', array( 'title' => __( 'Blog Settings', 'aeen' ), 'description' => esc_html__( 'Adjust the overall layout for your site.', 'aeen' ), 'priority' => 6, ) ); } /** * Customizer sections */ public function add_customizer_sections( $wp_customize ) { // Rename the default Colors section $wp_customize->get_section( 'colors' )->title = 'Background'; // Move the default Colors section to our new Colors Panel $wp_customize->get_section( 'colors' )->panel = 'colors_panel'; // Change the Priority of the default Colors section so it's at the top of our Panel $wp_customize->get_section( 'colors' )->priority = 10; // Add General Section $wp_customize->add_section( 'general_section', array( 'title' => __( 'General', 'aeen' ), 'priority' => 1, ) ); // Add Header Main Section $wp_customize->add_section( 'header_section', array( 'title' => __( 'Header', 'aeen' ), 'priority' => 3, ) ); // Add Footer Section $wp_customize->add_section( 'footer_section', array( 'title' => __( 'Footer', 'aeen' ), 'priority' => 4, ) ); // Add Pages Layout Section $wp_customize->add_section( 'page_layout_section', array( 'title' => __( 'Pages Layout', 'aeen' ), 'priority' => 1, 'panel' => 'rttheme_layouts_defaults', ) ); // Add Single Pages Layout Section $wp_customize->add_section( 'single_post_layout_section', array( 'title' => __( 'Single Post Layout', 'aeen' ), 'priority' => 2, 'panel' => 'rttheme_layouts_defaults', ) ); // Add Blog Settings Section $wp_customize->add_section( 'blog_post_settings_section', array( 'title' => __( 'Blog Settings', 'aeen' ), 'priority' => 7, 'panel' => 'rttheme_blog_settings', ) ); // Add Single Blog Settings Section $wp_customize->add_section( 'single_post_secttings_section', array( 'title' => esc_html__( 'Single Post Settings', 'aeen' ), 'priority' => 8, 'panel' => 'rttheme_blog_settings', ) ); // Team Archive Section $wp_customize->add_section( 'team_archive_section', array( 'title' => __( 'Team', 'aeen' ), 'priority' => 8, ) ); // Practice Archive Section $wp_customize->add_section( 'practice_archive_section', array( 'title' => __( 'Practices', 'aeen' ), 'priority' => 9, ) ); // Case Study Archive Section $wp_customize->add_section( 'case_archive_section', array( 'title' => __( 'Case Study', 'aeen' ), 'priority' => 10, ) ); // Add Colors Section $wp_customize->add_section( 'color_section', array( 'title' => __( 'Colors', 'aeen' ), 'priority' => 11, ) ); // Add Error Page Section $wp_customize->add_section( 'error_section', array( 'title' => __( 'Error Page', 'aeen' ), 'priority' => 12, ) ); } }