Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey larsgj —

    When the plugin was updated, any custom PHP would be removed. However, the good news is we’ve rolled this feature into the plugin automatically, now. In order to get the placeholders back, you’ll want to set up “Default Merge Values” for your list. Here’s how:

    https://kb.mailchimp.com/article/how-do-i-set-default-merge-values-like-dear-customer

    Once those are set, you’ll want to go back to the “MailChimp Setup” tab in WordPress and click “Update List.” After that, you should see your default values as placeholders, automatically.

    Cheers,
    Nate

    Thread Starter larsgj

    (@larsgj)

    Thanks! Works quite well except from that it is not an option for the EMAIL field tag so then it doesnt work at all without the labels. ;-(

    Any other tips?

    I am also experiencing the same thing. “Email Address” doesn’t show up as a placeholder anymore. Instead it shows up as a label. Is there a way to revert it back to a placeholder?

    Thanks

    Hey all,

    @larsgj, the placeholder code that you referenced in your original reply should still work if you add that back into your plugin’s code. That is, this code you referenced:

    placeholder="'.esc_html($var['name']).'"

    Since you’re running into the limitation of not being able to set a default merge value for the EMAIL field, I’d recommend re-using this code that you had in place before.

    To do this, go to your mailchimp_widget.php file, then locate this block of code:

    case 'text':
    			case 'number':
    			default:
    				$html .= '
    	<input type="text" size="18" placeholder="'.esc_html($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input"/>';

    Locate the placeholder portion of this code and change it from ‘default’ to ‘name’. So it should look like this:

    case 'text':
    			case 'number':
    			default:
    				$html .= '
    	<input type="text" size="18" placeholder="'.esc_html($var['name']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input"/>';

    Keep in mind that this will remove the default merge value feature that nate mentioned above. Instead, your field’s placeholder text will read whatever your field labels are named.

    You should end up with something like this https://screencast.com/t/2WmJt6YJ and you can choose to hide the field labels if you wish.

    Let me know if you have any questions!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Placeholders gone after update’ is closed to new replies.