Skip to content

Customer portal and restricted content

Shortcodes

Shortcode What it does
[ogk_account] Renders the customer portal. A logged-out visitor sees a login link. Only one portal per page.
[ogk_restricted target_type="page" target="/members"]...[/ogk_restricted] Shows the enclosed content only when the signed-in user may have that target (target_type is download, product, feature or page; the default is page). Everyone else sees "A membership is required to see this.", which the ogk_restricted_message filter can change. A missing target always shows the message.

On a WooCommerce store the portal can also appear as My Account > Licences.

What customers see and do

Area Shown Setting
Memberships, subscriptions, credits Always, read only none
Licences Product, tier, status, expiry, sites used against the limit, short key hint. Never the key itself unless enabled below. Licences (on)
Sites The sites a licence is active on. Sites (on)
Downloads The newest published release of each product they hold a usable licence for. Signed link valid for 2 minutes. Downloads (on)
Pause a subscription Confirmation, then billing stops and the renewal date moves on. Pause (off)
Resume Always available to the customer. none
Cancel a subscription Confirmation, then final. Cancel (off)
Deactivate a site Frees the place; only the customer's own sites. Deactivate (off)
Show the licence key A Show licence key button with Copy and Hide. Needs OG_KEYSTONE_ENC_KEY and a recoverably stored key. Each showing is logged (licence id only) and limited to 10 a minute. Show key (off)

Set these in Settings > Customer portal. Anything that changes something or reveals a secret is off by default. A switched-off feature is not just hidden: its routes answer 403 portal_disabled. Changes apply to customers immediately. A customer can only ever change their own records.

Confirmed email

The portal identifies a customer by the signed-in user's account email. An email arriving through ordinary registration or a profile change is unconfirmed until the owner opens the emailed link (valid two days) or finishes a password reset. Until then /my routes answer 403 email_unverified, the portal asks the customer to confirm, and membership rules treat the user as having no email. Existing users, accounts an administrator creates, and an administrator editing a profile are unaffected.

Using membership rules in your own pages and code

if ( function_exists( 'ogk_user_can_access' ) && ogk_user_can_access( 'page', '/members' ) ) {
    // show members-only content
}

You can change the answer with the ogk_user_can_access filter. For a feature gate use the target type feature and your own key.

Theme safety and caching

The portal is a small separate build; every style is under .ogk-portal and nothing is set on html, body or :root. A theme that defines animations called pulse, enter or exit could clash. The page receives a fresh REST nonce per request, so never serve a cached copy of a portal page to logged-in users.

Not offered

Skipping a renewal, changing a card or plan, and invoices. Payments belong to your shop.