bp_nouveau_messages_catch_hook_content( array $hooks = array() )

Fires Messages Legacy hooks to catch the content and add them as extra keys to the JSON Messages UI reply.


Description Description


Parameters Parameters

$hooks

(Optional) The list of hooks to fire.

Default value: array()


Top ↑

Return Return

(array) An associative containing the caught content.


Top ↑

Source Source

File: bp-templates/bp-nouveau/includes/messages/functions.php

function bp_nouveau_messages_catch_hook_content( $hooks = array() ) {
	$content = array();

	ob_start();
	foreach ( $hooks as $js_key => $hook ) {
		if ( ! has_action( $hook ) ) {
			continue;
		}

		// Fire the hook.
		do_action( $hook );

		// Catch the sanitized content.
		$content[ $js_key ] = bp_strip_script_and_style_tags( ob_get_contents() );

		// Clean the buffer.
		ob_clean();
	}
	ob_end_clean();

	return $content;
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.