mh_magazine_lite_customize_register

The MH Magazine lite mh magazine lite customize register function.

Description

mh_magazine_lite_customize_register( $wp_customize ); 

Parameters (1)

0. $wp_customize
The wp customize.

Usage

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

Defined (1)

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

/includes/mh-customizer.php  
  1. function mh_magazine_lite_customize_register($wp_customize) { 
  2.  
  3. /***** Register Custom Controls *****/ 
  4.  
  5. class MH_Magazine_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_magazine.png" /> 
  9. </p> 
  10. <p class="customize-control-title mh-upgrade-title"> 
  11. <?php esc_html_e('MH Magazine Pro', 'mh-magazine-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 Magazine which includes unique custom widgets, additional features and more useful options to customize your website.', 'mh-magazine-lite'); ?> 
  15. </p> 
  16. <p class="customize-control-title mh-upgrade-title"> 
  17. <?php esc_html_e('Additional Features:', 'mh-magazine-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-magazine-lite'); ?> 
  22. </li> 
  23. <li class="mh-upgrade-feature-item"> 
  24. <?php esc_html_e('Typography options', 'mh-magazine-lite'); ?> 
  25. </li> 
  26. <li class="mh-upgrade-feature-item"> 
  27. <?php esc_html_e('Several additional widget areas', 'mh-magazine-lite'); ?> 
  28. </li> 
  29. <li class="mh-upgrade-feature-item"> 
  30. <?php esc_html_e('Additional custom widgets', 'mh-magazine-lite'); ?> 
  31. </li> 
  32. <li class="mh-upgrade-feature-item"> 
  33. <?php esc_html_e('Extended layout options', 'mh-magazine-lite'); ?> 
  34. </li> 
  35. <li class="mh-upgrade-feature-item"> 
  36. <?php esc_html_e('Additional custom menu slots', 'mh-magazine-lite'); ?> 
  37. </li> 
  38. <li class="mh-upgrade-feature-item"> 
  39. <?php esc_html_e('Advanced advertising options', 'mh-magazine-lite'); ?> 
  40. </li> 
  41. <li class="mh-upgrade-feature-item"> 
  42. <?php esc_html_e('Social buttons, related articles, ...', 'mh-magazine-lite'); ?> 
  43. </li> 
  44. <li class="mh-upgrade-feature-item"> 
  45. <?php esc_html_e('News ticker and many more...', 'mh-magazine-lite'); ?> 
  46. </li> 
  47. </ul> 
  48. <p class="mh-button mh-upgrade-button"> 
  49. <a href="http://www.mhthemes.com/themes/mh/magazine/" target="_blank" class="button button-secondary"> 
  50. <?php esc_html_e('Upgrade to MH Magazine Pro', 'mh-magazine-lite'); ?> 
  51. </a> 
  52. </p> 
  53. <p class="mh-button"> 
  54. <a href="http://www.mhthemes.com/themes/mh/magazine/#demos" target="_blank" class="button button-secondary"> 
  55. <?php esc_html_e('Theme Demos', 'mh-magazine-lite'); ?> 
  56. </a> 
  57. </p> 
  58. <p class="mh-button"> 
  59. <a href="http://www.mhthemes.com/themes/showcase/" target="_blank" class="button button-secondary"> 
  60. <?php esc_html_e('MH Themes Showcase', 'mh-magazine-lite'); ?> 
  61. </a> 
  62. </p> 
  63. <p class="mh-button"> 
  64. <a href="http://www.mhthemes.com/support/documentation-mh-magazine/" target="_blank" class="button button-secondary"> 
  65. <?php esc_html_e('Theme Documentation', 'mh-magazine-lite'); ?> 
  66. </a> 
  67. </p> 
  68. <p class="mh-button"> 
  69. <a href="https://wordpress.org/support/theme/mh-magazine-lite" target="_blank" class="button button-secondary"> 
  70. <?php esc_html_e('Support Forum', 'mh-magazine-lite'); ?> 
  71. </a> 
  72. </p><?php 
  73.  
  74. /***** Add Panels *****/ 
  75.  
  76. $wp_customize->add_panel('mh_theme_options', array('title' => esc_html__('Theme Options', 'mh-magazine-lite'), 'description' => '', 'capability' => 'edit_theme_options', 'theme_supports' => '', 'priority' => 1)); 
  77.  
  78. /***** Add Sections *****/ 
  79.  
  80. $wp_customize->add_section('mh_magazine_lite_general', array('title' => esc_html__('General', 'mh-magazine-lite'), 'priority' => 1, 'panel' => 'mh_theme_options')); 
  81. $wp_customize->add_section('mh_magazine_lite_layout', array('title' => esc_html__('Layout', 'mh-magazine-lite'), 'priority' => 2, 'panel' => 'mh_theme_options')); 
  82. $wp_customize->add_section('mh_magazine_lite_upgrade', array('title' => esc_html__('More Features & Options', 'mh-magazine-lite'), 'priority' => 3, 'panel' => 'mh_theme_options')); 
  83.  
  84. /***** Add Settings *****/ 
  85.  
  86. $wp_customize->add_setting('mh_magazine_lite_options[excerpt_length]', array('default' => 25, 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_integer')); 
  87. $wp_customize->add_setting('mh_magazine_lite_options[excerpt_more]', array('default' => '[...]', 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_text')); 
  88. $wp_customize->add_setting('mh_magazine_lite_options[sb_position]', array('default' => 'right', 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_select')); 
  89. $wp_customize->add_setting('mh_magazine_lite_options[author_box]', array('default' => 'enable', 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_select')); 
  90. $wp_customize->add_setting('mh_magazine_lite_options[post_nav]', array('default' => 'enable', 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_select')); 
  91. $wp_customize->add_setting('mh_magazine_lite_options[premium_version_upgrade]', array('default' => '', 'type' => 'option', 'sanitize_callback' => 'esc_attr')); 
  92. $wp_customize->add_setting('mh_magazine_lite_options[full_bg]', array('default' => '', 'type' => 'option', 'sanitize_callback' => 'mh_sanitize_checkbox')); 
  93.  
  94. /***** Add Controls *****/ 
  95.  
  96. $wp_customize->add_control('excerpt_length', array('label' => esc_html__('Custom excerpt length in words', 'mh-magazine-lite'), 'section' => 'mh_magazine_lite_general', 'settings' => 'mh_magazine_lite_options[excerpt_length]', 'priority' => 1, 'type' => 'text')); 
  97. $wp_customize->add_control('excerpt_more', array('label' => esc_html__('Custom excerpt more text', 'mh-magazine-lite'), 'section' => 'mh_magazine_lite_general', 'settings' => 'mh_magazine_lite_options[excerpt_more]', 'priority' => 2, 'type' => 'text')); 
  98. $wp_customize->add_control('sb_position', array('label' => esc_html__('Position of default sidebar', 'mh-magazine-lite'), 'section' => 'mh_magazine_lite_layout', 'settings' => 'mh_magazine_lite_options[sb_position]', 'priority' => 1, 'type' => 'select', 'choices' => array('left' => esc_html__('Left', 'mh-magazine-lite'), 'right' => esc_html__('Right', 'mh-magazine-lite')))); 
  99. $wp_customize->add_control('author_box', array('label' => esc_html__('Author Box', 'mh-magazine-lite'), 'section' => 'mh_magazine_lite_layout', 'settings' => 'mh_magazine_lite_options[author_box]', 'priority' => 2, 'type' => 'select', 'choices' => array('enable' => esc_html__('Enable', 'mh-magazine-lite'), 'disable' => esc_html__('Disable', 'mh-magazine-lite')))); 
  100. $wp_customize->add_control('post_nav', array('label' => esc_html__('Post/Attachment Navigation', 'mh-magazine-lite'), 'section' => 'mh_magazine_lite_layout', 'settings' => 'mh_magazine_lite_options[post_nav]', 'priority' => 4, 'type' => 'select', 'choices' => array('enable' => esc_html__('Enable', 'mh-magazine-lite'), 'disable' => esc_html__('Disable', 'mh-magazine-lite')))); 
  101. $wp_customize->add_control(new MH_Magazine_Lite_Upgrade($wp_customize, 'premium_version_upgrade', array('section' => 'mh_magazine_lite_upgrade', 'settings' => 'mh_magazine_lite_options[premium_version_upgrade]', 'priority' => 1))); 
  102. $wp_customize->add_control('full_bg', array('label' => esc_html__('Scale background image to full size', 'mh-magazine-lite'), 'section' => 'background_image', 'settings' => 'mh_magazine_lite_options[full_bg]', 'priority' => 99, 'type' => 'checkbox'));