First-name gender lookup

Since 3.28.0 lh-profile-page provides one shared helper for suggesting a gender from a first name: LH_Profile_First_Name_Gender::suggest( $first_name ) (includes/class-lh-profile-first-name-gender.php). Every plugin that infers gender from a name, such as email ingestion enrichment, imports or bulk fills, should call it rather than run its own lookup, so the same rules apply everywhere. LH User Provisioning (1.5.0+) also uses it to tell which part of an email address is the first name. Guard calls with class_exists( 'LH_Profile_First_Name_Gender' ).

What it returns

'Male' or 'Female' when the name clearly reads as that gender, otherwise ''. It is deliberately conservative: getting no suggestion is always better than a wrong one. The checks run in this order:

What it never does

Customising

There are no admin settings. The lists are static methods with filterable defaults, so a site plugin can adjust them for its own members:

Performance

The detector parses its whole dictionary when it is created, which takes noticeable time and memory. The helper creates it only on first use and reuses it for the rest of the request, so batch callers should make all their lookups in one request rather than one per request. A name on the ambiguous or known list never loads the detector. If the library cannot be loaded, the helper logs an error and returns ''.