Layers_Customizer_Config

Customizer Configuration File.

Defined (1)

The class is defined in the following location(s).

/core/customizer/config.php  
  1. class Layers_Customizer_Config { 
  2.  
  3. public $panels; 
  4.  
  5. public $default_panels; 
  6.  
  7. public $default_sections; 
  8.  
  9. public $sections; 
  10.  
  11. public $controls; 
  12.  
  13. private static $instance; // stores singleton class 
  14.  
  15. /** 
  16. * Get Instance creates a singleton class that's cached to stop duplicate instances 
  17. */ 
  18. public static function get_instance() { 
  19. if ( ! self::$instance ) { 
  20. self::$instance = new self(); 
  21. self::$instance->init(); 
  22. return self::$instance; 
  23.  
  24. /** 
  25. * Construct empty on purpose 
  26. */ 
  27.  
  28. private function __construct() {} 
  29.  
  30. /** 
  31. * Init behaves like, and replaces, construct 
  32. */ 
  33.  
  34. public function init() { 
  35.  
  36. // Init and store panels 
  37. $this->panels = $this->panels(); 
  38.  
  39. // Init and store default_sections 
  40. $this->default_panels = $this->default_panels(); 
  41. $this->default_sections = $this->default_sections(); 
  42. $this->default_controls = $this->default_controls(); 
  43.  
  44. // Init and store sections 
  45. $this->sections = $this->sections(); 
  46.  
  47. // Init and store controls 
  48. $this->controls = $this->controls(); 
  49.  
  50. /** 
  51. * Default WP Customiser Panels 
  52. * @return array Panels to be registered in the customizer 
  53. */ 
  54.  
  55. private function panels() { 
  56. global $layers_customizer_panels; 
  57.  
  58. // Set intial config. 
  59. $layers_customizer_panels = array( 
  60. 'site-settings' => array( 
  61. 'title' => __( 'Site Settings' , 'layerswp' ),  
  62. 'description' => __( 'Control your content\'s default layout.' , 'layerswp' ), // @TODO Put a helper here 
  63. 'priority' => 40 
  64. ),  
  65. 'header' => array( 
  66. 'title' => __( 'Header' , 'layerswp' ),  
  67. 'description' => __( 'Control your header\'s logo, layout, colors and font.' , 'layerswp' ), // @TODO Put a helper here 
  68. 'priority' => 60 
  69. ),  
  70.  
  71. 'blog-archive-single' => array( 
  72. 'title' => __( 'Blog' , 'layerswp' ),  
  73. 'description' => __( 'Control your sites\'s sidebars and blog layout.' , 'layerswp' ), // @TODO Put a helper here 
  74. 'priority' => 70 
  75. ),  
  76.  
  77. 'footer' => array( 
  78. 'title' => __( 'Footer' , 'layerswp' ),  
  79. 'description' => __( 'Control your footer\'s custom text, widget areas and layout.' , 'layerswp' ), // @TODO Put a helper here 
  80. 'priority' => 80 
  81. ),  
  82.  
  83. 'woocommerce' => array( 
  84. 'title' => __( 'WooCommerce' , 'layerswp' ),  
  85. 'priority' => 100 
  86. ),  
  87. ); 
  88.  
  89. return apply_filters( 'layers_customizer_panels', $layers_customizer_panels ); 
  90.  
  91. /** 
  92. * Default WP Customiser Panels 
  93. * @return array Panels to be registered in the customizer 
  94. */ 
  95.  
  96. private function default_panels() { 
  97.  
  98. $default_panels = array(); 
  99.  
  100. $default_panels[ 'nav_menus' ] = array( 
  101. 'priority' => 50,  
  102. ); 
  103.  
  104. return apply_filters( 'layers_customizer_default_panels', $default_panels ); 
  105.  
  106. /** 
  107. * Layers Customiser Sections 
  108. * @return array Sections to be registered in the customizer 
  109. */ 
  110.  
  111. private function default_sections() { 
  112.  
  113. $default_sections = array(); 
  114.  
  115. $default_sections[ 'title_tagline' ] = array( 
  116. 'title' => __( 'Logo & Title' , 'layerswp' ),  
  117. 'panel' => 'site-settings' 
  118. ); 
  119.  
  120. $default_sections[ 'colors' ] = array( 
  121. 'panel' => 'site-settings',  
  122. 'priority' => 55,  
  123. ); 
  124.  
  125. $default_sections[ 'background_image' ] = array( 
  126. 'panel' => 'site-settings',  
  127. 'priority' => 55,  
  128. ); 
  129.  
  130. $default_sections[ 'static_front_page' ] = array( 
  131. 'panel' => 'site-settings',  
  132. ); 
  133.  
  134. return apply_filters( 'layers_customizer_default_sections', $default_sections ); 
  135.  
  136. /** 
  137. * Default WP Customiser Controls 
  138. * @return array Controls to be registered in the customizer 
  139. */ 
  140.  
  141. private function default_controls() { 
  142.  
  143. $default_controls = array(); 
  144.  
  145. $default_sections[ 'header_textcolor' ] = array( 
  146. 'section' => 'site-colors' 
  147. ); 
  148.  
  149. $default_sections[ 'background_color' ] = array( 
  150. 'section' => 'site-colors' 
  151. ); 
  152.  
  153. return apply_filters( 'layers_customizer_default_controls', $default_sections ); 
  154.  
  155.  
  156. /** 
  157. * Layers Customiser Sections 
  158. * @return array Sections to be registered in the customizer 
  159. */ 
  160.  
  161. private function sections() { 
  162. global $layers_customizer_sections; 
  163.  
  164. // Following default sections need to be added so our registration process can access them 
  165. $layers_customizer_sections[ 'title_tagline' ] = array( 
  166. 'panel' => 'site-settings' 
  167. ); 
  168.  
  169. $layers_customizer_sections[ 'colors' ] = array( 
  170. 'panel' => 'site-settings',  
  171. ); 
  172.  
  173. $layers_customizer_sections[ 'background_image' ] = array( 
  174. 'panel' => 'site-settings',  
  175. ); 
  176.  
  177. $layers_customizer_sections[ 'static_front_page' ] = array( 
  178. 'panel' => 'site-settings',  
  179. ); 
  180.  
  181. // End default sections 
  182.  
  183. $layers_customizer_sections[ 'site-general' ] = array( 
  184. 'title' =>__( 'General' , 'layerswp' ),  
  185. 'panel' => 'site-settings',  
  186. 'priority' => 45,  
  187. ); 
  188.  
  189. $layers_customizer_sections[ 'site-scripts' ] = array( 
  190. 'title' =>__( 'Additional Scripts' , 'layerswp' ),  
  191. 'panel' => 'site-settings',  
  192. ); 
  193.  
  194. if( !class_exists( 'Layers_Pro' ) ) { 
  195. $layers_customizer_sections[ 'buttons'] = array( 
  196. 'title' => __( 'Buttons', 'layerswp' ),  
  197. 'panel' => 'site-settings',  
  198. ); 
  199.  
  200. $layers_customizer_sections[ 'site-colors' ] = array( 
  201. 'title' =>__( 'Colors' , 'layerswp' ),  
  202. 'panel' => 'site-settings',  
  203. 'priority' => 50,  
  204. ); 
  205.  
  206. $layers_customizer_sections[ 'fonts' ] = array( 
  207. 'title' =>__( 'Fonts' , 'layerswp' ),  
  208. 'panel' => 'site-settings',  
  209. 'priority' => 55,  
  210. ); 
  211.  
  212. $layers_customizer_sections[ 'dev-switches' ] = array( 
  213. 'title' =>__( 'Dev Switches', 'layerswp' ),  
  214. 'panel' => 'site-settings',  
  215. 'priority' => 100,  
  216. ); 
  217.  
  218. $layers_customizer_sections[ 'css' ] = array( 
  219. 'title' =>__( 'CSS' , 'layerswp' ),  
  220. ); 
  221.  
  222. $layers_customizer_sections[ 'header-layout' ] = array( 
  223. 'title' =>__( 'Styling' , 'layerswp' ),  
  224. 'panel' => 'header',  
  225. ); 
  226.  
  227. $layers_customizer_sections[ 'header-layout' ] = array( 
  228. 'title' =>__( 'Styling' , 'layerswp' ),  
  229. 'panel' => 'header',  
  230. ); 
  231.  
  232. if( !class_exists( 'Layers_Pro' ) ) { 
  233. $layers_customizer_sections[ 'header-menu-styling' ] = array( 
  234. 'title' =>__( 'Menu Styling' , 'layerswp' ),  
  235. 'panel' => 'header',  
  236. ); 
  237.  
  238. $layers_customizer_sections[ 'blog-styling' ] = array( 
  239. 'title' => __( 'Styling', 'layerswp' ),  
  240. 'panel' => 'blog-archive-single',  
  241. ); 
  242.  
  243. $layers_customizer_sections[ 'blog-archive' ] = array( 
  244. 'title' => __( 'Archive', 'layerswp' ),  
  245. 'panel' => 'blog-archive-single',  
  246. ); 
  247.  
  248. $layers_customizer_sections['blog-single' ] = array( 
  249. 'title' => __( 'Posts & Pages', 'layerswp' ),  
  250. 'panel' => 'blog-archive-single',  
  251. ); 
  252.  
  253. $layers_customizer_sections['footer-layout' ] = array( 
  254. 'title' =>__( 'Styling' , 'layerswp' ),  
  255. 'panel' => 'footer',  
  256. ); 
  257.  
  258. $layers_customizer_sections['footer-text' ] = array( 
  259. 'title' =>__( 'Text' , 'layerswp' ),  
  260. 'panel' => 'footer',  
  261. ); 
  262.  
  263. $layers_customizer_sections['footer-scripts' ] = array( 
  264. 'title' =>__( 'Additional Scripts' , 'layerswp' ),  
  265. 'panel' => 'footer',  
  266. ); 
  267.  
  268. $layers_customizer_sections['woocommerce-sidebars' ] = array( 
  269. 'title' =>__( 'Sidebars' , 'layerswp' ),  
  270. 'panel' => 'woocommerce',  
  271. ); 
  272.  
  273. $layers_customizer_sections['body-customization' ] = array( 
  274. 'title' =>__( 'Customization' , 'layerswp' ),  
  275. 'panel' => 'body',  
  276. ); 
  277.  
  278. return apply_filters( 'layers_customizer_sections', $layers_customizer_sections ); 
  279.  
  280. private function controls() { 
  281.  
  282. global $layers_customizer_controls; 
  283.  
  284. // Setup some folder variables 
  285. $customizer_dir = '/core/customizer/'; 
  286.  
  287. // Set intial config. 
  288. $layers_customizer_controls = array(); 
  289.  
  290. // Site Settings -> Logo & Title 
  291. $layers_customizer_controls['title_tagline'] = array( 
  292. 'logo-upsell-layers-pro' => array( 
  293. 'type' => 'layers-heading',  
  294. 'class' => 'layers-upsell-tag',  
  295. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  296. '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' ),  
  297. ),  
  298. ); 
  299.  
  300. // Site Settings -> Fonts 
  301. $layers_customizer_controls['fonts'] = array( 
  302. 'typekit-id' => array( 
  303. 'type' => 'layers-text',  
  304. 'label' => __( 'Typekit ID' , 'layerswp' ),  
  305. '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' ),  
  306. ),  
  307. 'body-fonts' => array( 
  308. 'type' => 'layers-font',  
  309. 'label' => __( 'Body' , 'layerswp' ),  
  310. 'selectors' => 'body',  
  311. 'choices' => layers_get_google_font_options(),  
  312. ),  
  313. 'heading-fonts' => array( 
  314. 'type' => 'layers-font',  
  315. 'label' => __( 'Headings' , 'layerswp' ),  
  316. 'selectors' => 'h1, h2, h3, h4, h5, h6, .heading',  
  317. 'choices' => layers_get_google_font_options(),  
  318. ),  
  319. 'menu-fonts' => array( 
  320. 'type' => 'layers-font',  
  321. 'label' => __( 'Header Menu' , 'layerswp' ),  
  322. 'selectors' => '.header-site nav.nav-horizontal .menu li',  
  323. 'choices' => layers_get_google_font_options(),  
  324. ),  
  325. 'form-fonts' => array( 
  326. 'type' => 'layers-font',  
  327. 'label' => __( 'Buttons' , 'layerswp' ),  
  328. 'selectors' => 'button, .button, input[type=submit]',  
  329. 'choices' => layers_get_google_font_options(),  
  330. ),  
  331. ); 
  332.  
  333. // Site Settings -> Layout 
  334. $layers_customizer_controls['header-layout'] = array( 
  335. 'header-menu-layout' => array( 
  336. 'type' => 'layers-select-icons',  
  337. 'heading_divider' => __( 'Header Arrangement' , 'layerswp' ),  
  338. 'default' => 'header-logo-left',  
  339. 'choices' => array( 
  340. 'header-logo-left' => __( 'Logo Left' , 'layerswp' ),  
  341. 'header-logo-right' => __( 'Logo Right' , 'layerswp' ),  
  342. 'header-logo-center-top' => __( 'Logo Center Top' , 'layerswp' ),  
  343. 'header-logo-top' => __( 'Logo Top' , 'layerswp' ),  
  344. 'header-logo-center' => __( 'Logo Center' , 'layerswp' ),  
  345. 'header-sidebar' => __( 'Header Sidebar' , 'layerswp' ),  
  346. ),  
  347. ),  
  348. 'header-width' => array( 
  349. 'type' => 'layers-select-icons',  
  350. 'heading_divider' => __( 'Header Width' , 'layerswp' ),  
  351. 'default' => 'layout-boxed',  
  352. 'choices' => array( 
  353. 'layout-boxed' => __( 'Boxed' , 'layerswp' ),  
  354. 'layout-fullwidth' => __( 'Full Width' , 'layerswp' ),  
  355. ),  
  356. 'linked' => array( 
  357. 'show-if-selector' => "#customize-control-layers-header-menu-layout",  
  358. 'show-if-value' => 'header-sidebar',  
  359. 'show-if-operator' => '!==',  
  360. ),  
  361. ),  
  362. 'header-position-heading' => array( 
  363. 'type' => 'layers-heading',  
  364. 'heading_divider' => __( 'Sticky Header' , 'layerswp' ),  
  365. 'linked' => array( 
  366. 'show-if-selector' => "#customize-control-layers-header-menu-layout",  
  367. 'show-if-value' => 'header-sidebar',  
  368. 'show-if-operator' => '!==',  
  369. ),  
  370. ),  
  371. 'header-sticky' => array( 
  372. 'type' => 'layers-checkbox',  
  373. 'label' => __( 'Sticky' , 'layerswp' ),  
  374. 'class' => 'layers-pull-top layers-pull-bottom',  
  375. 'default' => FALSE,  
  376. 'linked' => array( 
  377. 'show-if-selector' => "#customize-control-layers-header-menu-layout",  
  378. 'show-if-value' => 'header-sidebar',  
  379. 'show-if-operator' => '!==',  
  380. ),  
  381. ),  
  382. 'header-overlay' => array( 
  383. 'type' => 'layers-checkbox',  
  384. 'label' => __( 'Transparent Overlay' , 'layerswp' ),  
  385. 'default' => FALSE,  
  386. 'linked' => array( 
  387. 'show-if-selector' => "#customize-control-layers-header-menu-layout",  
  388. 'show-if-value' => 'header-sidebar',  
  389. 'show-if-operator' => '!==',  
  390. ),  
  391. ),  
  392. 'header-upsell-layers-pro' => array( 
  393. 'type' => 'layers-heading',  
  394. 'class' => 'layers-upsell-tag',  
  395. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  396. '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' ),  
  397. ),  
  398. ); 
  399. // Site Settings -> Sidebars 
  400. $layers_customizer_controls['blog-single'] = array( 
  401. 'single-sidebar-heading' => array( 
  402. 'type' => 'layers-heading',  
  403. 'label' => __( 'Single Post Sidebar(s)' , 'layerswp' ),  
  404. 'description' => __( 'This option affects your single post pages.' , 'layerswp' ),  
  405. ),  
  406. 'single-left-sidebar' => array( 
  407. 'type' => 'layers-checkbox',  
  408. 'label' => __( 'Display Left Sidebar' , 'layerswp' ),  
  409. 'default' => FALSE,  
  410. ),  
  411. 'single-right-sidebar' => array( 
  412. 'type' => 'layers-checkbox',  
  413. 'label' => __( 'Display Right Sidebar' , 'layerswp' ),  
  414. 'default' => TRUE,  
  415. ),  
  416. 'blog-single-upsell-layers-pro' => array( 
  417. 'type' => 'layers-heading',  
  418. 'class' => 'layers-upsell-tag',  
  419. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  420. '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' ),  
  421. ),  
  422. ); 
  423.  
  424. $layers_customizer_controls['blog-archive'] = array( 
  425. 'archive-sidebar-heading' => array( 
  426. 'type' => 'layers-heading',  
  427. 'label' => __( 'Archive Sidebar(s)' , 'layerswp' ),  
  428. 'description' => __( 'This option affects your category, tag, author and search pages.' , 'layerswp' ),  
  429. ),  
  430. 'archive-left-sidebar' => array( 
  431. 'type' => 'layers-checkbox',  
  432. 'label' => __( 'Display Left Sidebar' , 'layerswp' ),  
  433. 'default' => FALSE,  
  434. ),  
  435. 'archive-right-sidebar' => array( 
  436. 'type' => 'layers-checkbox',  
  437. 'label' => __( 'Display Right Sidebar' , 'layerswp' ),  
  438. 'default' => TRUE,  
  439. ),  
  440. 'blog-archive-upsell-layers-pro' => array( 
  441. 'type' => 'layers-heading',  
  442. 'class' => 'layers-upsell-tag',  
  443. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  444. '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' ),  
  445. ),  
  446. ); 
  447.  
  448. // Site Settings -> Colors 
  449. $layers_customizer_controls['site-colors'] = array( 
  450. 'site-color-heading' => array( 
  451. 'type' => 'layers-heading',  
  452. 'label' => __( 'Site Wide Colors' , 'layerswp' ),  
  453. 'description' => __( 'These options allow you to change the key colors of your Layers website.' , 'layerswp' ),  
  454. ),  
  455. 'header-background-color' => array( 
  456. 'label' => '',  
  457. 'subtitle' => __( 'Header Color' , 'layerswp' ),  
  458. 'class' => 'group',  
  459. 'description' => __( 'This affects the background colors of your site header and page titles.', 'layerswp' ),  
  460. 'type' => 'layers-color',  
  461. 'default' => '#F3F3F3',  
  462. ),  
  463. 'site-accent-color' => array( 
  464. 'label' => '',  
  465. 'subtitle' => __( 'Site Accent Color', 'layerswp' ),  
  466. 'class' => 'group',  
  467. 'description' => __( 'Choose a color for your buttons and links.', 'layerswp' ),  
  468. 'type' => 'layers-color',  
  469. 'default' => FALSE,  
  470. ),  
  471. 'footer-background-color' => array( 
  472. 'label' => '',  
  473. 'subtitle' => __( 'Footer Color' , 'layerswp' ),  
  474. 'class' => 'group',  
  475. 'description' => __( 'This affects the background color of your site footer.', 'layerswp' ),  
  476. 'type' => 'layers-color',  
  477. 'default' => '#F3F3F3',  
  478. ),  
  479. 'colors-upsell-layers-pro' => array( 
  480. 'type' => 'layers-heading',  
  481. 'class' => 'layers-upsell-tag',  
  482. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  483. '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' ),  
  484. ),  
  485. ); 
  486.  
  487. // Site Settings -> Dev Switches 
  488. $layers_customizer_controls['dev-switches'] = array( 
  489. 'dev-switch-active' => array( 
  490. 'type' => 'layers-checkbox',  
  491. 'label' => __( 'Dev Switches Active' , 'layerswp' ),  
  492. 'description' => __( 'Unckecking this will immediately remove this panel. To switch it back on you will need to add #layers-develop to your url.' , 'layerswp' ),  
  493. 'default' => '',  
  494. ),  
  495. 'dev-switch-customizer-state-record' => array( 
  496. 'type' => 'layers-checkbox',  
  497. 'label' => __( 'Remember State in Customizer' , 'layerswp' ),  
  498. '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' ),  
  499. 'default' => '',  
  500. ),  
  501. 'dev-switch-widget-field-names' => array( 
  502. 'type' => 'layers-checkbox',  
  503. 'label' => __( "Display Widget Input 'name' Attributes", 'layerswp' ),  
  504. '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' ),  
  505. 'default' => '',  
  506. ),  
  507. 'dev-switch-button-css-testing' => array( 
  508. 'type' => 'layers-checkbox',  
  509. 'label' => __( "Display all Buttons CSS", 'layerswp' ),  
  510. 'description' => __( 'This will output the CSS generated by Layers Pro and Layers when customizing your Buttons Globally or in the Widgets.', 'layerswp' ),  
  511. 'default' => '',  
  512. ),  
  513. ); 
  514.  
  515.  
  516. $layers_customizer_controls['site-scripts'] = array( 
  517. 'header-google-id' => array( 
  518. 'type' => 'layers-text',  
  519. 'label' => __( 'Google Analytics ID' , 'layerswp' ),  
  520. 'description' => __( 'Enter in your Google Analytics ID to enable website traffic reporting. eg. "UA-xxxxxx-xx' , 'layerswp' ),  
  521. 'default' => '',  
  522. ),  
  523. 'google-maps-api' => array( 
  524. 'type' => 'layers-text',  
  525. 'label' => __( 'Google Maps API Key' , 'layerswp' ),  
  526. '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' ),  
  527. 'default' => '',  
  528. ),  
  529. 'header-custom-scripts' => array( 
  530. 'type' => 'layers-code',  
  531. 'label' => __( 'Custom Header Scripts' , 'layerswp' ),  
  532. 'description' => __( 'Enter in any custom script to include in your site\'s header. Be sure to use double quotes for strings.' , 'layerswp' ),  
  533. 'default' => '',  
  534. ),  
  535. 'footer-custom-scripts' => array( 
  536. 'type' => 'layers-code',  
  537. 'label' => __( 'Custom Footer Scripts' , 'layerswp' ),  
  538. 'description' => __( 'Enter in any custom script to include in your site\'s footer. Be sure to use double quotes for strings.' , 'layerswp' ),  
  539. 'default' => '',  
  540. ),  
  541. ); 
  542.  
  543. // Footer -> Layout 
  544. $layers_customizer_controls['footer-layout'] = array( 
  545. 'footer-width' => array( 
  546. 'type' => 'layers-select-icons',  
  547. 'heading_divider' => __( 'Footer Width' , 'layerswp' ),  
  548. 'default' => 'layout-boxed',  
  549. 'choices' => array( 
  550. 'layout-boxed' => __( 'Boxed' , 'layerswp' ),  
  551. 'layout-fullwidth' => __( 'Full Width' , 'layerswp' ),  
  552. ),  
  553. ),  
  554. 'footer-sidebar-count' => array( 
  555. 'type' => 'layers-select',  
  556. 'heading_divider' => __( 'Widget Areas' , 'layerswp' ),  
  557. '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' ),  
  558. 'default' => 4,  
  559. 'sanitize_callback' => 'layers_sanitize_number',  
  560. 'choices' => array( 
  561. '0' => __( 'None' , 'layerswp' ),  
  562. '1' => __( '1' , 'layerswp' ),  
  563. '2' => __( '2' , 'layerswp' ),  
  564. '3' => __( '3' , 'layerswp' ),  
  565. '4' => __( '4' , 'layerswp' ),  
  566. ),  
  567. ),  
  568. 'footer-copyright-text' => array( 
  569. 'type' => 'layers-text',  
  570. 'label' => __( 'Copyright Text' , 'layerswp' ),  
  571. 'default' => ' Made at the tip of Africa. ©',  
  572. 'sanitize_callback' => FALSE 
  573. ),  
  574. 'show-layers-badge' => array( 
  575. 'label' => __( 'Support Layers' , 'layerswp' ),  
  576. 'description' => __( 'Support Layers by displaying the Layers badge on your site.', 'layerswp' ),  
  577. 'type' => 'layers-checkbox',  
  578. 'default' => true 
  579. ),  
  580. 'footer-upsell-layers-pro' => array( 
  581. 'type' => 'layers-heading',  
  582. 'class' => 'layers-upsell-tag',  
  583. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  584. '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' ),  
  585. ),  
  586. ); 
  587.  
  588. // CSS 
  589. $layers_customizer_controls['css'] = array( 
  590. 'custom-css' => array( 
  591. 'type' => 'layers-code',  
  592. 'placeholder' => ".classname {\n\tbackground: #333;\n}",  
  593. 'sanitize_callback' => FALSE 
  594. ),  
  595. 'upsell-devkit-heading' => array( 
  596. 'type' => 'layers-heading',  
  597. 'class' => 'layers-upsell-tag',  
  598. 'label' => __( 'Upgrade to DevKit' , 'layerswp' ),  
  599. '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' ),  
  600. ),  
  601. ); 
  602.  
  603. if( class_exists( 'WooCommerce' ) ) { 
  604. $layers_customizer_controls[ 'woocommerce-sidebars' ] = array( 
  605. 'label-sidebar-single' => array( 
  606. 'type' => 'layers-heading',  
  607. 'label' => __( 'Single Product Sidebar(s)' , 'layerswp' ),  
  608. 'description' => __( 'This option affects your single product pages.' , 'layerswp' ),  
  609. ),  
  610. 'single-left-woocommerce-sidebar' => array( 
  611. 'type' => 'layers-checkbox',  
  612. 'label' => __( 'Display Left Sidebar' , 'layerswp' ),  
  613. 'default' => FALSE,  
  614. ),  
  615. 'single-right-woocommerce-sidebar' => array( 
  616. 'type' => 'layers-checkbox',  
  617. 'label' => __( 'Display Right Sidebar' , 'layerswp' ),  
  618. 'default' => TRUE,  
  619. ),  
  620. 'label-sidebar-archive' => array( 
  621. 'type' => 'layers-heading',  
  622. 'label' => __( 'Product List Sidebar(s)' , 'layerswp' ),  
  623. 'description' => __( 'This option affects your shop page, product category and product tag pages.' , 'layerswp' ),  
  624. ),  
  625. 'archive-left-woocommerce-sidebar' => array( 
  626. 'type' => 'layers-checkbox',  
  627. 'label' => __( 'Display Left Sidebar' , 'layerswp' ),  
  628. 'default' => FALSE,  
  629. ),  
  630. 'archive-right-woocommerce-sidebar' => array( 
  631. 'type' => 'layers-checkbox',  
  632. 'label' => __( 'Display Right Sidebar' , 'layerswp' ),  
  633. 'default' => TRUE,  
  634. ),  
  635. ); 
  636. } // if WooCommerce 
  637.  
  638. /** 
  639. * Layers Pro Upsells 
  640. */ 
  641.  
  642. if( !class_exists( 'Layers_Pro' ) ) { 
  643.  
  644. $layers_customizer_controls[ 'header-menu-styling' ] = array( 
  645. 'menu-upsell-layers-pro' => array( 
  646. 'type' => 'layers-heading',  
  647. 'class' => 'layers-upsell-tag',  
  648. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  649. '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' ),  
  650. ),  
  651. ); 
  652.  
  653. $layers_customizer_controls['buttons'] = array( 
  654. 'buttons-upsell-layers-pro' => array( 
  655. 'type' => 'layers-heading',  
  656. 'class' => 'layers-upsell-tag',  
  657. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  658. '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' ),  
  659. ),  
  660. ); 
  661.  
  662. $layers_customizer_controls['blog-styling'] = array( 
  663. 'blog-styling-upsell-layers-pro' => array( 
  664. 'type' => 'layers-heading',  
  665. 'class' => 'layers-upsell-tag',  
  666. 'label' => __( 'Upgrade to Layers Pro' , 'layerswp' ),  
  667. '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' ),  
  668. ),  
  669. ); 
  670.  
  671. do_action( 'layers_customizer_controls_modify' ); 
  672.  
  673. $layers_customizer_controls = apply_filters( 'layers_customizer_controls', $layers_customizer_controls ); 
  674.  
  675. $layers_customizer_controls = $this->apply_defaults( $layers_customizer_controls ); 
  676.  
  677. return $layers_customizer_controls; 
  678.  
  679. private function apply_defaults( $controls ) { 
  680.  
  681. $defaults = apply_filters( 'layers_customizer_control_defaults' , array() ); 
  682.  
  683. if( empty( $defaults ) ) return $controls; 
  684.  
  685. foreach( $controls as $section_key => $control ) { 
  686.  
  687. foreach( $control as $control_key => $control_data ) { 
  688. if( isset( $defaults[ $control_key ] ) ) { 
  689. $controls[ $section_key ][ $control_key ][ 'default' ] = $defaults[ $control_key ]; 
  690.  
  691. return $controls;