retesere20

Untitled

Oct 29th, 2017
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'customize_register', 'cefgwrg3434', 21 );
  2.  
  3. function cefgwrg3434( $wp_customize ) {
  4. $defaults = sgwindow_get_defaults();
  5.  
  6.  
  7. //site width range + text
  8. $wp_customize->add_setting( 'width_site_range', array(
  9. 'type' => 'empty',
  10. 'default' => sgwindow_get_theme_mod('width_site'),
  11. 'capability' => 'edit_theme_options',
  12. 'transport' => 'postMessage',
  13. 'sanitize_callback' => 'absint'
  14. ) );
  15.  
  16. $wp_customize->add_control( 'width_site_range', array(
  17. 'label' => __( '(px)', 'sg-window' ),
  18. 'section' => 'size',
  19. 'settings' => 'width_site_range',
  20. 'type' => 'range',
  21. 'input_attrs' => array(
  22. 'min' => 960,
  23. 'max' => 2200,
  24. 'step' => 1,),
  25. 'priority' => $priority++,
  26. ));
  27.  
  28. $wp_customize->add_setting( 'width_site', array(
  29. 'type' => 'theme_mod',
  30. 'default' => $defaults['width_site'],
  31. 'capability' => 'edit_theme_options',
  32. 'transport' => 'postMessage',
  33. 'section' => 'size',
  34. 'sanitize_callback' => 'sgwindow_sanitize_range_width'
  35. ) );
  36.  
  37. $wp_customize->add_control( 'width_site', array(
  38. 'label' => __( 'Width of the site', 'sg-window' ),
  39. 'section' => 'size',
  40. 'settings' => 'width_site',
  41. 'type' => 'text',
  42. 'priority' => $priority++,
  43. ) );
  44.  
  45.  
  46.  
  47. //New section in customizer: Logotype
  48. $wp_customize->add_section( 'footer_text_settings', array(
  49. 'title' => __( 'Footer text', 'sg-window' ),
  50. 'priority' => $section_priority++,
  51. 'panel' => 'other',
  52. ) );
  53.  
  54. //New setting in Logotype section: Logo Image
  55. $wp_customize->add_setting( 'footer_text', array(
  56. 'default' => $defaults['footer_text'],
  57. //'sanitize_callback' => 'sgwindow_sanitize_url',
  58. 'capability' => 'edit_theme_options'
  59. ) );
  60. $wp_customize->add_control( 'footr_txt_', array(
  61. 'label' => __('Footer text', 'sg-window'),
  62. 'section' => 'footer_text_settings',
  63. 'settings' => 'footer_text',
  64. 'priority' => '1',
  65. ) );
  66.  
  67. }
RAW Paste Data