Kevin Brands
asked 7 years ago

Hello,
I’m using the Q&A Pro plugin and I’ve managed to customize it a lot.
But there’s one thing I’m struggling with, it’s in the following function:

function dwqa_get_latest_activity_text( $context ) {
 $latest_activity_texts = apply_filters( 'dwqa_get_latest_activity_text', array(
 'answered' => __( 'answered', 'dwqa' ),
 'commented' => __( 'commented', 'dwqa' ),
 ) );
foreach( $latest_activity_texts as $key => $text ) {
if ( $context == $key ) {
return $text;
}
}

return $context;
}

Is there a way for me to change the words ‘answered’ and ‘commented’? (I don’t want to translate them, but really want to change the words)

1 Answers
Allen
answered 7 years ago

Well, you can change the text in the brackets to what you want to translate:

__( 'answered', 'dwqa' ),

Change :

__( 'your words', 'dwqa' ),
Kevin Brands
replied 7 years ago

This is a way of doing it. But: the function is located in the plugin. So changing the text like this would mean changing a core file of the plugin. And that’s not a good solution.

Maybe I’m looking for a way to change the function outside of the plugin files. I’ve tried several thing in my functions.php, but the function doesn’t seem to be pluggable..

Allen
replied 7 years ago

so sorry but at this time… i think there is no other way 🙁

Powered by DW Question & Answer Pro