bp_activity_embed_add_inline_styles

Add inline styles for BP activity embeds.

Description

bp_activity_embed_add_inline_styles(); 

Usage

  1. if ( !function_exists( 'bp_activity_embed_add_inline_styles' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-embeds.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_activity_embed_add_inline_styles(); 
  7.  

Defined (1)

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

/bp-activity/bp-activity-embeds.php  
  1. function bp_activity_embed_add_inline_styles() { 
  2. if ( false === bp_is_single_activity() ) { 
  3. return; 
  4.  
  5.  
  6. if ( is_rtl() ) { 
  7. $css = bp_locate_template_asset( "css/embeds-activity-rtl{$min}.css" ); 
  8. } else { 
  9. $css = bp_locate_template_asset( "css/embeds-activity{$min}.css" ); 
  10.  
  11. // Bail if file wasn't found. 
  12. if ( false === $css ) { 
  13. return; 
  14.  
  15. // Grab contents of CSS file and do some rudimentary CSS protection. 
  16. $css = file_get_contents( $css['file'] ); 
  17. $css = wp_kses( $css, array( "\'", '\"' ) ); 
  18.  
  19. printf( '<style type="text/css">%s</style>', $css );