asp_shortcode_output

Allows manipulating the executed search shortcode output

$out = apply_filters('asp_shortcode_output', $out, $id);

Parameters

  • $out (string) - shortcode output

  • $id (int) - search instance ID

Usage

add_filter( 'asp_shortcode_output', 'asp_change_shortcode_output', 10, 2 );
function asp_change_shortcode_output( $output, $id ) {
	// display the search shortcode for admins only
	if ( current_user_can('administrator') ) {
		return $out;
	} else {
		return '';
	}
}

Last updated

Copyright Ernest Marcinko