mh_newsdesk_lite_customize_register

The MH Newsdesk lite mh newsdesk lite customize register function.

Description

mh_newsdesk_lite_customize_register( $wp_customize ); 

Parameters (1)

0. $wp_customize
The wp customize.

Usage

  1. if ( !function_exists( 'mh_newsdesk_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_newsdesk_lite_customize_register($wp_customize); 
  9.  

Defined (1)

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

/includes/mh-customizer.php  
  1. function mh_newsdesk_lite_customize_register($wp_customize) { 
  2.  
  3. /***** Register Custom Controls *****/ 
  4.  
  5. class MH_Newsdesk_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_newsdesk.png" /> 
  9. </p> 
  10. <p class="customize-control-title mh-upgrade-title"> 
  11. <?php esc_html_e('MH Newsdesk Pro', 'mh-newsdesk-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 Newsdesk which includes unique custom widgets, additional features and more useful options to customize your website.', 'mh-newsdesk-lite'); ?> 
  15. </p> 
  16. <p class="customize-control-title mh-upgrade-title"> 
  17. <?php esc_html_e('Additional Features:', 'mh-newsdesk-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-newsdesk-lite'); ?> 
  22. </li> 
  23. <li class="mh-upgrade-feature-item"> 
  24. <?php esc_html_e('Typography options', 'mh-newsdesk-lite'); ?> 
  25. </li> 
  26. <li class="mh-upgrade-feature-item"> 
  27. <?php esc_html_e('Several additional widget areas', 'mh-newsdesk-lite'); ?> 
  28. </li> 
  29. <li class="mh-upgrade-feature-item"> 
  30. <?php esc_html_e('Additional custom widgets', 'mh-newsdesk-lite'); ?> 
  31. </li> 
  32. <li class="mh-upgrade-feature-item"> 
  33. <?php esc_html_e('Additional custom menu slots', 'mh-newsdesk-lite'); ?> 
  34. </li> 
  35. <li class="mh-upgrade-feature-item"> 
  36. <?php esc_html_e('Social buttons, related articles, ...', 'mh-newsdesk-lite'); ?> 
  37. </li> 
  38. <li class="mh-upgrade-feature-item"> 
  39. <?php esc_html_e('News ticker and many more...', 'mh-newsdesk-lite'); ?> 
  40. </li> 
  41. </ul> 
  42. <p class="mh-button mh-upgrade-button"> 
  43. <a href="http://www.mhthemes.com/themes/mh/newsdesk/" target="_blank" class="button button-secondary"> 
  44. <?php esc_html_e('Upgrade to MH Newsdesk Pro', 'mh-newsdesk-lite'); ?> 
  45. </a> 
  46. </p> 
  47. <p class="mh-button"> 
  48. <a href="http://www.mhthemes.com/themes/showcase/" target="_blank" class="button button-secondary"> 
  49. <?php esc_html_e('MH Themes Showcase', 'mh-newsdesk-lite'); ?> 
  50. </a> 
  51. </p> 
  52. <p class="mh-button"> 
  53. <a href="http://www.mhthemes.com/support/documentation-mh-newsdesk/" target="_blank" class="button button-secondary"> 
  54. <?php esc_html_e('Theme Documentation', 'mh-newsdesk-lite'); ?> 
  55. </a> 
  56. </p> 
  57. <p class="mh-button"> 
  58. <a href="https://wordpress.org/support/theme/mh-newsdesk-lite" target="_blank" class="button button-secondary"> 
  59. <?php esc_html_e('Support Forum', 'mh-newsdesk-lite'); ?> 
  60. </a> 
  61. </p><?php 
  62.  
  63. /***** Add Panels *****/ 
  64.  
  65. $wp_customize->add_panel('mh_theme_options', array('title' => esc_html__('Theme Options', 'mh-newsdesk-lite'), 'description' => '', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'priority' => 1, )); 
  66.  
  67. /***** Add Sections *****/ 
  68.  
  69. $wp_customize->add_section('mh_newsdesk_lite_general', array('title' => esc_html__('General', 'mh-newsdesk-lite'), 'priority' => 1, 'panel' => 'mh_theme_options')); 
  70. $wp_customize->add_section('mh_newsdesk_lite_upgrade', array('title' => esc_html__('More Features', 'mh-newsdesk-lite'), 'priority' => 2, 'panel' => 'mh_theme_options')); 
  71.  
  72. /***** Add Settings *****/ 
  73.  
  74. $wp_customize->add_setting('mh_newsdesk_lite_options[excerpt_length]', array('default' => 35, 'type' => 'option', 'sanitize_callback' => 'mh_newsdesk_lite_sanitize_integer')); 
  75. $wp_customize->add_setting('mh_newsdesk_lite_options[excerpt_more]', array('default' => esc_html__('Read More', 'mh-newsdesk-lite'), 'type' => 'option', 'sanitize_callback' => 'mh_newsdesk_lite_sanitize_text')); 
  76. $wp_customize->add_setting('mh_newsdesk_lite_options[sidebar]', array('default' => 'right', 'type' => 'option', 'sanitize_callback' => 'mh_newsdesk_lite_sanitize_select')); 
  77. $wp_customize->add_setting('mh_newsdesk_lite_options[premium_version_upgrade]', array('default' => '', 'type' => 'option', 'sanitize_callback' => 'esc_attr')); 
  78.  
  79. /***** Add Controls *****/ 
  80.  
  81. $wp_customize->add_control('excerpt_length', array('label' => esc_html__('Custom Excerpt Length in Words', 'mh-newsdesk-lite'), 'section' => 'mh_newsdesk_lite_general', 'settings' => 'mh_newsdesk_lite_options[excerpt_length]', 'priority' => 1, 'type' => 'text')); 
  82. $wp_customize->add_control('excerpt_more', array('label' => esc_html__('Custom Excerpt More-Text', 'mh-newsdesk-lite'), 'section' => 'mh_newsdesk_lite_general', 'settings' => 'mh_newsdesk_lite_options[excerpt_more]', 'priority' => 2, 'type' => 'text')); 
  83. $wp_customize->add_control('sidebar', array('label' => esc_html__('Sidebar', 'mh-newsdesk-lite'), 'section' => 'mh_newsdesk_lite_general', 'settings' => 'mh_newsdesk_lite_options[sidebar]', 'priority' => 3, 'type' => 'select', 'choices' => array('right' => esc_html__('Right Sidebar', 'mh-newsdesk-lite'), 'left' => esc_html__('Left Sidebar', 'mh-newsdesk-lite')))); 
  84. $wp_customize->add_control(new MH_Newsdesk_Lite_Upgrade($wp_customize, 'premium_version_upgrade', array('section' => 'mh_newsdesk_lite_upgrade', 'settings' => 'mh_newsdesk_lite_options[premium_version_upgrade]', 'priority' => 1)));