Skip to content

Instantly share code, notes, and snippets.

@adapicom
Created February 7, 2012 00:00
Show Gist options
  • Save adapicom/1756025 to your computer and use it in GitHub Desktop.
Save adapicom/1756025 to your computer and use it in GitHub Desktop.
Add placeholder capabilities to Contact7 WP Plugin
//Add the following code into text.php and textarea.php just above the line that says
//if ( wpcf7_script_is() && $value && preg_grep( '%^watermark$%', $options ) ) {):
$ph_att = '';
if ( $value && preg_grep( '%^placeholder$%', $options ) ) {
$ph_att .= sprintf( ' %s', $value );
$value = '';
}
if ( $ph_att )
$atts .= sprintf( ' placeholder="%s"', trim( esc_attr( $ph_att ) ) );
@adapicom
Copy link
Author

adapicom commented Feb 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment