Changeset 10864 for trunk/src/bp-activity/bp-activity-embeds.php
- Timestamp:
- 06/01/2016 10:39:41 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-embeds.php
r10853 r10864 55 55 * Add inline styles for BP activity embeds. 56 56 * 57 * This is subject to change or be removed entirely for a different system.58 * Potentially for BP_Legacy::locate_asset_in_stack().59 *60 57 * @since 2.6.0 61 * @access private 62 */ 63 function _bp_activity_embed_add_inline_styles() { 58 */ 59 function bp_activity_embed_add_inline_styles() { 64 60 if ( false === bp_is_single_activity() ) { 65 61 return; 66 62 } 67 63 68 ob_start(); 64 $min = bp_core_get_minified_asset_suffix(); 65 69 66 if ( is_rtl() ) { 70 bp_get_asset_template_part( 'embeds/css-activity', 'rtl');67 $css = bp_locate_template_asset( "assets/embeds/activity-rtl{$min}.css" ); 71 68 } else { 72 bp_get_asset_template_part( 'embeds/css-activity' ); 73 } 74 $css = ob_get_clean(); 75 76 // Rudimentary CSS protection. 69 $css = bp_locate_template_asset( "assets/embeds/activity{$min}.css" ); 70 } 71 72 // Bail if file wasn't found. 73 if ( false === $css ) { 74 return; 75 } 76 77 // Grab contents of CSS file and do some rudimentary CSS protection. 78 $css = file_get_contents( $css['file'] ); 77 79 $css = wp_kses( $css, array( "\'", '\"' ) ); 78 80 79 81 printf( '<style type="text/css">%s</style>', $css ); 80 82 } 81 add_action( 'embed_head', ' _bp_activity_embed_add_inline_styles', 20 );83 add_action( 'embed_head', 'bp_activity_embed_add_inline_styles', 20 ); 82 84 83 85 /**
Note: See TracChangeset
for help on using the changeset viewer.