Support » Plugin: Say what? » changing

  • Resolved llizard

    (@llizard)


    After much searching and lots of trial and error (not fatal) and asking in the general wp forums how to make a simple cosmetic to change to some arbitrary wording in the WP core, it was recommended that I install this Say What plugin.

    This is an example of trial-and-error coding I put into my theme’s functions.php Alas, while it didn’t throw any errors, it also failed to change the string.

    function e2019_change_text4( $change_text4 ) {
    	if ( $change_text4 == 'Your comment is awaiting moderation' )
    	{
    		$change_text4 = 'All comments are moderated. But as soon as your comment has been approved, it will be displayed universally.';
    	}
    	return $change_text4;
     }
    add_filter( 'gettext', 'e2019_change_text4', 20 );

    I must admit that my definition of “easy-to-use” is radically different from the definition of “easy-to-use” here. I have been unable to learn how to locate “text domain” or “text context” for the string “Your comment is awaiting moderation” that is located in wp-includes/comment-template.php.

    I have tried entering the text domain listed on my theme’s style sheet (child of twentytwelve); I have tried entering the text domain listed on the twenty twelve style sheet; I have tried entering the text domain “plugin-domain”. None of these work. The sticky post in the support forum was not particularly helpful.

    I have no idea at all what to put into the slot for the text context, other than “awaiting-moderation” and variations on the moderation theme.

    Please bear in mind that I only know enough about php coding to get myself in trouble. Having things spelled out is welcome. Also welcome is a link to a page that will explain in layman’s terms, how to locate the text domain and text context.

    Thank you.

    -E Morris, etherwork [dot] net [slash] blog << purposely unlinked in attempt to keep spammers at bay (there’s a really good reason that I have WordFence plugin that helped enormously to rid me of bruteforce attacks….)

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Lee Willis

    (@leewillis77)

    Hi;

    You can’t just guess the string to replace, you need to find the original string in the source code providing it (WordPress core in your example?).

    There’s examples of what you’re looking for here:
    https://plugins.leewillis.co.uk/doc_post/replacing-wordpress-strings-context/

    The easier, and perhaps more appropriate alternative here would be the Pro version which offers a simple way to search for strings to replace with auto-complete searching:

    https://plugins.leewillis.co.uk/downloads/say-what-pro/

    Thank you for your reply.

    I am not guessing at the string. I confess that after hours of searching for the answer (including looking hopefully at the page on your site, “replacing-wordpress-strings-context), and after plugging “twentytwelve” into the text domain in your plugin and having the string replacement fail, I got confused about where the string was located. The string is located in “/twentytwelve/functions.php”.

    At this point, I’m not sure that paying $40 (or more, depending on whether those are US or Cdn $) is the appropriate alternative in this case. It’s just one string replacement.

    My question remains: how does one learn what the “text domain” and “text context” are?

    Plugin Author Lee Willis

    (@leewillis77)

    You read the code that outputs the strings. That will tell you the exact string to use for the “original string”, “text domain” (if required) and content (if required).

    There’s plenty of examples of what the code looks like in the support documents.

    If you’re not able to interpret the code to work those out, then I’m afraid this plugin isn’t for you. The Pro version will help in that case.

    Thank you for your reply.

    re:

    You read the code that outputs the strings. That will tell you the exact string to use for the “original string”, “text domain” (if required) and content (if required).

    Why does “if required” for text domain and text content not appear prominently in the support documents? Are you saying that these fields can be left empty?

    I know the exact string. I have had no problem altering other strings; it is just this particular string that is giving grief.

    I have read the example codes in the documents. That is not the difficult part. Locating the “text domain” for this particular string is the problem. It does not appear in the coding; the textdomain listed on the parent theme style sheet does not change the string.

    But you are right. This plugin (free or Pro) is not for me. It is not cost-effective to pay such a large amount to alter one string. I have deleted it from my WP. Because I am not willing to pay for Pro, I will refrain from reviewing the plugin.

    Plugin Author Lee Willis

    (@leewillis77)

    Are you saying that these fields can be left empty?

    Yes.

    Are you saying that these fields can be left empty?

    Yes.

    Might I strongly suggest that you state that in the FAQ?

    Plugin Author Lee Willis

    (@leewillis77)

    Thanks for the feedback.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.