Created
February 21, 2017 15:29
-
-
Save alesanabriav/fa2c624b532d4b46a77a6517a396e2d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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