Skip to content

[bplock_login_form] renders the plugin’s login form, with a Create an account link to the BuddyPress registration page when registration is enabled. Use it anywhere a shortcode runs, including inside the Custom Content editor on the Protection Rules tab.

[bplock_login_form]

The plugin looks for its front-end templates in your theme before falling back to the bundled copies. Copy any of these files from public/templates/ in the plugin into a bp-lock/ folder in your theme (or child theme) and edit your copy:

  • bplock-locked-content-template.php - the full locked page shown to logged-out visitors.
  • bplock-login-form.php - the login form. The form posts to wp-login.php and the plugin adds in-page AJAX login on top. Keep the bplock-form class on the <form>, the log, pwd and redirect_to field names and the .bplock-notice element, or the in-page AJAX login stops working. The template receives $bplock_redirect_to.

Search order:

  1. wp-content/themes/<child-theme>/bp-lock/<file>
  2. wp-content/themes/<theme>/bp-lock/<file>
  3. wp-content/plugins/bp-lock/public/templates/<file>

You can also change the located template path with the bplock_locate_template and bplock_locked_content_template filters (see Hooks and Filters).

All settings are stored in a single serialized option, bplock_general_settings, using the WordPress Options API. There are no custom database tables. Key sub-keys:

Key Meaning
bplock-complete-site on when Full Protection is enabled.
bplock-whitelist-urls Whitelist textarea (full mode).
locked-urls Protected URLs textarea (partial mode).
bp-components Array of protected BuddyPress component slugs.
lr-form Protection method: plugin_form, custom_form, or page_redirect.
custom_form_content Custom content for the custom_form method.
locked_content Restriction message for the plugin_form method.
logout_redirect_page Page ID for the page_redirect method.

A few legacy standalone options (bp-components, bplock-pages) are read for backward compatibility and migrated into bplock_general_settings on upgrade.