Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/3d981e5ad9ccf1643ce2a2de577ee108 to your computer and use it in GitHub Desktop.
Save kimwhite/3d981e5ad9ccf1643ce2a2de577ee108 to your computer and use it in GitHub Desktop.
Adds a hint under the "Username" field at checkout.
<?php // do not copy this line.
/**
* This recipe Adds a placeholder hint inside the "Username" field at checkout.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_checkout_add_username_placeholder_hint() {
?>
<script>
jQuery(document).ready(function($) {
$("#username").attr("placeholder", "Choose wisely — this can't be changed later.");
});
</script>
<?php
}
add_action( 'pmpro_checkout_after_username', 'my_pmpro_checkout_add_username_placeholder_hint' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment