bp_email_customizer_hide_sections

Only show email sections in the Customizer.

Description

bp_email_customizer_hide_sections( (bool) $active, (WP_Customize_Section) $section ); 

Parameters (2)

0. $active (bool)
Whether the Customizer section is active.
1. $section (WP_Customize_Section)
The section.

Options

  • instance. (WP_Customize_Section}) => null
array(
    'instance.' => null
);        


Usage

  1. if ( !function_exists( 'bp_email_customizer_hide_sections' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-customizer-email.php'; 
  3.  
  4. // Whether the Customizer section is active. 
  5. $active = true; 
  6.  
  7. // The section. 
  8. $section = array( 
  9. 'instance.' => null 
  10. ); 
  11.  
  12. // NOTICE! Understand what this does before running. 
  13. $result = bp_email_customizer_hide_sections($active, $section); 
  14.  

Defined (1)

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

/bp-core/bp-core-customizer-email.php  
  1. function bp_email_customizer_hide_sections( $active, $section ) { 
  2. if ( ! bp_is_email_customizer() ) { 
  3. return $active; 
  4.  
  5. return in_array( $section->id, array_keys( bp_email_get_customizer_sections() ), true );