Exemplo n.º 1
0
 /**
  * Add a customize section.
  *
  * @since 1.0.0
  * @param array $args Section arguments.
  *
  * The priorities of the core sections are below:
  *
  * Title                ID                Priority (Order)
  * Site Title & Tagline title_tagline     20
  * Colors               colors            40
  * Header Image         header_image      60
  * Background Image     background_image  80
  * Navigation           nav               100
  * Widgets (Panel)      widgets           110
  * Static Front Page    static_front_page 120
  */
 public function add_section($id, $args)
 {
     $prefix = $this->prefix . '_';
     $title = isset($args['title']) ? esc_attr($args['title']) : 'Untitled Section';
     $description = isset($args['description']) ? esc_attr($args['description']) : '';
     $panel = isset($args['panel']) ? $prefix . esc_attr($args['panel']) : '';
     $priority = isset($args['priority']) ? $args['priority'] : 160;
     $theme_supports = isset($args['theme_supports']) ? $args['theme_supports'] : '';
     $active_callback = isset($args['active_callback']) ? $this->active_callback($args['active_callback']) : '';
     $this->customize->add_section($prefix . esc_attr($id), array('title' => $title, 'description' => $description, 'panel' => $panel, 'priority' => $priority, 'capability' => $this->capability, 'theme_supports' => $theme_supports, 'active_callback' => $active_callback));
 }