bp_email_init_customizer

Initialize the Customizer for emails.

Description

bp_email_init_customizer( (WP_Customize_Manager) WP_Customize_Manager $wp_customize ); 

Parameters (1)

0. $wp_customize (WP_Customize_Manager) => WP_Customize_Manager $wp_customize
The Customizer object.

Usage

  1. if ( !function_exists( 'bp_email_init_customizer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-customizer-email.php'; 
  3.  
  4. // The Customizer object. 
  5. $wp_customize = WP_Customize_Manager $wp_customize; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_email_init_customizer($wp_customize); 
  9.  

Defined (1)

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

/bp-core/bp-core-customizer-email.php  
  1. function bp_email_init_customizer( WP_Customize_Manager $wp_customize ) { 
  2.  
  3. // Require WP 4.0+. 
  4. if ( ! method_exists( $wp_customize, 'add_panel' ) ) { 
  5. return; 
  6.  
  7. if ( ! bp_is_email_customizer() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { 
  8. return; 
  9.  
  10. $wp_customize->add_panel( 'bp_mailtpl', array( 
  11. 'description' => __( 'Customize the appearance of emails sent by BuddyPress.', buddypress ),  
  12. 'title' => _x( 'BuddyPress Emails', 'screen heading', buddypress ),  
  13. ) ); 
  14.  
  15. foreach( $sections as $section_id => $args ) { 
  16. $wp_customize->add_section( $section_id, $args ); 
  17.  
  18. foreach( $settings as $setting_id => $args ) { 
  19. $wp_customize->add_setting( $setting_id, $args ); 
  20.  
  21. /** 
  22. * Fires to let plugins register extra Customizer controls for emails. 
  23. * @since 2.5.0 
  24. * @param WP_Customize_Manager $wp_customize The Customizer object. 
  25. */ 
  26.  
  27. foreach ( $controls as $control_id => $args ) { 
  28. $wp_customize->add_control( new $args['class']( $wp_customize, $control_id, $args ) ); 
  29.  
  30. /** 
  31. * Hook actions/filters for further configuration. 
  32. */ 
  33.  
  34.  
  35. if ( is_customize_preview() ) { 
  36. /** 
  37. * Enqueue scripts/styles for the Customizer's preview window. 
  38. * Scripts can't be registered in bp_core_register_common_styles() etc because 
  39. * the Customizer loads very, very early. 
  40. */ 
  41. $bp =buddypress); 
  42.  
  43. 'bp-customizer-receiver-emails',  
  44. "{$bp->plugin_url}bp-core/admin/js/customizer-receiver-emails{$min}.js",  
  45. array( 'customize-preview' ),  
  46. true 
  47. ); 
  48.  
  49. // Include the preview loading style. 
  50. add_action( 'wp_footer', array( $wp_customize, 'customize_preview_loading_style' ) );