Skip to content

Instantly share code, notes, and snippets.

@alesanabriav
Created February 21, 2017 15:29
Show Gist options
  • Save alesanabriav/fa2c624b532d4b46a77a6517a396e2d8 to your computer and use it in GitHub Desktop.
Save alesanabriav/fa2c624b532d4b46a77a6517a396e2d8 to your computer and use it in GitHub Desktop.
<?php
function bs_contact_form_sc($atts, $content = null) {
$attributes = [
'name-placeholder' => 'Name',
'email-placeholder' => 'Email'
];
$at = shortcode_atts( $attributes , $atts );
ob_start();
?>
<div
class="contact-form"
data-props='{
"placeholders": {
"name": "<?php echo $at['name-placeholder']; ?>",
"email": "<?php echo $at['email-placeholder']; ?>"
}
}'
>
</div>
<?php
return ob_get_clean();
}
add_shortcode( 'bs_contact_form', 'bs_contact_form_sc' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment