Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ipokkel/ed4a3b5ff74fa294739c3c3714dce83e to your computer and use it in GitHub Desktop.
Save ipokkel/ed4a3b5ff74fa294739c3c3714dce83e to your computer and use it in GitHub Desktop.
<?php
/**
* Hide the submit button on the member profile edit page.
*
* 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_profile_edit_page_remove_submit_button_js() {
global $pmpro_pages;
// Are we on the member profile edit page?
if ( empty( $pmpro_pages ) || ! isset( $pmpro_pages['member_profile_edit'] ) || ! is_page( $pmpro_pages['member_profile_edit'] ) ) {
return;
}
?>
<script>
jQuery(document).ready(function() {
jQuery('#member-profile-edit div.pmpro_submit').remove();
});
</script>
<?php
}
add_action( 'wp_footer', 'my_pmpro_profile_edit_page_remove_submit_button_js' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment