layers_generate_customizer_fonts

The Layers layers generate customizer fonts function.

Description

layers_generate_customizer_fonts(); 

Usage

  1. if ( !function_exists( 'layers_generate_customizer_fonts' ) ) { 
  2. require_once '/core/helpers/custom-fonts.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = layers_generate_customizer_fonts(); 
  7.  

Defined (1)

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

/core/helpers/custom-fonts.php  
  1. function layers_generate_customizer_fonts() { 
  2. global $layers_custom_fonts; 
  3.  
  4. // Apply Font Styles 
  5. $customizer_options = Layers_Customizer_Config::get_instance(); 
  6.  
  7. foreach( $customizer_options->controls as $controls ) { 
  8. foreach( $controls as $control_key => $control_data ) { 
  9.  
  10. if( 'layers-font' == $control_data[ 'type' ] && layers_get_theme_mod( $control_key ) ) { 
  11.  
  12. // Add fonts to a bucket for registration 
  13. $layers_custom_fonts[] = layers_get_theme_mod( $control_key ); 
  14.  
  15. $control_data[ 'selectors' ],  
  16. 'font-family',  
  17. array( 
  18. 'font-family' => layers_get_theme_mod( $control_key ) 
  19. );