Tagged: remove button text
hi,
To remove the text from the activity delete button and replace it by an icon, I inspected bp-activity-template.php file, and in line 2616 there is the function bp_activity_delete_link() called in entry.php file, and the hook bp_get_activity_delete_link.function bp_get_activity_delete_link() { $url = bp_get_activity_delete_url(); $class = 'delete-activity'; // Determine if we're on a single activity page, and customize accordingly. if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { $class = 'delete-activity-single'; } $link = '<a href="' . esc_url( $url ) . '" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>'; /** * Filters the activity delete link. * * @since 1.1.0 * * @param string $link Activity delete HTML link. */ return apply_filters( 'bp_get_activity_delete_link', $link ); }
To remove the text of the button, I created this function whith the sample of the original hook
function yoostart_remove_activity_delete_text(){ $url = bp_get_activity_delete_url(); $class = 'delete-activity'; $link = '<a href="' . esc_url( $url ) . '" rel="nofollow">' . __( '', 'buddypress' ) . '</a>'; return $link; } add_filter('bp_get_activity_delete_link', 'yoostart_remove_activity_delete_text' );
it’s work, but i’m beginner and I would like to know if this function isn’t likely to create errors
thank you
AhmedThank you for the help here @ravisharma
Closing it since it is resolved.
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘ [Resolved] remove activity delete button text’ is closed to new replies.
This topic is: resolved