Title: Placeholders
Last modified: August 30, 2016

---

# Placeholders

 *  Resolved [Tynermeister](https://wordpress.org/support/users/tynermeister/)
 * (@tynermeister)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/)
 * Thank you for the great plugin!
 * I’m using WPide to try and find the right place to add placeholder attributes
   to the inputs, but no matter what they never appear.
 * Can you help?
 * Thanks
 * [https://wordpress.org/plugins/wcp-contact-form/](https://wordpress.org/plugins/wcp-contact-form/)

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

 *  Plugin Author [WebCodin](https://wordpress.org/support/users/webcodin/)
 * (@webcodin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281310)
 * Hi Tynermeister,
 * We are sorry for delay with the answer.
 * We strongly recommend do not change plugin code directly in the plugin folder,
   because you can loose your changes after the plugin update to a new version.
 * Regarding to your question about the placeholders, currently plugin functionality
   do not allow to add placeholders to form fields. We will add this functionality
   for future updates.
 * But, we have added possibility to add placeholders via specific filter directly
   in function.php in your theme.
 * To use this filter you will need:
    1) Update plugin to the latest version (v2.1.1)
   2) Add to function.php in your theme following code:
 *     ```
       add_filter( 'wcp_contact_form_get_fields_settings', 'tm6830_my_placeholders' );
           function tm6830_my_placeholders ($data) {
               foreach ($data as &$item) {
                   switch ($item['name']) {
                       case 'My Field':
                           $item['atts']['placeholder'] = 'My Placeholder';
                           break;
                       case 'My Field 2':
                           $item['atts']['placeholder'] = 'My Placeholder 2';
                           break;
                       //...
                       default:
                           break;
                   }
               }
               return $data;
           }
       ```
   
 * Where,
    ‘My Field’, ‘My Field 2’,… – values of the “Name” field from the settings
   table for which we want to add placeholders; ‘My Placeholder’, ‘My Placeholder
   2’, … – corresponding placeholders values.
 * Please let us know, if this information help you.
 *  Plugin Author [WebCodin](https://wordpress.org/support/users/webcodin/)
 * (@webcodin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281427)
 * Hi Tynermeister,
 * We resolved this issue. If you have other questions you can reopen this thread.
 *  Thread Starter [Tynermeister](https://wordpress.org/support/users/tynermeister/)
 * (@tynermeister)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281430)
 * Thanks for everything WebCodin,
 * Should that have made it so it adds in placeholders automatically? Because the
   input boxes are still blank, unfortunately.
 * I’m terrible with PHP so I’m afraid I’m going to need to ask for your help one
   more time on what more I need to modify?
 *  Plugin Author [WebCodin](https://wordpress.org/support/users/webcodin/)
 * (@webcodin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281431)
 * Hi Tynermeister,
 * As mentioned in the previous post, current plugin functionality basically do 
   not support placeholders. We will add this in future releases.
 * As temporary solution for developers purposes we added some hook as described
   above that should be added in functions.php file of your theme.
    This code allows
   you to manually add placeholders for form fields that configured in admin panel.
 * **For example**, if you have a form with fields: **Name, Email, Message**, you
   will need to add following code in the functions.php:
 *     ```
       add_filter( 'wcp_contact_form_get_fields_settings', 'tm6830_my_placeholders' );
           function tm6830_my_placeholders ($data) {
               foreach ($data as &$item) {
                   switch ($item['name']) {
                       case 'Name':
                           $item['atts']['placeholder'] = 'Name Placeholder Text';
                           break;
                       case 'Email':
                           $item['atts']['placeholder'] = 'Email Placeholder Text';
                           break;
                       case 'Message':
                           $item['atts']['placeholder'] = 'Message Placeholder Text';
                           break;
                       default:
                           break;
                   }
               }
               return $data;
           }
       ```
   
 * Please let us know if this is help.
 *  Thread Starter [Tynermeister](https://wordpress.org/support/users/tynermeister/)
 * (@tynermeister)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281432)
 * Thank you so much, that make so much more sense to me now!
 * Everything is working perfectly!
 * Thank you again, and sorry for causing you hassle! 🙂
 *  Plugin Author [WebCodin](https://wordpress.org/support/users/webcodin/)
 * (@webcodin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281433)
 * Hi Tynermeister,
 * It is not a problem.
    Thank you for using our plugin!

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

The topic ‘Placeholders’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wcp-contact-form_63bcda.svg)
 * [WCP Contact Form](https://wordpress.org/plugins/wcp-contact-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wcp-contact-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wcp-contact-form/)
 * [Active Topics](https://wordpress.org/support/plugin/wcp-contact-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wcp-contact-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wcp-contact-form/reviews/)

## Tags

 * [contact](https://wordpress.org/support/topic-tag/contact/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [input](https://wordpress.org/support/topic-tag/input/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 6 replies
 * 2 participants
 * Last reply from: [WebCodin](https://wordpress.org/support/users/webcodin/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/placeholders-2/#post-6281433)
 * Status: resolved