Title: Customizing Input Value Attribute
Last modified: August 24, 2016

---

# Customizing Input Value Attribute

 *  Resolved [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/)
 * Hi Marcel,
 * Firstly thank you for your great contribution. I just had a quick question…
 * I understand I can customize the form through the CSS etc, however, what if I
   wanted to change the value of the input type.
 * e.g. currently the form comes with the following default:
 * `<input type="button" value="» Write a new entry.">`
 * Can I change the value property through the admin or do I need to target this
   with JS?
 * Would appreciate your feedback on this, thanks again.
 * Leo
 * [https://wordpress.org/plugins/gwolle-gb/](https://wordpress.org/plugins/gwolle-gb/)

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

 *  Thread Starter [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159751)
 * Further to the above, is there a way to add a custom class?
 *  Plugin Author [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * (@mpol)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159781)
 * Hi, I would think JavaScript is the most appropriate way. A oneliner with jQuery
   should be enough.
 * Not sure why you want to add a class. You can already target “div#gwolle_gb_write_button
   input”. Why would you want that?
 *  Thread Starter [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159786)
 * Thanks Marcel.
 * The reason I wanted the ability to add a custom class is so I am not trying to
   override the specificity of the selector.
 * I already have a class labeled .button, which I wanted to use on the input element.
   I know I can do this obviously through JS once again, but wanted to know if it
   was possible without it.
 * Not a problem though, thanks for the clarification.
 * Leo
 *  Plugin Author [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * (@mpol)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159803)
 * You can always use a filter, like the next part shows. It’s not tested, but should
   work. It will replace the $old with the $new.
    You can place it in functions.
   php of your theme, or in your own plugin. Make sure you get the raquo symbol 
   right, it gets mangled here apparently.
 *     ```
       <?php
       function your_custom_function($form) {
           // $form is a string
           $old = 'value="» Write a new entry."';
           $new = 'value="Anything you fancy."';
           $form = str_replace( $old, $new, $form );
           return $form;
       }
       add_filter( 'gwolle_gb_write', 'your_custom_function');
       ?>
       ```
   
 * Or alternatively:
 *     ```
       <?php
       function your_custom_function($form) {
           // $form is a string
           $old = 'value="» Write a new entry."';
           $new = 'value="Anything you fancy." class="my_custom_class"';
           $form = str_replace( $old, $new, $form );
           return $form;
       }
       add_filter( 'gwolle_gb_write', 'your_custom_function');
       ?>
       ```
   
 *  Thread Starter [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159814)
 * I like that approach, thanks Marcel!
 *  Thread Starter [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159874)
 * Hi Marcel,
 * I tried implementing your script above but no changes took effect. I included
   this in the **functions.php** file.
 * Any thoughts?
 * Thanks,
 * Leo
 *  Plugin Author [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * (@mpol)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159877)
 * It works here.
    Make sure you get the string right, the raquo symbol needs to
   be a html entity, like & raquo; without the space. Best is, you view soucre in
   your browser, and cut and paste the string.
 *  Thread Starter [themechills](https://wordpress.org/support/users/themechills/)
 * (@themechills)
 * [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159899)
 * Just thought I would report back Marcel. Your last response worked like a charm,
   thanks again mate!

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

The topic ‘Customizing Input Value Attribute’ is closed to new replies.

 * ![](https://ps.w.org/gwolle-gb/assets/icon-256x256.png?rev=1114688)
 * [Gwolle Guestbook](https://wordpress.org/plugins/gwolle-gb/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gwolle-gb/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gwolle-gb/)
 * [Active Topics](https://wordpress.org/support/plugin/gwolle-gb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gwolle-gb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gwolle-gb/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [themechills](https://wordpress.org/support/users/themechills/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/customizing-input-value-attribute/#post-6159899)
 * Status: resolved