- Timestamp:
- 05/25/2018 03:48:20 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/messages/functions.php
r12119 r12121 439 439 ); 440 440 } 441 442 /** 443 * Fires Messages Legacy hooks to catch the content and add them 444 * as extra keys to the JSON Messages UI reply. 445 * 446 * @since 3.0.1 447 * 448 * @param array $hooks The list of hooks to fire. 449 * @return array An associative containing the caught content. 450 */ 451 function bp_nouveau_messages_catch_hook_content( $hooks = array() ) { 452 $content = array(); 453 454 ob_start(); 455 foreach ( $hooks as $js_key => $hook ) { 456 if ( ! has_action( $hook ) ) { 457 continue; 458 } 459 460 // Fire the hook. 461 do_action( $hook ); 462 463 // Catch the sanitized content. 464 $content[ $js_key ] = bp_strip_script_and_style_tags( ob_get_contents() ); 465 466 // Clean the buffer. 467 ob_clean(); 468 } 469 ob_end_clean(); 470 471 return $content; 472 }
Note: See TracChangeset
for help on using the changeset viewer.