mh_impact_lite_customize_register

The MH Impact lite mh impact lite customize register function.

Description

mh_impact_lite_customize_register( $wp_customize ); 

Parameters (1)

0. $wp_customize
The wp customize.

Usage

  1. if ( !function_exists( 'mh_impact_lite_customize_register' ) ) { 
  2. require_once '/includes/mh-customizer.php'; 
  3.  
  4. // The wp customize. 
  5. $wp_customize = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = mh_impact_lite_customize_register($wp_customize); 
  9.  

Defined (1)

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

/includes/mh-customizer.php  
  1. function mh_impact_lite_customize_register($wp_customize) { 
  2.  
  3. /***** Register Custom Controls *****/ 
  4.  
  5. class MH_Impact_Lite_Upgrade extends WP_Customize_Control { 
  6. public function render_content() { ?> 
  7. <p class="mh-upgrade-thumb"> 
  8. <img src="<?php echo get_template_directory_uri(); ?>/images/mh_impact.png" /> 
  9. </p> 
  10. <p class="customize-control-title mh-upgrade-title"> 
  11. <?php esc_html_e('MH Impact Pro', 'mh-impact-lite'); ?> 
  12. </p> 
  13. <p class="textfield mh-upgrade-text"> 
  14. <?php esc_html_e('If you like the free version of this theme, you will LOVE the full version of MH Impact which includes unique custom widgets, additional features and more useful options to customize your website.', 'mh-impact-lite'); ?> 
  15. </p> 
  16. <p class="customize-control-title mh-upgrade-title"> 
  17. <?php esc_html_e('Additional Features:', 'mh-impact-lite'); ?> 
  18. </p> 
  19. <ul class="mh-upgrade-features"> 
  20. <li class="mh-upgrade-feature-item"> 
  21. <?php esc_html_e('Options to modify color scheme', 'mh-impact-lite'); ?> 
  22. </li> 
  23. <li class="mh-upgrade-feature-item"> 
  24. <?php esc_html_e('Typography options', 'mh-impact-lite'); ?> 
  25. </li> 
  26. <li class="mh-upgrade-feature-item"> 
  27. <?php esc_html_e('Additional custom widgets', 'mh-impact-lite'); ?> 
  28. </li> 
  29. <li class="mh-upgrade-feature-item"> 
  30. <?php esc_html_e('Social buttons, and more...', 'mh-impact-lite'); ?> 
  31. </li> 
  32. </ul> 
  33. <p class="mh-button mh-upgrade-button"> 
  34. <a href="https://www.mhthemes.com/themes/mh/impact/" target="_blank" class="button button-secondary"> 
  35. <?php esc_html_e('Upgrade to MH Impact Pro', 'mh-impact-lite'); ?> 
  36. </a> 
  37. </p> 
  38. <p class="mh-button"> 
  39. <a href="https://www.mhthemes.com/themes/showcase/" target="_blank" class="button button-secondary"> 
  40. <?php esc_html_e('MH Themes Showcase', 'mh-impact-lite'); ?> 
  41. </a> 
  42. </p> 
  43. <p class="mh-button"> 
  44. <a href="https://www.mhthemes.com/support/documentation-mh-impact/" target="_blank" class="button button-secondary"> 
  45. <?php esc_html_e('Theme Documentation', 'mh-impact-lite'); ?> 
  46. </a> 
  47. </p> 
  48. <p class="mh-button"> 
  49. <a href="https://wordpress.org/support/theme/mh-impact-lite" target="_blank" class="button button-secondary"> 
  50. <?php esc_html_e('Support Forum', 'mh-impact-lite'); ?> 
  51. </a> 
  52. </p><?php 
  53.  
  54. /***** Add Panels *****/ 
  55.  
  56. $wp_customize->add_panel('mh_theme_options', array('title' => esc_html__('Theme Options', 'mh-impact-lite'), 'description' => '', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'priority' => 1, )); 
  57.  
  58. /***** Add Sections *****/ 
  59.  
  60. $wp_customize->add_section('mh_impact_lite_general', array('title' => esc_html__('General', 'mh-impact-lite'), 'priority' => 1, 'panel' => 'mh_theme_options')); 
  61. $wp_customize->add_section('mh_impact_lite_upgrade', array('title' => esc_html__('More Features', 'mh-impact-lite'), 'priority' => 2, 'panel' => 'mh_theme_options')); 
  62.  
  63. /***** Add Settings *****/ 
  64.  
  65. $wp_customize->add_setting('mh_impact_lite_options[excerpt_length]', array('default' => 45, 'type' => 'option', 'sanitize_callback' => 'mh_impact_lite_sanitize_integer')); 
  66. $wp_customize->add_setting('mh_impact_lite_options[excerpt_more]', array('default' => esc_html__('[Read More]', 'mh-impact-lite'), 'type' => 'option', 'sanitize_callback' => 'mh_impact_lite_sanitize_text')); 
  67. $wp_customize->add_setting('mh_impact_lite_options[sidebar]', array('default' => 'right', 'type' => 'option', 'sanitize_callback' => 'mh_impact_lite_sanitize_select')); 
  68. $wp_customize->add_setting('mh_impact_lite_options[premium_version_upgrade]', array('default' => '', 'type' => 'option', 'sanitize_callback' => 'esc_attr')); 
  69.  
  70. /***** Add Controls *****/ 
  71.  
  72. $wp_customize->add_control('excerpt_length', array('label' => esc_html__('Custom Excerpt Length in Words', 'mh-impact-lite'), 'section' => 'mh_impact_lite_general', 'settings' => 'mh_impact_lite_options[excerpt_length]', 'priority' => 1, 'type' => 'text')); 
  73. $wp_customize->add_control('excerpt_more', array('label' => esc_html__('Custom Excerpt More-Text', 'mh-impact-lite'), 'section' => 'mh_impact_lite_general', 'settings' => 'mh_impact_lite_options[excerpt_more]', 'priority' => 2, 'type' => 'text')); 
  74. $wp_customize->add_control('sidebar', array('label' => esc_html__('Sidebar', 'mh-impact-lite'), 'section' => 'mh_impact_lite_general', 'settings' => 'mh_impact_lite_options[sidebar]', 'priority' => 3, 'type' => 'select', 'choices' => array('right' => esc_html__('Right Sidebar', 'mh-impact-lite'), 'left' => esc_html__('Left Sidebar', 'mh-impact-lite')))); 
  75. $wp_customize->add_control(new MH_Impact_Lite_Upgrade($wp_customize, 'premium_version_upgrade', array('section' => 'mh_impact_lite_upgrade', 'settings' => 'mh_impact_lite_options[premium_version_upgrade]', 'priority' => 1))); 
  76.