Override Plugin Function with Hooks
-
Hello there,
Got some trouble and can’t figure out to fix despite a lot of hours spent.
I have a function that I need to override to change the translation. I can’t just translate it through strings with WPML of course.
function bp_nouveau_activity_state() { $activity_id = bp_get_activity_id(); $like_text = bp_activity_get_favorite_users_string( $activity_id ); $comment_count = bp_activity_get_comment_count(); $favorited_users = bp_activity_get_favorite_users_tooltip_string( $activity_id ); ?> <div class="activity-state <?php echo $like_text ? 'has-likes' : ''; ?> <?php echo $comment_count ? 'has-comments' : ''; ?>"> <a href="javascript:void(0);" class="activity-state-likes"> <span class="like-text hint--bottom hint--medium hint--multiline" data-hint="<?php echo $favorited_users; ?>"><?php echo $like_text ?: ''; ?></span> </a> <span class="ac-state-separator">·</span> <a href="#" class="activity-state-comments"> <span class="comments-count"> <?php if ( $comment_count > 1 ) { echo $comment_count . ' ' . __( 'Comments', 'buddyboss' ); } else { echo $comment_count . ' ' . __( 'Comment', 'buddyboss' ); } ?> </span> </a> </div> <?php }
I want to use a hook (filter if I am not wrong) in my child theme so I can change the “Comments” and “Comment” line to something else that I can translate after that.
Any help ? Thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Override Plugin Function with Hooks’ is closed to new replies.