Developer Guide
BuddyPress Member Blog overviewFree + ProGet BuddyPress Member Blog →
WB Member Blog 4.3.0 is a plugin pair: WB Member Blog (Free) and WB Member Blog Pro. Free works on its own; BuddyPress, BuddyBoss and PeepSo are optional integrations.
One rule governs the pair: Free is the platform, and Pro is built on Free’s public hooks. Pro restricts who may post, adds member home tabs, changes what a post becomes on submit and adds REST routes through the same actions, filters, service accessors and base classes documented here. So anything Pro does, your code can do too. If you find you need to patch a Free class, that is a gap in the hook surface.
Pages in this guide
Section titled “Pages in this guide”| Page | What it covers |
|---|---|
| Extending the Plugin | The hooks developers use most, with working recipes: access, moderation, the member home, topics, uploads, Pro hooks, styling tokens, uninstall. |
| REST API Reference | Every Free and Pro route: method, path, permission, parameters and response. |
| Templates and Overrides | Which templates a theme can override, where to put the copy, and the archive takeovers. |
| Emails | The 17 emails, the shared email template, and how to switch off, reword or replace one by id. |
| Hook Reference | Every action and filter in Free and Pro, with parameters and the file that fires it. Generated from source. |
The hook reference is rebuilt from the docblocks in the code:
php bin/generate-hooks-reference.php # rebuild hooks-reference.mdphp bin/generate-hooks-reference.php --undocumented # list hooks still missing a docblockTo describe a hook, add a docblock above its do_action() or apply_filters() call and regenerate.
Do not edit the markdown by hand.
Code layout
Section titled “Code layout”The plugin runs two code layers side by side.
src/ (namespace Wbcom\MemberBlog)
Section titled “src/ (namespace Wbcom\MemberBlog)”Loaded by a dependency-free PSR-4 autoloader (src/Core/Autoloader.php). There is no Composer
vendor directory and no build step for PHP.
| Directory | Responsibility |
|---|---|
src/Core/ |
The autoloader, the module-gating contract (Module_Requirements, ServiceProvider, Registry) and Uninstaller, which holds the data-removal policy. |
src/Services/ |
The rules, with no request handling or markup: PostSubmissionService, DashboardService, ModerationService, PostQuery, FollowService, BookmarkService, ReactionService, FeaturedService, MediaService, ViewTracking, WriterProfile, DigestService, NotificationPrefs, EmailRegistry, EmailDispatcher, EmailTemplate and others. |
src/Rendering/ |
The markup. MemberHomeRenderer (the member home), PostCardRenderer (every post card), Composer, WriterProfileRenderer, TopicHubRenderer, the engagement button renderers, and Components, the shared component factory. Every method returns a string. |
src/Rest/ |
The REST controllers, RestGate (makes core’s /wp/v2/posts follow the plugin’s rules) and MetaFields. See REST API Reference. |
src/Frontend/ |
AuthorArchive and TermArchive (the writer profile and topic hub takeovers) and SingleEngagement. |
src/Admin/ |
FeaturedAdmin (the Featured column and row action) and ModerationAdmin (the Member submissions review screen). |
src/Blocks/ |
BlockRegistry builds each block from the shortcode it wraps, so a block and its shortcode cannot disagree. FreeBlocks registers them. |
src/Support/ |
Shared primitives: WriterUrl, EngagementStore, ViewCountStore, MetaLock. |
includes/, admin/, public/
Section titled “includes/, admin/, public/”The older procedural layer, still in use. includes/class-bp-member-blog-access-control.php is the
access gate the whole pair asks. includes/buddypress-member-blog-functions.php declares the public
functions and service accessors and boots the src/ services. includes/admin/ is the settings
screen. public/class-buddypress-member-blog-public.php owns the post form submission, the dashboard
shortcode and the two image upload routes.
The front end speaks REST only. Free registers three AJAX actions, all admin-only: the two page-create buttons and the plugin installer.
Service accessors
Section titled “Service accessors”Call these functions rather than constructing classes yourself.
| Accessor | Returns |
|---|---|
bpmb_access() |
The access gate: can_create(), can_edit(), can_publish(), can_delete(), can_manage_categories(). |
bpmb_submission() |
PostSubmissionService: resolve_status(), sanitize_content(), enforce_excluded_categories(). |
bpmb_dashboard() |
DashboardService: tabs(), get_posts(), edit_url(). |
bpmb_member_home() |
MemberHomeRenderer: the member home, post_list(), empty_state(). |
bpmb_post_query() |
PostQuery: paginate(), by_author(), related(), popular(), featured(), find_many(). |
bpmb_post_cards() |
PostCardRenderer: grid(), author_grid(). |
bpmb_components() |
Components: buttons, cards, badges, avatars, empty and error states, for markup that matches the plugin. |
bpmb_bookmarks(), bpmb_follows(), bpmb_reactions() |
The reading list, follow and clap services. |
bpmb_featured() |
FeaturedService: feature(), unfeature(), is_featured(), user_can_feature(). |
bpmb_media() |
MediaService: allowed_mime_types(), max_upload_bytes(). |
bpmb_views() |
ViewTracking: totals(), author_total(). |
bpmb_writer_url( $user_id ) |
The canonical link to a writer. Use this, not get_author_posts_url(). |
bpmb_writer_profile(), bpmb_writer_profile_renderer(), bpmb_topic_hub_renderer() |
The writer profile and topic hub. |
bpmb_notification_prefs() |
NotificationPrefs, each member’s email and notification choices. |
bpmb_series_progress() |
The series reading-progress store (written by Pro). |
bpmb_mail() |
The EmailDispatcher class name, for static calls. See Emails. |
bpmb_registry() |
The shared module Registry. |
bpmb_engagement_enabled( $what ) |
Whether claps, bookmarks, single or cards engagement is switched on. |
Three entry points reach the same rules: the post form, the REST API, and blocks. The services exist so all three ask one implementation. When you extend, call the service or filter the hook it fires; do not re-implement the rule.
Member posts are ordinary post objects. There is no custom post type.
Seven custom tables hold view counts, writer statistics, reading lists, follows, claps and series
progress. Read and write them only through bpmb_views(), bpmb_bookmarks(), bpmb_follows(),
bpmb_reactions() and bpmb_series_progress(), which handle caps, caching and invalidation.
Settings live in one option, bp_member_blog_gen_stngs. Read it with
bp_member_blog_get_settings( $key, $default ). Feature switches (the Features tab) are read with
BPMB_Features::enabled( $key ).
Flow tests
Section titled “Flow tests”Free ships functional flow tests that run inside a real WordPress and exercise the plugin the way a site owner would: submission, moderation, emails, the composer, pagination, listings, credits, engagement and permissions. With Pro active they cover Pro too.
# From the WordPress root (WP-CLI finds the install):wp eval-file wp-content/plugins/buddypress-member-blog/tests/run.php
# Only some flows, by file pattern:BPMB_FLOWS='08-*,14-*' wp eval-file wp-content/plugins/buddypress-member-blog/tests/run.phpThe run creates its own fixture users and posts and removes them at the end. It exits non-zero when
anything fails, so CI can gate on it. Run it against a development site, not production. See
tests/README.md for writing a new flow.

