var find_last_h3 = $('#your-profile').children('h3').length - 1;
Finds all the child H3 elements inside the form (which has the your-profile ID) and counts them.
$('#your-profile h3').eq( find_last_h3 ).addClass('marker').html('Password');
Adds a class to the last H3 and changes the text (About yourself isn’t appropriate when it’s only showing a password field – so i changed it simply for Password).
$('h3.marker + table tr:first-child').hide();
Finds that H3 by the class, looks for the table that follows and hides the first row.
Regarding the error, i know what that is, change this..
function contact_methods_filter( $contact_methods ) {
if( !current_user_can( 'manage_options' ) )
return '';
return $contact_methods;
}
..to..
function contact_methods_filter( $contact_methods ) {
if( !current_user_can( 'manage_options' ) )
return array();
return $contact_methods;
}
There’s an expectation in user-edit to receive an array, i hadn’t noticed as i initially tested under 3.0, where this error doesn’t appear, verified under 2.9 though, and now fixed with the above change.. ??
The user profile page does not use any IDs throughout the various tables or headings, else the jQuery could have been a little more specific, the chosen method should be fine even if plugins are modifying that page via hooks (i don’t know for sure, but it was taken into consideration when writing the jQuery).