Example #1
0
 public function controls($controls = array())
 {
     // Setup some folder variables
     $customizer_dir = '/core/customizer/';
     // Header -> Layout -> Layout  // This is used before any menus are registered. Then replaced by WP Naviagation
     if (!wp_get_nav_menus()) {
         $controls['nav'] = array('general-nav' => array('type' => 'layers-button', 'text' => __('Create Menu', 'layerswp'), 'href' => admin_url('nav-menus.php')));
         // header-layout
     }
     // Header -> Layout -> Layout
     $controls['css'] = array('custom-css' => array('type' => 'layers-css', 'placeholder' => ".classname {\n\tbackground: #333;\n}"));
     // css
     // Header -> Layout -> Layout
     $controls['fonts'] = array('body-fonts' => array('type' => 'layers-font', 'label' => __('Body', 'layerswp'), 'selectors' => 'body', 'choices' => layers_get_google_font_options()), 'fonts-break-0' => array('type' => 'layers-seperator'), 'heading-fonts' => array('type' => 'layers-font', 'label' => __('Headings', 'layerswp'), 'selectors' => 'h1,h2,h3,h4,h5,h6, .heading', 'choices' => layers_get_google_font_options()), 'fonts-break-1' => array('type' => 'layers-seperator'), 'form-fonts' => array('type' => 'layers-font', 'label' => __('Buttons', 'layerswp'), 'selectors' => 'button, .button, input[type=submit]', 'choices' => layers_get_google_font_options()));
     // Header -> Layout -> Layout
     $controls['header-layout'] = array('header-width' => array('type' => 'layers-select-icons', 'label' => __('Header Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'header-layout-break-0' => array('type' => 'layers-seperator'), 'header-menu-layout' => array('type' => 'layers-select-icons', 'label' => __('Logo & Menu Position', 'layerswp'), 'default' => 'header-logo-left', 'choices' => array('header-logo-left' => __('Logo Left', 'layerswp'), 'header-logo-right' => __('Logo Right', 'layerswp'), 'header-logo-center-top' => __('Logo Center Top', 'layerswp'), 'header-logo-top' => __('Logo Top', 'layerswp'), 'header-logo-center' => __('Logo Center', 'layerswp'))), 'header-layout-break-1' => array('type' => 'layers-seperator'), 'header-position-heading' => array('type' => 'layers-heading', 'label' => __('Header Position', 'layerswp')), 'header-sticky' => array('type' => 'layers-checkbox', 'label' => __('Sticky', 'layerswp'), 'class' => 'layers-pull-top layers-pull-bottom', 'default' => FALSE), 'header-overlay' => array('type' => 'layers-checkbox', 'label' => __('Overlay', 'layerswp'), 'default' => FALSE), 'header-layout-break-2' => array('type' => 'layers-seperator'), 'header-background-color' => array('type' => 'layers-color', 'label' => __('Background Color', 'layerswp'), 'default' => '#F3F3F3'));
     // header-layout
     // Header -> Layout -> Scripts
     $controls['header-scripts'] = array('header-google-id' => array('type' => 'text', 'label' => __('Google Analytics ID', 'layerswp'), 'description' => __('Enter in your Google Analytics ID to enable website traffic reporting. eg. "UA-xxxxxx-xx', 'layerswp'), 'default' => ''), 'header-custom-scripts-break-1' => array('type' => 'layers-seperator'), 'header-custom-scripts' => array('type' => 'textarea', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script (such as TypeKit etc) to include in your site\'s header. Include the <script></script> tags.', 'layerswp'), 'default' => ''));
     $controls['content-sidebars'] = array('single-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Single Post Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single post pages.', 'layerswp')), 'single-left-sidebar' => array('type' => 'checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-sidebar' => array('type' => 'checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'content-layout-break-2' => array('type' => 'layers-seperator'), 'archive-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Post List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your category, tag, author and search pages.', 'layerswp')), 'archive-left-sidebar' => array('type' => 'checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-sidebar' => array('type' => 'checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     // Footer -> Layout -> Layout
     $controls['footer-layout'] = array('footer-width' => array('type' => 'layers-select-icons', 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'footer-layout-break-1' => array('type' => 'layers-seperator'), 'footer-sidebar-count' => array('type' => 'select', 'label' => __('Widget Areas', 'layerswp'), 'default' => 4, 'choices' => array('0' => __('None', 'layerswp'), '1' => __('1', 'layerswp'), '2' => __('2', 'layerswp'), '3' => __('3', 'layerswp'), '4' => __('4', 'layerswp'))));
     // footer-layout
     // Footer -> Layout -> Customization
     $controls['footer-customization'] = array('footer-font-heading' => array('type' => 'layers-heading', 'label' => __('Text', 'layerswp')), 'footer-body-color' => array('type' => 'layers-color', 'subtitle' => __('Text Color', 'layerswp'), 'default' => '#000000'), 'footer-link-color' => array('type' => 'layers-color', 'subtitle' => __('Link Color', 'layerswp'), 'default' => '#35A6E8'), 'footer-customization-break-1' => array('type' => 'layers-seperator'), 'footer-background-heading' => array('type' => 'layers-heading', 'label' => __('Background', 'layerswp')), 'footer-background-image' => array('label' => '', 'subtitle' => __('Background Image', 'layerswp'), 'type' => 'layers-select-images'), 'footer-background-color' => array('label' => '', 'subtitle' => __('Background Color', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'footer-background-repeat' => array('label' => '', 'subtitle' => __('Background Repeat', 'layerswp'), 'type' => 'layers-select', 'choices' => array('no-repeat' => __('No Repeat', 'layerswp'), 'repeat' => __('Repeat', 'layerswp'), 'repeat-x' => __('Repeat Horizontal', 'layerswp'), 'repeat-y' => __('Repeat Vertical', 'layerswp'))), 'footer-background-position' => array('label' => '', 'subtitle' => __('Background Position', 'layerswp'), 'type' => 'layers-select', 'choices' => array('center' => __('Center', 'layerswp'), 'top' => __('Top', 'layerswp'), 'bottom' => __('Bottom', 'layerswp'), 'left' => __('Left', 'layerswp'), 'right' => __('Right', 'layerswp'))), 'footer-background-stretch' => array('label' => __('Background Stretch', 'layerswp'), 'subtitle' => '', 'type' => 'layers-checkbox'));
     // footer-customization
     // Footer -> Layout -> Text
     $controls['footer-text'] = array('footer-copyright-text' => array('type' => 'text', 'label' => __('Copyright Text', 'layerswp'), 'default' => ' Made at the tip of Africa. ©'));
     // footer-text
     // Footer -> Layout -> Scripts
     $controls['footer-scripts'] = array('footer-custom-scripts' => array('type' => 'textarea', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s footer. Include the <script></script> tags.', 'layerswp'), 'default' => ''));
     // footer-scripts
     if (class_exists('WooCommerce')) {
         $controls['woocommerce-sidebars'] = array('label-sidebar-single' => array('type' => 'layers-heading', 'label' => __('Single Product Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single product pages.', 'layerswp')), 'single-left-woocommerce-sidebar' => array('type' => 'checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-woocommerce-sidebar' => array('type' => 'checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'woocommerce-break-1' => array('type' => 'layers-seperator'), 'label-sidebar-archive' => array('type' => 'layers-heading', 'label' => __('Product List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your shop page, product category and product tag pages.', 'layerswp')), 'archive-left-woocommerce-sidebar' => array('type' => 'checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-woocommerce-sidebar' => array('type' => 'checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     }
     // if WooCommerce
     return apply_filters('layers_customizer_controls', $controls);
 }
Example #2
0
 private function controls()
 {
     global $layers_customizer_controls;
     // Setup some folder variables
     $customizer_dir = '/core/customizer/';
     // Set intial config.
     $layers_customizer_controls = array();
     // Site Settings -> Logo & Title
     $layers_customizer_controls['title_tagline'] = array('logo-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want more control over your Logo Size & Header Layout? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Site%20Settings%20Logo">Purchase Layers Pro</a> to unlock the full power of Layers!', 'layerswp')));
     // Site Settings -> Fonts
     $layers_customizer_controls['fonts'] = array('typekit-id' => array('type' => 'layers-text', 'label' => __('Typekit ID', 'layerswp'), 'description' => sprintf(__('For more information on obtaining your Typekit ID, see <a href="%s" target="_blank">follow this link</a>.', 'layerswp'), 'http://help.typekit.com/customer/portal/articles/6780')), 'body-fonts' => array('type' => 'layers-font', 'label' => __('Body', 'layerswp'), 'selectors' => 'body', 'choices' => layers_get_google_font_options()), 'heading-fonts' => array('type' => 'layers-font', 'label' => __('Headings', 'layerswp'), 'selectors' => 'h1,h2,h3,h4,h5,h6, .heading', 'choices' => layers_get_google_font_options()), 'menu-fonts' => array('type' => 'layers-font', 'label' => __('Header Menu', 'layerswp'), 'selectors' => '.header-site nav.nav-horizontal .menu li', 'choices' => layers_get_google_font_options()), 'form-fonts' => array('type' => 'layers-font', 'label' => __('Buttons', 'layerswp'), 'selectors' => 'button, .button, input[type=submit]', 'choices' => layers_get_google_font_options()));
     // Site Settings -> Layout
     $layers_customizer_controls['header-layout'] = array('header-menu-layout' => array('type' => 'layers-select-icons', 'heading_divider' => __('Header Arrangement', 'layerswp'), 'default' => 'header-logo-left', 'choices' => array('header-logo-left' => __('Logo Left', 'layerswp'), 'header-logo-right' => __('Logo Right', 'layerswp'), 'header-logo-center-top' => __('Logo Center Top', 'layerswp'), 'header-logo-top' => __('Logo Top', 'layerswp'), 'header-logo-center' => __('Logo Center', 'layerswp'), 'header-sidebar' => __('Header Sidebar', 'layerswp'))), 'header-width' => array('type' => 'layers-select-icons', 'heading_divider' => __('Header Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp')), 'linked' => array('show-if-selector' => "#customize-control-layers-header-menu-layout", 'show-if-value' => 'header-sidebar', 'show-if-operator' => '!==')), 'header-position-heading' => array('type' => 'layers-heading', 'heading_divider' => __('Sticky Header', 'layerswp'), 'linked' => array('show-if-selector' => "#customize-control-layers-header-menu-layout", 'show-if-value' => 'header-sidebar', 'show-if-operator' => '!==')), 'header-sticky' => array('type' => 'layers-checkbox', 'label' => __('Sticky', 'layerswp'), 'class' => 'layers-pull-top layers-pull-bottom', 'default' => FALSE, 'linked' => array('show-if-selector' => "#customize-control-layers-header-menu-layout", 'show-if-value' => 'header-sidebar', 'show-if-operator' => '!==')), 'header-overlay' => array('type' => 'layers-checkbox', 'label' => __('Transparent Overlay', 'layerswp'), 'default' => FALSE, 'linked' => array('show-if-selector' => "#customize-control-layers-header-menu-layout", 'show-if-value' => 'header-sidebar', 'show-if-operator' => '!==')), 'header-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want more control over your Header Layout? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Site%20Settings%20Header%20Layout">Purchase Layers Pro</a> to unlock the full power of Layers!', 'layerswp')));
     // Site Settings -> Sidebars
     $layers_customizer_controls['blog-single'] = array('single-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Single Post Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single post pages.', 'layerswp')), 'single-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'blog-single-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Gain more layout and information customization options in your blog post pages by <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Blog%20Single">upgrading to Layers Pro</a>.', 'layerswp')));
     $layers_customizer_controls['blog-archive'] = array('archive-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Archive Sidebar(s)', 'layerswp'), 'description' => __('This option affects your category, tag, author and search pages.', 'layerswp')), 'archive-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'blog-archive-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Gain more layout and information customization options in your blog archive pages by <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Blog%20Archive">upgrading to Layers Pro</a>.', 'layerswp')));
     // Site Settings -> Colors
     $layers_customizer_controls['site-colors'] = array('site-color-heading' => array('type' => 'layers-heading', 'label' => __('Site Wide Colors', 'layerswp'), 'description' => __('These options allow you to change the key colors of your Layers website.', 'layerswp')), 'header-background-color' => array('label' => '', 'subtitle' => __('Header Color', 'layerswp'), 'class' => 'group', 'description' => __('This affects the background colors of your site header and page titles.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'site-accent-color' => array('label' => '', 'subtitle' => __('Site Accent Color', 'layerswp'), 'class' => 'group', 'description' => __('Choose a color for your buttons and links.', 'layerswp'), 'type' => 'layers-color', 'default' => FALSE), 'footer-background-color' => array('label' => '', 'subtitle' => __('Footer Color', 'layerswp'), 'class' => 'group', 'description' => __('This affects the background color of your site footer.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'colors-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want more color customzation? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Footer%20Layout">Purchase Layers Pro</a> and get the full box of crayons!', 'layerswp')));
     // Site Settings -> Dev Switches
     $layers_customizer_controls['dev-switches'] = array('dev-switch-active' => array('type' => 'layers-checkbox', 'label' => __('Dev Switches Active', 'layerswp'), 'description' => __('Unckecking this will immediately remove this panel. To switch it back on you will need to add #layers-develop to your url.', 'layerswp'), 'default' => ''), 'dev-switch-customizer-state-record' => array('type' => 'layers-checkbox', 'label' => __('Remember State in Customizer', 'layerswp'), 'description' => __('This feature will add #hash values to the customizer URL so that when the page is refreshed the customizer will go back to it\'s same position.', 'layerswp'), 'default' => ''), 'dev-switch-widget-field-names' => array('type' => 'layers-checkbox', 'label' => __("Display Widget Input 'name' Attributes", 'layerswp'), 'description' => __('This is used in preparation of a new Widget so developer can quickly see all the possible fields in a Widget and make sure to set defaults for them.', 'layerswp'), 'default' => ''), 'dev-switch-button-css-testing' => array('type' => 'layers-checkbox', 'label' => __("Display all Buttons CSS", 'layerswp'), 'description' => __('This will output the CSS generated by Layers Pro and Layers when customizing your Buttons Globally or in the Widgets.', 'layerswp'), 'default' => ''));
     $layers_customizer_controls['site-scripts'] = array('header-google-id' => array('type' => 'layers-text', 'label' => __('Google Analytics ID', 'layerswp'), 'description' => __('Enter in your Google Analytics ID to enable website traffic reporting. eg. "UA-xxxxxx-xx', 'layerswp'), 'default' => ''), 'google-maps-api' => array('type' => 'layers-text', 'label' => __('Google Maps API Key', 'layerswp'), 'description' => __(sprintf('Enter in your Maps API Key to enable your contact widget. <a href="%s" target="_blank">Click Here</a> to get your API Key.', 'https://developers.google.com/maps/documentation/javascript/get-api-key'), 'layerswp'), 'default' => ''), 'header-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Header Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s header. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''), 'footer-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Footer Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s footer. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''));
     // Footer -> Layout
     $layers_customizer_controls['footer-layout'] = array('footer-width' => array('type' => 'layers-select-icons', 'heading_divider' => __('Footer Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'footer-sidebar-count' => array('type' => 'layers-select', 'heading_divider' => __('Widget Areas', 'layerswp'), 'description' => __('Choose how many widget areas apear in the footer. Go here to <a class="customizer-link" href="#accordion-panel-widgets">customize footer widgets</a>.', 'layerswp'), 'default' => 4, 'sanitize_callback' => 'layers_sanitize_number', 'choices' => array('0' => __('None', 'layerswp'), '1' => __('1', 'layerswp'), '2' => __('2', 'layerswp'), '3' => __('3', 'layerswp'), '4' => __('4', 'layerswp'))), 'footer-copyright-text' => array('type' => 'layers-text', 'label' => __('Copyright Text', 'layerswp'), 'default' => ' Made at the tip of Africa. &copy;', 'sanitize_callback' => FALSE), 'show-layers-badge' => array('label' => __('Support Layers', 'layerswp'), 'description' => __('Support Layers by displaying the Layers badge on your site.', 'layerswp'), 'type' => 'layers-checkbox', 'default' => true), 'footer-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want more control over your Footer Layout? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Site%20Settings%20Footer%20Layout">Purchase Layers Pro</a> to unlock the full power of Layers!', 'layerswp')));
     // CSS
     $layers_customizer_controls['css'] = array('custom-css' => array('type' => 'layers-code', 'placeholder' => ".classname {\n\tbackground: #333;\n}", 'sanitize_callback' => FALSE), 'upsell-devkit-heading' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to DevKit', 'layerswp'), 'description' => __('Want the best CSS customization interface? <a target="_blank" href="http://bit.ly/layers-devkit">Purchase DevKit</a> and save bundles of time!', 'layerswp')));
     if (class_exists('WooCommerce')) {
         $layers_customizer_controls['woocommerce-sidebars'] = array('label-sidebar-single' => array('type' => 'layers-heading', 'label' => __('Single Product Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single product pages.', 'layerswp')), 'single-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'label-sidebar-archive' => array('type' => 'layers-heading', 'label' => __('Product List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your shop page, product category and product tag pages.', 'layerswp')), 'archive-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     }
     // if WooCommerce
     /*
      * Layers Pro Upsells
      */
     if (!class_exists('Layers_Pro')) {
         $layers_customizer_controls['header-menu-styling'] = array('menu-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Customize your menu colors, spacing and styles but upgrading to <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Menu%20Styling">Layers Pro</a>.', 'layerswp')));
         $layers_customizer_controls['buttons'] = array('buttons-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want to customize the color of your buttons as well as their hover states? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Buttons">Purchase Layers Pro</a> and gain full control over your button styling!', 'layerswp')));
         $layers_customizer_controls['blog-styling'] = array('blog-styling-upsell-layers-pro' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to Layers Pro', 'layerswp'), 'description' => __('Want to customize the colors in your blog pages? <a target="_blank" href="https://www.layerswp.com/layers-pro/?ref=obox&utm_source=layers%20theme&utm_medium=link&utm_campaign=Layers%20Pro%20Upsell&utm_content=Blog%20Styling">Purchase Layers Pro</a> and gain full control over your blog!', 'layerswp')));
     }
     do_action('layers_customizer_controls_modify');
     $layers_customizer_controls = apply_filters('layers_customizer_controls', $layers_customizer_controls);
     $layers_customizer_controls = $this->apply_defaults($layers_customizer_controls);
     return $layers_customizer_controls;
 }
Example #3
0
 private function controls($controls = array())
 {
     // Setup some folder variables
     $customizer_dir = '/core/customizer/';
     // Site Settings -> Fonts
     $controls['fonts'] = array('typekit-id' => array('type' => 'layers-text', 'label' => __('Typekit ID', 'layerswp'), 'description' => sprintf(__('For more information on obtaining your Typekit ID, see <a href="%s" target="_blank">follow this link</a>.', 'layerswp'), 'http://help.typekit.com/customer/portal/articles/6780')), 'fonts-break-1' => array('type' => 'layers-seperator'), 'body-fonts' => array('type' => 'layers-font', 'label' => __('Body', 'layerswp'), 'selectors' => 'body', 'choices' => layers_get_google_font_options()), 'fonts-break-1' => array('type' => 'layers-seperator'), 'heading-fonts' => array('type' => 'layers-font', 'label' => __('Headings', 'layerswp'), 'selectors' => 'h1,h2,h3,h4,h5,h6, .heading', 'choices' => layers_get_google_font_options()), 'fonts-break-2' => array('type' => 'layers-seperator'), 'form-fonts' => array('type' => 'layers-font', 'label' => __('Buttons', 'layerswp'), 'selectors' => 'button, .button, input[type=submit]', 'choices' => layers_get_google_font_options()));
     // Site Settings -> Layout
     $controls['header-layout'] = array('header-width' => array('type' => 'layers-select-icons', 'heading_divider' => __('Header Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'header-menu-layout' => array('type' => 'layers-select-icons', 'heading_divider' => __('Header Arrangement', 'layerswp'), 'default' => 'header-logo-left', 'choices' => array('header-logo-left' => __('Logo Left', 'layerswp'), 'header-logo-right' => __('Logo Right', 'layerswp'), 'header-logo-center-top' => __('Logo Center Top', 'layerswp'), 'header-logo-top' => __('Logo Top', 'layerswp'), 'header-logo-center' => __('Logo Center', 'layerswp'))), 'header-position-heading' => array('type' => 'layers-heading', 'heading_divider' => __('Header Styling', 'layerswp')), 'header-sticky' => array('type' => 'layers-checkbox', 'label' => __('Sticky', 'layerswp'), 'class' => 'layers-pull-top layers-pull-bottom', 'default' => FALSE), 'header-overlay' => array('type' => 'layers-checkbox', 'label' => __('Transparent Overlay', 'layerswp'), 'default' => FALSE));
     // Site Settings -> Sidebars
     $controls['content-sidebars'] = array('single-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Single Post Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single post pages.', 'layerswp')), 'single-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'content-sidebars-break-2' => array('type' => 'layers-seperator'), 'archive-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Post List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your category, tag, author and search pages.', 'layerswp')), 'archive-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     // Site Settings -> Colors
     $controls['site-colors'] = array('site-color-heading' => array('type' => 'layers-heading', 'label' => __('Site Wide Colors', 'layerswp'), 'description' => __('These options allow you to change the key colors of your Layers website.', 'layerswp')), 'header-background-color' => array('label' => '', 'subtitle' => __('Header Color', 'layerswp'), 'description' => __('This affects the background colors of your site header and page titles.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'site-accent-color' => array('label' => '', 'subtitle' => __('Site Accent Color', 'layerswp'), 'description' => __('Choose a color for your buttons and links.', 'layerswp'), 'type' => 'layers-color', 'default' => FALSE), 'footer-background-color' => array('label' => '', 'subtitle' => __('Footer Color', 'layerswp'), 'description' => __('This affects the background color of your site footer.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'upsell-colorkit-heading' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to ColorKit', 'layerswp'), 'description' => __('Want more color customzation? <a target="_blank" href="http://bit.ly/layers-colorkit">Purchase ColorKit</a> and get the full box of crayons!', 'layerswp')));
     // Site Settings -> Dev Switches
     $controls['dev-switches'] = array('dev-switch-active' => array('type' => 'layers-checkbox', 'label' => __('Dev Switches Active', 'layerswp'), 'description' => __('Unckecking this will immediately remove this panel. To switch it back on you will need to add #layers-dev-switches to your url.', 'layerswp'), 'default' => ''), 'dev-switch-customizer-state-record' => array('type' => 'layers-checkbox', 'label' => __('Remember State in Customizer', 'layerswp'), 'description' => __('This feature will add #hash values to the customizer URL so that when the page is refreshed the customizer will go back to it\'s same position.', 'layerswp'), 'default' => ''), 'dev-switch-widget-field-names' => array('type' => 'layers-checkbox', 'label' => __("Display Widget Input 'name' Attributes", 'layerswp'), 'description' => __('This is used in preparation of a new Widget so developer can quickly see all the possible fields in a Widget and make sure to set defaults for them.', 'layerswp'), 'default' => ''));
     // Header -> Additional Scripts
     $controls['header-scripts'] = array('header-google-id' => array('type' => 'layers-text', 'label' => __('Google Analytics ID', 'layerswp'), 'description' => __('Enter in your Google Analytics ID to enable website traffic reporting. eg. "UA-xxxxxx-xx', 'layerswp'), 'default' => ''), 'header-custom-scripts-break-1' => array('type' => 'layers-seperator'), 'header-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s header. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''));
     // Footer -> Layout
     $controls['footer-layout'] = array('footer-width' => array('type' => 'layers-select-icons', 'heading_divider' => __('Footer Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'footer-sidebar-count' => array('type' => 'layers-select', 'heading_divider' => __('Widget Areas', 'layerswp'), 'description' => __('Choose how many widget areas apear in the footer. Go here to <a class="customizer-link" href="#accordion-panel-widgets">customize footer widgets</a>.', 'layerswp'), 'default' => 4, 'sanitize_callback' => 'layers_sanitize_number', 'choices' => array('0' => __('None', 'layerswp'), '1' => __('1', 'layerswp'), '2' => __('2', 'layerswp'), '3' => __('3', 'layerswp'), '4' => __('4', 'layerswp'))), 'footer-layout-break-2' => array('type' => 'layers-seperator'), 'show-layers-badge' => array('label' => __('Support Layers', 'layerswp'), 'description' => __('Support Layers by displaying the Layers badge on your site.', 'layerswp'), 'type' => 'layers-checkbox', 'default' => true));
     // Footer -> Text
     $controls['footer-text'] = array('footer-copyright-text' => array('type' => 'layers-text', 'label' => __('Copyright Text', 'layerswp'), 'default' => ' Made at the tip of Africa. &copy;', 'sanitize_callback' => FALSE));
     // Footer -> Additional Scripts
     $controls['footer-scripts'] = array('footer-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s footer. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''));
     // CSS
     $controls['css'] = array('custom-css' => array('type' => 'layers-code', 'placeholder' => ".classname {\n\tbackground: #333;\n}", 'sanitize_callback' => FALSE), 'upsell-devkit-heading' => array('type' => 'layers-heading', 'class' => 'layers-upsell-tag', 'label' => __('Upgrade to DevKit', 'layerswp'), 'description' => __('Want the best CSS customization interface? <a target="_blank" href="http://bit.ly/layers-devkit">Purchase DevKit</a> and save bundles of time!', 'layerswp')));
     if (class_exists('WooCommerce')) {
         $controls['woocommerce-sidebars'] = array('label-sidebar-single' => array('type' => 'layers-heading', 'label' => __('Single Product Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single product pages.', 'layerswp')), 'single-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'woocommerce-break-1' => array('type' => 'layers-seperator'), 'label-sidebar-archive' => array('type' => 'layers-heading', 'label' => __('Product List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your shop page, product category and product tag pages.', 'layerswp')), 'archive-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     }
     // if WooCommerce
     $controls = apply_filters('layers_customizer_controls', $controls);
     $controls = $this->apply_defaults($controls);
     return $controls;
 }
Example #4
0
 private function controls($controls = array())
 {
     // Setup some folder variables
     $customizer_dir = '/core/customizer/';
     // Header -> Layout -> Layout  // This is used before any menus are registered. Then replaced by WP Naviagation
     if (!wp_get_nav_menus()) {
         $controls['nav'] = array('general-nav' => array('type' => 'layers-button', 'text' => __('Create Menu', 'layerswp'), 'href' => admin_url('nav-menus.php')));
         // header-layout
     }
     // Header -> Layout -> Layout
     $controls['css'] = array('custom-css' => array('type' => 'layers-code', 'placeholder' => ".classname {\n\tbackground: #333;\n}", 'sanitize_callback' => FALSE));
     // css
     // Header -> Layout -> Layout
     $controls['fonts'] = array('typekit-id' => array('type' => 'layers-text', 'label' => __('Typekit ID', 'layerswp'), 'description' => sprintf(__('For more information on obtaining your Typekit ID, see <a href="%s" target="_blank">follow this link</a>.', 'layerswp'), 'http://help.typekit.com/customer/portal/articles/6780')), 'fonts-break-1' => array('type' => 'layers-seperator'), 'body-fonts' => array('type' => 'layers-font', 'label' => __('Body', 'layerswp'), 'selectors' => 'body', 'choices' => layers_get_google_font_options()), 'fonts-break-1' => array('type' => 'layers-seperator'), 'heading-fonts' => array('type' => 'layers-font', 'label' => __('Headings', 'layerswp'), 'selectors' => 'h1,h2,h3,h4,h5,h6, .heading', 'choices' => layers_get_google_font_options()), 'fonts-break-2' => array('type' => 'layers-seperator'), 'form-fonts' => array('type' => 'layers-font', 'label' => __('Buttons', 'layerswp'), 'selectors' => 'button, .button, input[type=submit]', 'choices' => layers_get_google_font_options()));
     // Header -> Layout -> Layout
     $controls['header-layout'] = array('header-width' => array('type' => 'layers-select-icons', 'label' => __('Header Width', 'layerswp'), 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'header-layout-break-0' => array('type' => 'layers-seperator'), 'header-menu-layout' => array('type' => 'layers-select-icons', 'label' => __('Logo & Menu Position', 'layerswp'), 'default' => 'header-logo-left', 'choices' => array('header-logo-left' => __('Logo Left', 'layerswp'), 'header-logo-right' => __('Logo Right', 'layerswp'), 'header-logo-center-top' => __('Logo Center Top', 'layerswp'), 'header-logo-top' => __('Logo Top', 'layerswp'), 'header-logo-center' => __('Logo Center', 'layerswp'))), 'header-layout-break-1' => array('type' => 'layers-seperator'), 'header-position-heading' => array('type' => 'layers-heading', 'label' => __('Header Position', 'layerswp')), 'header-sticky' => array('type' => 'layers-checkbox', 'label' => __('Sticky', 'layerswp'), 'class' => 'layers-pull-top layers-pull-bottom', 'default' => FALSE), 'header-overlay' => array('type' => 'layers-checkbox', 'label' => __('Overlay', 'layerswp'), 'default' => FALSE));
     // header-layout
     // Header -> Layout -> Scripts
     $controls['header-scripts'] = array('header-google-id' => array('type' => 'layers-text', 'label' => __('Google Analytics ID', 'layerswp'), 'description' => __('Enter in your Google Analytics ID to enable website traffic reporting. eg. "UA-xxxxxx-xx', 'layerswp'), 'default' => ''), 'header-custom-scripts-break-1' => array('type' => 'layers-seperator'), 'header-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s header. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''));
     $controls['content-sidebars'] = array('single-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Single Post Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single post pages.', 'layerswp')), 'single-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'content-sidebars-break-2' => array('type' => 'layers-seperator'), 'archive-sidebar-heading' => array('type' => 'layers-heading', 'label' => __('Post List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your category, tag, author and search pages.', 'layerswp')), 'archive-left-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     // Footer -> Layout -> Layout
     $controls['footer-layout'] = array('footer-width' => array('type' => 'layers-select-icons', 'default' => 'layout-boxed', 'choices' => array('layout-boxed' => __('Boxed', 'layerswp'), 'layout-fullwidth' => __('Full Width', 'layerswp'))), 'footer-layout-break-1' => array('type' => 'layers-seperator'), 'footer-sidebar-count' => array('type' => 'layers-select', 'label' => __('Widget Areas', 'layerswp'), 'default' => 4, 'sanitize_callback' => 'layers_sanitize_number', 'choices' => array('0' => __('None', 'layerswp'), '1' => __('1', 'layerswp'), '2' => __('2', 'layerswp'), '3' => __('3', 'layerswp'), '4' => __('4', 'layerswp'))), 'footer-layout-break-2' => array('type' => 'layers-seperator'), 'show-layers-badge' => array('label' => __('Support Layers', 'layerswp'), 'description' => __('Support Layers by displaying the Layers badge on your site.', 'layerswp'), 'type' => 'layers-checkbox', 'default' => true));
     // footer-layout
     // Footer -> Layout -> Text
     $controls['footer-text'] = array('footer-copyright-text' => array('type' => 'layers-text', 'label' => __('Copyright Text', 'layerswp'), 'default' => ' Made at the tip of Africa. &copy;'));
     // footer-text
     // Footer -> Layout -> Scripts
     $controls['footer-scripts'] = array('footer-custom-scripts' => array('type' => 'layers-code', 'label' => __('Custom Scripts', 'layerswp'), 'description' => __('Enter in any custom script to include in your site\'s footer. Be sure to use double quotes for strings.', 'layerswp'), 'default' => ''));
     // footer-scripts
     $controls['site-colors'] = array('site-color-heading' => array('type' => 'layers-heading', 'label' => __('Site Wide Colors', 'layerswp'), 'description' => __('These options allow you to change the key colors of your Layers website.', 'layerswp')), 'header-background-color' => array('label' => '', 'subtitle' => __('Header Color', 'layerswp'), 'description' => __('This affects the background colors of your site header and page titles.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'site-accent-color' => array('label' => '', 'subtitle' => __('Site Accent Color', 'layerswp'), 'description' => __('Choose a color for your buttons and links.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'), 'footer-background-color' => array('label' => '', 'subtitle' => __('Footer Color', 'layerswp'), 'description' => __('This affects the background color of your site footer.', 'layerswp'), 'type' => 'layers-color', 'default' => '#F3F3F3'));
     if (class_exists('WooCommerce')) {
         $controls['woocommerce-sidebars'] = array('label-sidebar-single' => array('type' => 'layers-heading', 'label' => __('Single Product Sidebar(s)', 'layerswp'), 'description' => __('This option affects your single product pages.', 'layerswp')), 'single-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'single-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE), 'woocommerce-break-1' => array('type' => 'layers-seperator'), 'label-sidebar-archive' => array('type' => 'layers-heading', 'label' => __('Product List Sidebar(s)', 'layerswp'), 'description' => __('This option affects your shop page, product category and product tag pages.', 'layerswp')), 'archive-left-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Left Sidebar', 'layerswp'), 'default' => FALSE), 'archive-right-woocommerce-sidebar' => array('type' => 'layers-checkbox', 'label' => __('Display Right Sidebar', 'layerswp'), 'default' => TRUE));
     }
     // if WooCommerce
     $controls = apply_filters('layers_customizer_controls', $controls);
     $controls = $this->apply_defaults($controls);
     return $controls;
 }