How to remove profile picture section from WordPress admin panel or the link “You can change your profile picture on Gravatar.”
add_action('admin_footer-profile.php', 'remove_profile_fields');
function remove_profile_fields()
{
if(current_user_can('custom_role'))
{ ?>
<script type="text/javascript">/* <![CDATA[ */
var hideFields = [ "aim", "yim", "jabber" ];
jQuery.each( jQuery( "form#your-profile tr" ), function() {
var field = jQuery( this ).find( "input,textarea,select" ).attr( "id" );
if ( hideFields.indexOf( field ) != -1 ) {
jQuery( this ).remove();
}
});
/* ]]> */</script>
<?php }
}
I’d tried above code but it is not working at all.