Title: hook for replace plugin text
Last modified: May 29, 2020

---

# hook for replace plugin text

 *  Resolved [Phil](https://wordpress.org/support/users/philstudio/)
 * (@philstudio)
 * [6 years ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/)
 * Hello, Fahid.
    Thank you for your plugin. I want to replace the words: “based
   on ___ reviews” with other words. I tried to do it like this:
 *     ```
       function replace_text($text) {
       	$text = str_replace(' based on ', ' first text ', $text);
       	$text = str_replace(' reviews', ' secnd text', $text);
       	return $text;
       }
       add_filter('the_content', 'replace_text');
       ```
   
 * But this does not work with plugin text.
    But this works with the post text. 
   Please help me find a hook with which you can solve this problem. Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhook-for-replace-plugin-text%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Fahid Javid](https://wordpress.org/support/users/fahidjavid/)
 * (@fahidjavid)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12915115)
 * Hi,
 * This plugin is translation ready so you may translate it to any words via PO 
   and MO file method.
 * If you don’t want to use that method then you can use this plugin to modify any
   string on your site: [https://wordpress.org/plugins/real-time-find-and-replace/](https://wordpress.org/plugins/real-time-find-and-replace/)
 * Regards,
 * Fahid
 *  Thread Starter [Phil](https://wordpress.org/support/users/philstudio/)
 * (@philstudio)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12915592)
 * Thank you for your answer [@fahidjavid](https://wordpress.org/support/users/fahidjavid/)
 * Only 18 variables in your plugin are available for translation.
 * Allow Stars Rating for comments on this page.
    Average Rating Above Comments 
   Section Check the post types on which you want to enable stars rating feature.
   Donate “Stars Rating” And Similar OpenSource Projects! Enabled Post Types Error:
   You did not add a rating. Hit the Back button on your Web browser and resubmit
   your comment with a rating. For example: Product, Service, Brand, Event Hide 
   No Regular Require Rating Selection Show Solid Stars Rating Stars Rating In Google
   Search Results Stars Style Type of Reviews In Google Search Results Yes
 * But there are no variables: “based on” and “reviews”
 *  Plugin Author [Fahid Javid](https://wordpress.org/support/users/fahidjavid/)
 * (@fahidjavid)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12930385)
 * Hi there,
 * I just pushed an update to this plugin version 3.4.0
 * Please update to your plugin and you will have those missing strings to translate!
   
   Let me know if you face any issues in this regard.
 * BTW, looking forward to your good review for this plugin 🙂
 * Best wishes,
 * Fahid
 *  Thread Starter [Phil](https://wordpress.org/support/users/philstudio/)
 * (@philstudio)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12930831)
 * Hi, [@fahidjavid](https://wordpress.org/support/users/fahidjavid/)
    Thank you
   for your work. I updated the plugin and tried to translate it using Loco translate
   [https://wordpress.org/plugins/loco-translate/](https://wordpress.org/plugins/loco-translate/).
   But the same 18 variables are available for translation and there are no needed
   variables “based on” and “reviews”. Check it. [https://sun9-58.userapi.com/59F9UA54noN4o4ddahsKSvs85wIEbuONd9jLBg/rlPEJs1EjrY.jpg](https://sun9-58.userapi.com/59F9UA54noN4o4ddahsKSvs85wIEbuONd9jLBg/rlPEJs1EjrY.jpg)
   Thank you again.
 *  Thread Starter [Phil](https://wordpress.org/support/users/philstudio/)
 * (@philstudio)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12930930)
 * I’m sorry, [@fahidjavid](https://wordpress.org/support/users/fahidjavid/).
    All
   ok. I added variables to the template and it works. Thank you so much.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘hook for replace plugin text’ is closed to new replies.

 * ![](https://ps.w.org/stars-rating/assets/icon-256x256.png?rev=1593058)
 * [Stars Rating](https://wordpress.org/plugins/stars-rating/)
 * [Support Threads](https://wordpress.org/support/plugin/stars-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/stars-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stars-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stars-rating/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Phil](https://wordpress.org/support/users/philstudio/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/hook-for-replace-plugin-text/#post-12930930)
 * Status: resolved