Hi there, when I insert this code snippet from your Using Hooks documentation into a php checker, I get a syntax error about a bracket, both with and without my own code content, but I’mnot able to locate the error.
Can you help?
add_action( 'your_hook_name','example_function_name' );
function example_function_name() { ?>
<?php }
PHP Syntax Check: Parse error: Unmatched ‘}’ in your code on line 28
add_action( 'bp_after_member_profile_content','example_function_name' );
function example_function_name() { ?>
<span class="block-report">
<?php
if ( is_user_logged_in() && function_exists( 'bp_send_private_message_button' ) && bp_is_user() && ! bp_is_my_profile() ) {
echo bp_send_private_message_button(bp_displayed_user_id() );
}
if ( is_user_logged_in() && function_exists( 'bublock_get_button' ) && bp_is_user() && ! bp_is_my_profile() ) {
echo bublock_get_button(bp_displayed_user_id() );
}
if ( function_exists( 'bpmts_report_button' ) && function_exists( 'bpmts_is_me' ) && ! bpmts_is_me( bp_displayed_user_id() ) && bpmts_user_can_report() ) {
bpmts_report_button( array(
'item_id' => bp_displayed_user_id(),
'item_type' => 'user',
'context' => 'bp_user_header',
'context_id' => bp_displayed_user_id(),
) );
}
?>
</span>
<?php }