Last active
June 17, 2019 15:45
-
-
Save plugin-republic/9d93d22abdda67a5330b8fd2ab303022 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 | |
/** | |
* Add a custom text input field to the product page | |
*/ | |
function plugin_republic_add_text_field() { ?> | |
<div class="pr-field-wrap"> | |
<label for="pr-field"><?php _e( 'Your name', 'plugin-republic' ); ?></label> | |
<input type="text" name='pr-field' id='pr-field' value=''> | |
</div> | |
<?php } | |
add_action( 'woocommerce_before_add_to_cart_button', 'plugin_republic_add_text_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment