Example #1
0
 /**
  *  Get Instance creates a singleton class that's cached to stop duplicate instances
  */
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
         self::$instance->init();
     }
     return self::$instance;
 }
Example #2
0
 /**
  *  Init behaves like, and replaces, construct
  */
 public function init()
 {
     // Register the customizer object
     global $wp_customize;
     $this->customizer = $wp_customize;
     // Set Prefix
     $this->prefix = LAYERS_THEME_SLUG . '-';
     // Grab the customizer config
     $this->config = Layers_Customizer_Config::get_instance();
     //Register the panels and sections based on this instance's config
     // Start registration with the panels & sections
     $this->register_panels($this->config->panels);
     $this->register_sections($this->config->sections);
     // Move default sections into Layers Panels
     $this->move_default_sections($this->config->default_sections);
     // Change 'Widgets' panel title to 'Edit Layout'
     $wp_customize->add_panel('widgets', array('priority' => 0, 'title' => __('Edit Layout', 'layerswp'), 'description' => Layers_Customizer::get_instance()->render_builder_page_dropdown() . __('Use this area to add widgets to your page, use the (Layers) widgets for the Body section.', 'layerswp')));
 }
Example #3
0
/**
*  Kicking this off with the 'widgets_init' hook
*/
function layers_customizer_init()
{
    $layers_widget = new Layers_Customizer();
    $layers_widget->init();
}