section_id ] = array( 'id' => $this->section_id, 'title' => __( 'Footer', 'brandy' ), 'settings' => $this->get_settings(), 'presets' => FooterPanel::get_preset_settings(), ); $settings['empty_footer_template'] = brandy_get_empty_footer(); return $settings; } public function add_layout( $layouts = array() ) { $layout = array( 'general' => array( 'sections' => array( array( 'components' => array( 'footer_name' ), ), array( 'components' => array( 'layout' ), ), array( 'components' => array( 'transparent', 'disabled_pages' ), ), ), ), 'designs' => array( 'sections' => array(), ), ); $mapped_layout = $this->map_layout( $layout ); $layouts[ $this->section_id ] = $mapped_layout; return $layouts; } protected function register_components() { return array( 'footer_name' => array( 'title' => array( 'text' => __( 'Footer name', 'brandy' ), 'type' => 'bold', ), 'type' => 'TextInput', 'value_path' => array( 'name' ), 'default_value' => '', ), 'layout' => array( 'title' => array( 'text' => __( 'Layout', 'brandy' ), 'type' => 'bold', ), 'value_path' => array( 'layout' ), 'type' => 'ButtonGroup', 'options' => array( array( 'label' => __( 'Boxed', 'brandy' ), 'value' => 'page-container', ), array( 'label' => __( 'Full width', 'brandy' ), 'value' => 'full-width', ), ), 'default_value' => 'full_width', 'render_options' => array( 'type' => 'data_attribute', 'data' => array( array( 'selector' => '.brandy-child-footer .footer-container', 'name' => 'class', 'value_path' => array( 'layout' ), 'default_class' => 'footer-container', ), ), ), ), 'transparent' => array( 'title' => array( 'text' => __( 'Transparent', 'brandy' ), 'type' => 'bold', ), 'type' => 'Switcher', 'value_path' => array( 'transparent', 'enabled' ), 'default_value' => false, 'render_options' => array( 'type' => 'force_refresh', ), ), 'disabled_pages' => array( 'title' => array( 'text' => __( 'Enable on entire website', 'brandy' ), 'type' => 'normal', ), 'type' => 'multiple_dropdown', 'value_path' => array( 'transparent', 'disabled_pages' ), 'default_value' => array(), 'options' => array( array( 'label' => __( 'Disable on 404, Search & Archives?', 'brandy' ), 'value' => 'disable_on_404', ), array( 'label' => __( 'Disable on Blog page?', 'brandy' ), 'value' => 'disable_on_blog', ), array( 'label' => __( 'Disable on Latest Post page?', 'brandy' ), 'value' => 'disable_on_latest_post', ), array( 'label' => __( 'Disable on Pages?', 'brandy' ), 'value' => 'disable_on_pages', ), array( 'label' => __( 'Disable on Posts?', 'brandy' ), 'value' => 'disable_on_posts', ), ), 'render_options' => array( 'type' => 'force_refresh', ), ), ); } public function add_partial_refresh( $partials = array() ) { $partials[] = array( 'configuration_type' => 'control', 'id' => 'footer', 'partial' => array( 'selector' => '#brandy-footer', 'render_callback' => array( FooterBuilder::get_instance(), 'render_footer' ), 'container_inclusive' => true, 'fallback_refresh' => true, ), 'default' => '', 'transport' => 'postMessage', ); return $partials; } }