A singleton plugin class (LH_User_Profiles_Plugin) that bootstraps on plugins_loaded, behind the lh_user_profiles_init_plugin filter. It has no admin screens, database tables, cron jobs, settings or MCP abilities. On init it registers the avatar shortcode and the block (from blocks/profiles/block.json); on rest_api_init it registers the editor search route.
The block renders through one static method, render_profiles( $user_ids, $fields ), called directly with the block’s userIds and fields attributes. The block’s editor script uses plain wp.* globals with no build step, and previews through ServerSideRender.
Data it reads
The plugin stores no content of its own. It reads core user fields (display_name, description, avatar) plus two user meta keys written by other LocalHero plugins: lh_users_secondary_email and lh_profile-phone (E.164). A site leaving LocalHero keeps that data in its own user tables, but existing pages depend on this plugin to render it, which is why the plugin is public.
The only option it writes is lh_user_profiles_version (per site, not autoloaded). When upgrading from a version before 1.1.0, the plugin deletes the site’s cached rewrite_rules once so WordPress regenerates them.
History
- Profile post type, removed in 1.1.0. 1.00 registered an unused public post type,
lh_user_profiles_pt, which claimed theprofilerewrite slug andprofilesarchive on every site and risked clashing with other profile routes. It is intended to return later, properly designed, for richer profiles of members who are also authors (lh-tasks #147603). - Listing shortcode, removed in 1.2.0. Replaced by the User Profiles block once all content on the network had been migrated (lh-tasks #147604).
Hooks
lh_user_profiles_init_plugin(filter, defaulttrue): return false to stop the plugin loading.lh_user_profiles_return_editor_capability(filter, defaultedit_others_posts): capability needed to use the editor search route.lh_user_profiles_format_phone(filter, args: formatted string, digits): change how mobile numbers are displayed.get_the_author_description(core filter): applied to each person’s bio, viaget_the_author_meta().
Roadmap
The avatar shortcode stays. The profile post type will be reintroduced as a separate piece of work (lh-tasks #147603).