Extension:SocialProfile/Hooks/SpecialUpdateProfile::displayPreferencesForm
For more information about attaching hooks, see Manual:Hooks.
For examples of other extensions using this hook, see Category:SpecialUpdateProfile::displayPreferencesForm extensions.
The SpecialUpdateProfile::displayPreferencesForm hook is called in displayPreferencesForm in SpecialUpdateProfile.php, right before closing the <div> container containing the form checkboxes' HTML. Thus it can be used to add new checkboxes (etc.) to the form. The hook has access to the SpecialUpdateProfile object ($specialPage) as well as the form HTML string (&$form).
The "administrative" version of the Special:UpdateProfile page, Special:EditProfile, which admins and/or other privileged users can use to change other users' social profiles to e.g. remove offensive content or spam etc. does not run this hook, only the Special:UpdateProfile page runs this hook.
This hook was originally added in August 2011 to allow preserving for the UserMailingList extension functionality without including site-specific code in SocialProfile and allowing UserMailingList to cleanly interact with SocialProfile. As of July 2025 the UserMailingList has not been fixed up and publicly released; if you're interested in it, please let me know.