| 1 |
<?php |
| 2 |
|
| 3 |
////////////////////////////////////////////////////////////// |
| 4 |
//=========================================================== |
| 5 |
// PAGELAYER |
| 6 |
// Inspired by the DESIRE to be the BEST OF ALL |
| 7 |
// ---------------------------------------------------------- |
| 8 |
// Started by: Pulkit Gupta |
| 9 |
// Date: 23rd Jan 2017 |
| 10 |
// Time: 23:00 hrs |
| 11 |
// Site: http://pagelayer.com/wordpress (PAGELAYER) |
| 12 |
// ---------------------------------------------------------- |
| 13 |
// Please Read the Terms of use at http://pagelayer.com/tos |
| 14 |
// ---------------------------------------------------------- |
| 15 |
//=========================================================== |
| 16 |
// (c)Pagelayer Team |
| 17 |
//=========================================================== |
| 18 |
////////////////////////////////////////////////////////////// |
| 19 |
|
| 20 |
// Are we being accessed directly ? |
| 21 |
if(!defined('PAGELAYER_VERSION')) { |
| 22 |
exit('Hacking Attempt !'); |
| 23 |
} |
| 24 |
|
| 25 |
// Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 26 |
add_action( 'customize_preview_init', 'pagelayer_customize_preview_js' ); |
| 27 |
function pagelayer_customize_preview_js() { |
| 28 |
//wp_enqueue_script( 'pagelayer-customizer-preview', get_template_directory_uri() . '/js/customizer-preview.js', array( 'jquery', 'customize-preview' ), PAGELAYER_VERSION, true ); |
| 29 |
} |
| 30 |
|
| 31 |
// JS handlers for controls. |
| 32 |
add_action( 'customize_controls_enqueue_scripts', 'pagelayer_customize_scripts' ); |
| 33 |
function pagelayer_customize_scripts(){ |
| 34 |
wp_enqueue_script( 'wp-color-picker' ); |
| 35 |
wp_enqueue_style( 'wp-color-picker' ); |
| 36 |
wp_enqueue_script( 'pagelayer-customizer', PAGELAYER_JS.'/customizer.js', array( 'customize-controls' ), PAGELAYER_VERSION, true ); |
| 37 |
} |
| 38 |
|
| 39 |
// Print global Style. |
| 40 |
add_action( 'customize_controls_print_styles', 'pagelayer_customize_controls_print_styles' ); |
| 41 |
function pagelayer_customize_controls_print_styles(){ |
| 42 |
global $pagelayer; |
| 43 |
|
| 44 |
$font_family = (array) $pagelayer->fonts; |
| 45 |
$style = array('' => 'Default', 'normal' => 'Normal', 'italic' => 'Italic', 'oblique' => 'Oblique'); |
| 46 |
$weight = array('' => 'Default', '100' => '100', '200' => '200', '300' => '300', '400' => '400', '500' => '500', '600' => '600', '700' => '700', '800' => '800', '900' => '900', 'normal' => 'Normal', 'lighter' => 'Lighter', 'bold' => 'Bold', 'bolder' => 'Bolder', 'unset' => 'Unset'); |
| 47 |
$variant = array('' => 'Default', 'normal' => 'Normal', 'small-caps' => 'Small Caps'); |
| 48 |
$decoration = array('' => 'Default', 'none' => 'None', 'overline' => 'Overline', 'line-through' => 'Line-through', 'underline' => 'Underline', 'underline overline' => 'Underline Overline'); |
| 49 |
$decoration_style = array('' => 'None', 'solid' => 'Solid', 'double' => 'Double', 'dotted' => 'Dotted', 'dashed' => 'Dashed', 'wavy' => 'Wavy'); |
| 50 |
$transform = array('' => 'Default', 'capitalize' => 'Capitalize', 'uppercase' => 'Uppercase', 'lowercase' => 'Lowercase'); |
| 51 |
|
| 52 |
$pagelayer->font_settings = array( |
| 53 |
'font-family' => array( |
| 54 |
'label' => __('Family', 'pagelayer'), |
| 55 |
'choices' => $font_family |
| 56 |
), |
| 57 |
'font-size' => array( |
| 58 |
'label' => __('Size', 'pagelayer'), |
| 59 |
'responsive' => 1, |
| 60 |
), |
| 61 |
'font-style' => array( |
| 62 |
'label' => __('Style', 'pagelayer'), |
| 63 |
'choices' => $style, |
| 64 |
), |
| 65 |
'font-weight' => array( |
| 66 |
'label' => __('Weight', 'pagelayer'), |
| 67 |
'choices' => $weight, |
| 68 |
'responsive' => 1, |
| 69 |
), |
| 70 |
'font-variant' => array( |
| 71 |
'label' => __('Variant', 'pagelayer'), |
| 72 |
'choices' => $variant, |
| 73 |
), |
| 74 |
'text-decoration-line' => array( |
| 75 |
'label' => __('Decoration', 'pagelayer'), |
| 76 |
'choices' => $decoration, |
| 77 |
), |
| 78 |
'text-decoration-style' => array( |
| 79 |
'label' => __('Decoration Style', 'pagelayer'), |
| 80 |
'choices' => $decoration_style, |
| 81 |
), |
| 82 |
'line-height' => array( |
| 83 |
'label' => __('Line Height', 'pagelayer'), |
| 84 |
'responsive' => 1, |
| 85 |
), |
| 86 |
'text-transform' => array( |
| 87 |
'label' => __('Transform', 'pagelayer'), |
| 88 |
'choices' => $transform, |
| 89 |
), |
| 90 |
'letter-spacing' => array( |
| 91 |
'label' => __('Text Spacing', 'pagelayer'), |
| 92 |
'responsive' => 1, |
| 93 |
), |
| 94 |
'word-spacing' => array( |
| 95 |
'label' => __('Word Spacing', 'pagelayer'), |
| 96 |
'responsive' => 1, |
| 97 |
), |
| 98 |
); |
| 99 |
|
| 100 |
$styles = '<style id="pagelayer-customize-global-style">:root{'; |
| 101 |
|
| 102 |
// Set global colors styles |
| 103 |
foreach($pagelayer->global_colors as $gk => $gv){ |
| 104 |
$styles .= '--pagelayer-color-'.$gk.':'.$gv['value'].';'; |
| 105 |
} |
| 106 |
|
| 107 |
$styles .= '} |
| 108 |
</style>'.PHP_EOL; |
| 109 |
|
| 110 |
// Added global JavaSript variables |
| 111 |
$styles .= '<script id="pagelayer-customize-global-js"> |
| 112 |
var pagelayer_global_colors = '.json_encode($pagelayer->global_colors).'; |
| 113 |
var pagelayer_global_fonts = '.json_encode($pagelayer->global_fonts).'; |
| 114 |
var pagelayer_global_font_settings = '.json_encode($pagelayer->font_settings).'; |
| 115 |
</script>'.PHP_EOL; |
| 116 |
|
| 117 |
echo $styles; |
| 118 |
} |
| 119 |
|
| 120 |
add_action( 'customize_register', 'pagelayer_customize_register', 11 ); |
| 121 |
function pagelayer_customize_register( $wp_customize ) { |
| 122 |
global $pagelayer; |
| 123 |
|
| 124 |
// CSS for the custom controls |
| 125 |
wp_register_style('pagelayer-customizer', PAGELAYER_CSS.'/customizer.css', PAGELAYER_VERSION); |
| 126 |
wp_enqueue_style('pagelayer-customizer'); |
| 127 |
|
| 128 |
// Load fonts |
| 129 |
pagelayer_load_font_options(); |
| 130 |
|
| 131 |
// Load global colors and fonts |
| 132 |
pagelayer_load_global_palette(); |
| 133 |
|
| 134 |
// Add custom controls |
| 135 |
include_once(PAGELAYER_DIR . '/main/customizer-controls.php'); |
| 136 |
|
| 137 |
$post_types = array('' => __('Global')); |
| 138 |
$exclude = [ 'attachment', 'pagelayer-template' ]; |
| 139 |
$pt_objects = get_post_types(['public' => true,], 'objects'); |
| 140 |
|
| 141 |
foreach ( $pt_objects as $pt_slug => $type ) { |
| 142 |
|
| 143 |
if ( in_array( $pt_slug, $exclude ) ) { |
| 144 |
continue; |
| 145 |
} |
| 146 |
|
| 147 |
$post_types[$pt_slug] = $type->labels->name; |
| 148 |
} |
| 149 |
|
| 150 |
// Pagelayer Panel |
| 151 |
$wp_customize->add_panel( 'pagelayer_settings', array( |
| 152 |
'priority' => 10, |
| 153 |
'title' => 'Pagelayer', |
| 154 |
)); |
| 155 |
|
| 156 |
// Global colors section |
| 157 |
$wp_customize->add_section( 'pagelayer_global_colors_sec', array( |
| 158 |
'capability' => 'edit_theme_options', |
| 159 |
'priority' => 10, |
| 160 |
'title' => __('Colors'), |
| 161 |
'panel' => 'pagelayer_settings', |
| 162 |
)); |
| 163 |
|
| 164 |
$wp_customize->add_setting( 'pagelayer_global_colors', array( |
| 165 |
'type' => 'option', |
| 166 |
'capability' => 'edit_theme_options', |
| 167 |
'transport' => 'refresh', |
| 168 |
'default' => json_encode( $pagelayer->global_colors ) |
| 169 |
)); |
| 170 |
|
| 171 |
$wp_customize->add_control( new Pagelayer_Color_Repeater_Control($wp_customize, 'pagelayer_global_colors', array( |
| 172 |
'priority' => 10, |
| 173 |
'section' => 'pagelayer_global_colors_sec', |
| 174 |
))); |
| 175 |
|
| 176 |
// Global fonts section |
| 177 |
$wp_customize->add_section( 'pagelayer_global_fonts_sec', array( |
| 178 |
'capability' => 'edit_theme_options', |
| 179 |
'priority' => 10, |
| 180 |
'title' => __('Typography'), |
| 181 |
'panel' => 'pagelayer_settings', |
| 182 |
)); |
| 183 |
|
| 184 |
$wp_customize->add_setting( 'pagelayer_global_fonts', array( |
| 185 |
'type' => 'option', |
| 186 |
'capability' => 'edit_theme_options', |
| 187 |
'transport' => 'refresh', |
| 188 |
'default' => json_encode($pagelayer->global_fonts), |
| 189 |
)); |
| 190 |
|
| 191 |
$wp_customize->add_control( new Pagelayer_Font_Repeater_Control($wp_customize, 'pagelayer_global_fonts', array( |
| 192 |
'priority' => 10, |
| 193 |
'section' => 'pagelayer_global_fonts_sec', |
| 194 |
))); |
| 195 |
|
| 196 |
foreach($post_types as $sk => $sv){ |
| 197 |
|
| 198 |
$post_type = empty($sk) ? '' : '_'.$sk; |
| 199 |
$global_section = 'pagelayer_global_sec'.$post_type; |
| 200 |
$global_text = empty($sk) ? '' : __('Global'); |
| 201 |
|
| 202 |
// Global section |
| 203 |
$wp_customize->add_section( $global_section, array( |
| 204 |
'capability' => 'edit_theme_options', |
| 205 |
'priority' => 10, |
| 206 |
'title' => sprintf( __('%s %s Styles', 'pagelayer'), $sv, $global_text), |
| 207 |
'panel' => 'pagelayer_settings', |
| 208 |
)); |
| 209 |
|
| 210 |
foreach($pagelayer->css_settings as $set => $setv){ |
| 211 |
|
| 212 |
$setting_name = $set.$sk; |
| 213 |
$setting = empty($setv['key']) ? 'pagelayer_'.$set.'_css'.$post_type : $setv['key'].$post_type; |
| 214 |
|
| 215 |
$wp_customize->add_setting( 'pagelayer_lable_'.$setting_name, array( |
| 216 |
'capability' => 'edit_theme_options', |
| 217 |
)); |
| 218 |
|
| 219 |
$wp_customize->add_control( new Pagelayer_Customize_Control( |
| 220 |
$wp_customize, 'pagelayer_lable_'.$setting_name, array( |
| 221 |
'type' => 'hidden', |
| 222 |
'section' => $global_section, |
| 223 |
'description' => sprintf( __('<div class="pagelayer-customize-heading"><div>%s</div><span class="dashicons dashicons-arrow-right-alt2"></span></div>', 'pagelayer'), $sv.' '.$setv['name']), |
| 224 |
'li_class' => 'pagelayer-accordion-tab', |
| 225 |
) |
| 226 |
)); |
| 227 |
|
| 228 |
// Register the typography control for body |
| 229 |
pagelayer_register_typo_customizer_control($wp_customize, array( |
| 230 |
'control' => $setting, |
| 231 |
'section' => $global_section, |
| 232 |
'label' => __( 'Typography', 'pagelayer' ), |
| 233 |
'capability' => 'edit_theme_options', |
| 234 |
'setting_type' => 'option', |
| 235 |
'transport' => 'refresh', |
| 236 |
'default' => '', |
| 237 |
'units' => ['px', 'em', '%'], |
| 238 |
'responsive' => 1, |
| 239 |
)); |
| 240 |
|
| 241 |
$wp_customize->add_setting( $setting.'[color]', array( |
| 242 |
'type' => 'option', |
| 243 |
'capability' => 'edit_theme_options', |
| 244 |
'transport' => 'refresh', |
| 245 |
)); |
| 246 |
|
| 247 |
$wp_customize->add_control( new Pagelayer_Customize_Alpha_Color_Control( |
| 248 |
$wp_customize, $setting.'[color]', array( |
| 249 |
'section' => $global_section, |
| 250 |
'label' => __( 'Color', 'pagelayer' ), |
| 251 |
) |
| 252 |
)); |
| 253 |
|
| 254 |
$wp_customize->add_setting( $setting.'[background-color]', array( |
| 255 |
'type' => 'option', |
| 256 |
'capability' => 'edit_theme_options', |
| 257 |
'transport' => 'refresh', |
| 258 |
)); |
| 259 |
|
| 260 |
$wp_customize->add_control( new Pagelayer_Customize_Alpha_Color_Control( |
| 261 |
$wp_customize, $setting.'[background-color]', array( |
| 262 |
'section' => $global_section, |
| 263 |
'label' => __( 'Background Color', 'pagelayer' ), |
| 264 |
) |
| 265 |
)); |
| 266 |
|
| 267 |
// Register the padding control for scroll to top |
| 268 |
pagelayer_register_padding_customizer_control($wp_customize, array( |
| 269 |
'control' => $setting, |
| 270 |
'control_array_sufix' => 'padding', |
| 271 |
'section' => $global_section, |
| 272 |
'label' => __( 'Padding', 'pagelayer' ), |
| 273 |
'capability' => 'edit_theme_options', |
| 274 |
'setting_type' => 'option', |
| 275 |
'transport' => 'refresh', |
| 276 |
'default' => '', |
| 277 |
'units' => ['px', 'em', '%'], |
| 278 |
'setting_parts' => array('0', '1', '2', '3', 'unit'), |
| 279 |
'responsive' => 1, |
| 280 |
)); |
| 281 |
|
| 282 |
// Register the padding control for scroll to top |
| 283 |
pagelayer_register_padding_customizer_control($wp_customize, array( |
| 284 |
'control' => $setting, |
| 285 |
'control_array_sufix' => 'margin', |
| 286 |
'section' => $global_section, |
| 287 |
'label' => __( 'Margin', 'pagelayer' ), |
| 288 |
'capability' => 'edit_theme_options', |
| 289 |
'setting_type' => 'option', |
| 290 |
'transport' => 'refresh', |
| 291 |
'default' => '', |
| 292 |
'units' => ['px', 'em', '%'], |
| 293 |
'setting_parts' => array('0', '1', '2', '3', 'unit'), |
| 294 |
'responsive' => 1, |
| 295 |
)); |
| 296 |
|
| 297 |
} |
| 298 |
} |
| 299 |
} |
| 300 |
|
| 301 |
/** |
| 302 |
* Register the Typography control. |
| 303 |
* |
| 304 |
* @return void |
| 305 |
*/ |
| 306 |
function pagelayer_register_typo_customizer_control($wp_customize, $args, $screen_array = false){ |
| 307 |
|
| 308 |
$settings_for_control = array(); |
| 309 |
$settings = array('font-family', 'font-size', 'font-style', 'font-weight', 'font-variant', 'text-decoration-line', 'text-decoration-style', 'line-height', 'text-transform', 'letter-spacing', 'word-spacing', 'global-font'); |
| 310 |
$screens = array(''); |
| 311 |
$control_array_sufix = ''; |
| 312 |
|
| 313 |
if(!empty($args['responsive'])){ |
| 314 |
$screens = array('desktop' => '', 'tablet' => '_tablet', 'mobile' => '_mobile'); |
| 315 |
} |
| 316 |
|
| 317 |
if(!empty($args['control_array_sufix'])){ |
| 318 |
$control_array_sufix = '['.$args['control_array_sufix'].']'; |
| 319 |
} |
| 320 |
|
| 321 |
// Register settings |
| 322 |
foreach($screens as $_screen => $screen){ |
| 323 |
foreach($settings as $setting){ |
| 324 |
|
| 325 |
// Skip units for responsive |
| 326 |
if($setting == 'unit' && !empty($screen)){ |
| 327 |
continue; |
| 328 |
} |
| 329 |
|
| 330 |
$setting_name = $args['control']; |
| 331 |
|
| 332 |
if($screen_array && count($screens) > 1){ |
| 333 |
$setting_name .= $control_array_sufix.'['.$_screen.']'; |
| 334 |
}else{ |
| 335 |
$setting_name .= $screen.$control_array_sufix; |
| 336 |
} |
| 337 |
|
| 338 |
$setting_name .= '['.$setting.']'; |
| 339 |
$settings_for_control[$setting.$screen] = $setting_name; |
| 340 |
|
| 341 |
$setting_args = array( |
| 342 |
'capability' => $args['capability'], |
| 343 |
'transport' => $args['transport'], |
| 344 |
); |
| 345 |
|
| 346 |
if(!empty($args['setting_type'])){ |
| 347 |
$setting_args['type'] = $args['setting_type']; |
| 348 |
} |
| 349 |
|
| 350 |
if(!empty($args['default'])){ |
| 351 |
$setting_args['default'] = $args['default']; |
| 352 |
} |
| 353 |
|
| 354 |
$wp_customize->add_setting( $setting_name, $setting_args); |
| 355 |
} |
| 356 |
} |
| 357 |
|
| 358 |
$args['settings'] = $settings_for_control; |
| 359 |
|
| 360 |
$wp_customize->add_control( new Pagelayer_typo_Control( |
| 361 |
$wp_customize, $args['control']. @$args['control_array_sufix'], $args |
| 362 |
)); |
| 363 |
} |
| 364 |
|
| 365 |
/** |
| 366 |
* Register the padding control. |
| 367 |
* |
| 368 |
* @return void |
| 369 |
*/ |
| 370 |
function pagelayer_register_padding_customizer_control($wp_customize, $args, $screen_array = false){ |
| 371 |
|
| 372 |
$settings_for_control = array(); |
| 373 |
$screens = array(''); |
| 374 |
$control_array_sufix = ''; |
| 375 |
|
| 376 |
if(empty($args['setting_parts'])){ |
| 377 |
$settings = array('top', 'right', 'bottom', 'left', 'unit'); |
| 378 |
}else{ |
| 379 |
$settings = $args['setting_parts']; |
| 380 |
} |
| 381 |
|
| 382 |
if(!empty($args['responsive'])){ |
| 383 |
$screens = array('desktop' => '', 'tablet' => '_tablet', 'mobile' => '_mobile'); |
| 384 |
} |
| 385 |
|
| 386 |
if(!empty($args['control_array_sufix'])){ |
| 387 |
$control_array_sufix = '['.$args['control_array_sufix'].']'; |
| 388 |
} |
| 389 |
|
| 390 |
// Register settings |
| 391 |
foreach($screens as $_screen => $screen){ |
| 392 |
foreach($settings as $setting){ |
| 393 |
|
| 394 |
// Skip units for responsive |
| 395 |
if($setting == 'unit' && (!empty($screen) || $screen_array)){ |
| 396 |
continue; |
| 397 |
} |
| 398 |
|
| 399 |
$setting_name = $args['control']; |
| 400 |
|
| 401 |
if($screen_array && count($screens) > 1){ |
| 402 |
$setting_name .= $control_array_sufix.'['.$_screen.']'; |
| 403 |
}else{ |
| 404 |
$setting_name .= $screen.$control_array_sufix; |
| 405 |
} |
| 406 |
|
| 407 |
$setting_name .= '['.$setting.']'; |
| 408 |
$settings_for_control[$setting.$screen] = $setting_name; |
| 409 |
|
| 410 |
$setting_args = array( |
| 411 |
'capability' => $args['capability'], |
| 412 |
'transport' => $args['transport'], |
| 413 |
); |
| 414 |
|
| 415 |
if(!empty($args['default'])){ |
| 416 |
$setting_args['default'] = $args['default']; |
| 417 |
} |
| 418 |
|
| 419 |
if(!empty($args['setting_type'])){ |
| 420 |
$setting_args['type'] = $args['setting_type']; |
| 421 |
} |
| 422 |
|
| 423 |
if(!empty($args['sanitize_callback'])){ |
| 424 |
$setting_args['sanitize_callback'] = $args['sanitize_callback']; |
| 425 |
} |
| 426 |
|
| 427 |
$wp_customize->add_setting( $setting_name, $setting_args); |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
// If we save responsive values in same variables |
| 432 |
if($screen_array && !empty($args['units'])){ |
| 433 |
$setting_name = $args['control'].$control_array_sufix.'[unit]'; |
| 434 |
$settings_for_control['unit'] = $setting_name; |
| 435 |
$setting_args = array( |
| 436 |
'capability' => $args['capability'], |
| 437 |
'transport' => $args['transport'], |
| 438 |
); |
| 439 |
|
| 440 |
if(!empty($args['setting_type'])){ |
| 441 |
$setting_args['type'] = $args['setting_type']; |
| 442 |
} |
| 443 |
|
| 444 |
$wp_customize->add_setting( $setting_name, $setting_args); |
| 445 |
} |
| 446 |
|
| 447 |
$args['settings'] = $settings_for_control; |
| 448 |
$wp_customize->add_control( new Pagelayer_Padding_Control( |
| 449 |
$wp_customize, $args['control']. @$args['control_array_sufix'], $args |
| 450 |
)); |
| 451 |
} |
| 452 |
|
| 453 |
/** |
| 454 |
* Register the slider control. |
| 455 |
* |
| 456 |
* @return void |
| 457 |
*/ |
| 458 |
function pagelayer_register_slider_custoze_control($wp_customize, $args){ |
| 459 |
|
| 460 |
$settings_for_control = array(); |
| 461 |
$setting = 'slider'; |
| 462 |
$screens = array(''); |
| 463 |
|
| 464 |
if(!empty($args['responsive'])){ |
| 465 |
$screens = array('desktop' => '_desktop', 'tablet' => '_tablet', 'mobile' => '_mobile'); |
| 466 |
} |
| 467 |
|
| 468 |
// Register settings |
| 469 |
foreach($screens as $screen => $_screen){ |
| 470 |
|
| 471 |
$setting_name = $args['control']; |
| 472 |
|
| 473 |
if(count($screens) > 1){ |
| 474 |
$setting_name .= '['.$screen.']'; |
| 475 |
} |
| 476 |
|
| 477 |
$settings_for_control[$setting.$_screen] = $setting_name; |
| 478 |
|
| 479 |
$setting_args = array( |
| 480 |
'capability' => $args['capability'], |
| 481 |
'transport' => $args['transport'], |
| 482 |
); |
| 483 |
|
| 484 |
if(!empty($args['default'])){ |
| 485 |
$setting_args['default'] = $args['default']; |
| 486 |
} |
| 487 |
|
| 488 |
if(!empty($args['setting_type'])){ |
| 489 |
$setting_args['type'] = $args['setting_type']; |
| 490 |
} |
| 491 |
|
| 492 |
if(!empty($args['sanitize_callback'])){ |
| 493 |
$setting_args['sanitize_callback'] = $args['sanitize_callback']; |
| 494 |
} |
| 495 |
|
| 496 |
$wp_customize->add_setting($setting_name, $setting_args); |
| 497 |
} |
| 498 |
|
| 499 |
// Register setting for units |
| 500 |
if(!empty($args['units'])){ |
| 501 |
$setting_name = $args['control'].'[unit]'; |
| 502 |
$settings_for_control['unit'] = $setting_name; |
| 503 |
$setting_args = array( |
| 504 |
'capability' => $args['capability'], |
| 505 |
'transport' => $args['transport'], |
| 506 |
); |
| 507 |
|
| 508 |
if(!empty($args['setting_type'])){ |
| 509 |
$setting_args['type'] = $args['setting_type']; |
| 510 |
} |
| 511 |
|
| 512 |
$wp_customize->add_setting( $setting_name, $setting_args); |
| 513 |
} |
| 514 |
|
| 515 |
$args['settings'] = $settings_for_control; |
| 516 |
$args['type'] = 'pl_slider'; |
| 517 |
|
| 518 |
$wp_customize->add_control( new Pagelayer_Custom_Control( $wp_customize, $args['control'], $args )); |
| 519 |
} |