bp_get_the_message_star_action_link

Filters the star action link, including markup.

Description

Parameters (2)

0. $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a — Optional. (string) => ' ' . $r['text_' . $action] . ''
The title esc attr title class message action esc attr action data star status esc attr action data star nonce esc attr nonce bulk attr data message id esc attr int message id href retval span class icon span span class bp screen reader text r text action span a.
1. $r (array)
Parsed link arguments. See $args in bp_get_the_message_star_action_link().

Usage

To run the hook, copy the example below.
  1. $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a = apply_filters( 'bp_get_the_message_star_action_link', $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a, $r ); 
  2.  
  3. if ( !empty( $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_get_the_message_star_action_link callback 
  2. function filter_bp_get_the_message_star_action_link( $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a, $r ) { 
  3. // make filter magic happen here... 
  4. return $a_title_esc_attr_title_class_message_action_esc_attr_action_data_star_status_esc_attr_action_data_star_nonce_esc_attr_nonce_bulk_attr_data_message_id_esc_attr_int_message_id_href_retval_span_class_icon_span_span_class_bp_screen_reader_text_r_text_action_span_a
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_get_the_message_star_action_link', 'filter_bp_get_the_message_star_action_link', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_get_the_message_star_action_link', 'filter_bp_get_the_message_star_action_link', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-messages/bp-messages-star.php  
  1. return apply_filters( 'bp_get_the_message_star_action_link', '<a title="' . esc_attr( $title ) . '" class="message-action-' . esc_attr( $action ) . '" data-star-status="' . esc_attr( $action ) .'" data-star-nonce="' . esc_attr( $nonce ) . '"' . $bulk_attr . ' data-message-id="' . esc_attr( (int) $message_id ) . '" href="' . $retval . '"><span class="icon"></span> <span class="bp-screen-reader-text">' . $r['text_' . $action] . '</span></a>', $r );