Support » Plugin: Gwolle Guestbook » Text change form and button

  • Hello,

    I wish I could modify the text of the button “send the message” and those of the input and the placeholder.

    I saw your answer from a year ago in another post where you indicated that you had to change the filters of the docs / filters files.

    But I’m not sure it stays in updates.

    Could you give me more information?

    Thank you and congratulations for this great plugin!

    • This topic was modified 2 years, 1 month ago by pissenlit.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marcel Pol

    (@mpol)

    The filters are very much backwards compatible. You can safely use them.

    The idea is that you don’t change the plugin, because those get overwritten when updating. You keep your own code in your theme or your own plugin, which you can update independently of the plugin.

    Inside the zipfile of the plugin is a /docs/filters/ directory with all the examples included.

    Thread Starter pissenlit

    (@pissenlit)

    Sorry but I did not understand … I do not speak English well …

    How to make the modifications made on docs / filters not be overwritten during the next updates?

    Plugin Author Marcel Pol

    (@mpol)

    Ah, you don’t change anything in /docs/filters/, those are just examples.

    Easiest is to add the example code to functions.php of your theme.
    Please do make sure you use a child theme, otherwise updates of the theme will overwrite it.

    Code can look like this:

    function my_gwolle_gb_write( $form_html ) {
                 // $form_html is a string
                 $old = 'Send the message';
                 $new = 'Send the message my special way';
                 $form_html = str_replace( $old, $new, $form_html );
                 return $form_html;
    }
    add_filter( 'gwolle_gb_write', 'my_gwolle_gb_write', 10, 1 );

    For one of the labels, in this case the author name, it can look like this:

    function my_gwolle_gb_author_name_label( $label ) {
                 // $label is a string
                 $label = 'test';
                 return $label;
    }
    add_filter( 'gwolle_gb_author_name_label', 'my_gwolle_gb_author_name_label', 10, 1 );
    Thread Starter pissenlit

    (@pissenlit)

    Ok I installed the child theme.

    I looked for the files to modify the text of the button of the form: “Send a message” and also I would like to modify the text of the input and the placeholder “Message of the guestbook”.

    I can not find the right file in filters and I do not know which part to change!

    Would not it be easier to edit the translation .mo file? but I can not find a translation into French.

    Thanks !

    Plugin Author Marcel Pol

    (@mpol)

    Hi,
    You don’t change anything. You add the code to the functions.php of your child theme.
    I don’t know how to explain it any better.

    For the message label, this code should do:

    function my_gwolle_gb_content_label( $label ) {
    	// $label is a string
    	$label = 'test';
    	return $label;
    }
    add_filter( 'gwolle_gb_content_label', 'my_gwolle_gb_content_label', 10, 1 );

    But really, if it is about translating, I see French is at 100%, so I don’t understand if it is not showing as fully translated for you, or if you are not satisfied with the text.

    Thread Starter pissenlit

    (@pissenlit)

    I understood that it was necessary to copy the code, but what I wish is to change the text.

    Instead of having “WRITE A MESSAGE” on the button, I would like to write “DEPOSIT YOUR COMMENT”.
    I also want to modify the text of the input.

    Must we change that somewhere?

    if I copy that code, the text will not change !!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Text change form and button’ is closed to new replies.