Temporary Hook for Placeholders

NB! In case, if you make any plugin customization, especially directly in the plugin files, we do not provide any guarantee that added customization will work properly after plugin updates.
NB! Deprecated from plugin version 3.0.0

As temporary solution developers can use following hook for placeholders in a theme functions.php file:

add_filter( 'wcp_contact_form_get_fields_settings', 'tm6830_my_placeholders' );
    function tm6830_my_placeholders ($data) {
        foreach ($data as &$item) {
            switch ($item['name']) {
                case 'Field Name 1':
                    $item['atts']['placeholder'] = 'Custom placeholder value 1';
                    break;
                case 'Field Name 2':
                    $item['atts']['placeholder'] = 'Custom placeholder value 2';
                    break;
                //...
                default:
                    break;
            }
        }
        return $data;
    }

where

Value Description
“Field Name 1”, “Field Name 2”, etc. field “Name” values from the settings table in the admin panel
“Custom placeholder value 1”, “Custom placeholder value 2”, ect. custom placeholders values

Please, leave a feedback about the page. Was this article helpful?

0 0