Account Page

Location: Masteriyo > Settings > Account Page

account-page-settings

Display Settings

account-page-display

  • Enable Order History: Enable this to display the order history in the Account Page.

account-page-order-history

  • Enable Order Invoice: Enable this to display the order invoice tab in the Order History tab from where the users can download the Invoice.

account-page-order-history-invoice-button

  • Enable Profile Page: Enable this to display a profile page tab in the Account page.

account-page-profile-page

  • Enable Instructor Apply Button: Enable this option to display an 'Apply for Instructor' button on the Profile Page tab.
  • Enable Edit Profile Button: Enable this option to display an Edit Profile button on the Profile Page tab in the Account Page.

account-page-profile-page-buttons

  • Enable Quiz Attempts [Pro]: Show the Quiz Attempts tab on the Account page.
  • Enable Certificate: Show the Certificates tab so students can download earned certificates. This row appears only when the free Certificate Builder add-on is active.
  • Enable Subscriptions [Pro]: Show the Subscriptions tab.
  • Enable Zoom Session [Pro]: Show the Zoom Sessions tab.
  • Enable Google Meet Session: Show the Google Meet sessions tab on the Account page. This row appears only when the free Google Meet add-on is active, and it stays disabled until you save your Google Meet API credentials.
  • Enable Session Information: Show the Session Information (calendar/session) tab on the Account page.

Layout

  • Account Page Layout: Pick one of two layouts to show or hide the theme header and footer on the Account page.

Add Custom Tab Programmatically

Masteriyo exposes a PHP registry API that lets addons and themes add custom links to the Account page sidebar. The API mirrors familiar WordPress patterns like add_menu_page() — register once, the core renders it.

Quick start

You can place this code in any of the following locations:

  • Theme's functions.php — suitable for site-specific customizations.
  • A custom plugin — recommended for reusable or distributable addons.
  • A code snippets plugin — handy for lightweight additions without a custom plugin.
use Masteriyo\Account\SidebarLinkRegistry;

add_action( 'wp_enqueue_scripts', function() {
    SidebarLinkRegistry::add( 'my-link', [
        'label' => 'My Dashboard',
        'url'   => '/my-dashboard/',
    ] );
} );

That's it. The link appears in the sidebar on every Account page.


SidebarLinkRegistry::add()

Register a new sidebar link.

SidebarLinkRegistry::add( string $id, array $args ): void

Parameters

ParameterTypeDescription
$idstringUnique slug. sanitize_key() is applied automatically.
$argsarrayLink definition — see fields below.

$args fields

FieldTypeDefaultRequiredDescription
labelstringDisplay text shown in the sidebar.
urlstringDestination. Internal: a path like /courses/. External: a full URL.
targetstring'_self''_self' for React Router navigation (no page reload). '_blank' to open in a new tab.
iconstring''Inline SVG markup or an image URL.
priorityint10Sort order — lower numbers appear higher.

URL format

For internal links (target: '_self'), pass a client-side path. A leading # is normalized away so hash routing resolves correctly.

'url' => '/courses/'       // ✅ recommended
'url' => '#/courses/'      // ✅ normalized to /courses/
'url' => 'https://...'     // ✅ pair with target => '_blank'

Priority ordering

Built-in Masteriyo sidebar items use priority 10.

// appears above built-in links
SidebarLinkRegistry::add( 'pinned', [
    'label'    => 'Pinned',
    'url'      => '/pinned/',
    'priority' => 5,
] );

// appears below built-in links
SidebarLinkRegistry::add( 'extras', [
    'label'    => 'Extras',
    'url'      => '/extras/',
    'priority' => 20,
] );

SidebarLinkRegistry::remove()

Deregister a previously added link by its ID.

SidebarLinkRegistry::remove( string $id ): void

Useful when a link should appear conditionally based on settings or user role.

add_action( 'wp_enqueue_scripts', function() {
    SidebarLinkRegistry::add( 'premium-reports', [
        'label' => 'Premium Reports',
        'url'   => '/reports/',
    ] );

    if ( ! current_user_can( 'manage_masteriyo_settings' ) ) {
        SidebarLinkRegistry::remove( 'premium-reports' );
    }
} );

Hook timing

Register links on or before wp_enqueue_scripts. The registry is read during script localization, which fires on that same hook.

// ✅ correct — fires before scripts are localized
add_action( 'wp_enqueue_scripts', function() {
    SidebarLinkRegistry::add( 'my-link', [ /* ... */ ] );
} );

// ❌ too late — scripts already localized
add_action( 'wp_footer', function() {
    SidebarLinkRegistry::add( 'my-link', [ /* ... */ ] );
} );

Icons

The icon field accepts either an inline SVG string or an image URL. The registry detects the format based on whether the value starts with <.

Inline SVG

Pass raw SVG markup. It is sanitized server-side via wp_kses() before reaching the browser.

Modern icon sets — Heroicons, Lucide, Phosphor — pass through without stripping because the allowlist includes stroke, stroke-width, stroke-linecap, stroke-linejoin, fill-rule, and clip-rule.

SVG icons automatically inherit the sidebar text color via fill: currentColor.

SidebarLinkRegistry::add( 'reports', [
    'label' => 'Reports',
    'url'   => '/reports/',
    'icon'  => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
         fill="none" stroke="currentColor" stroke-width="2"
         stroke-linecap="round" stroke-linejoin="round">
    <path d="M3 3h18v18H3z"/>
</svg>',
] );

Image URL

Pass a fully-qualified URL. The value is run through esc_url_raw().

SidebarLinkRegistry::add( 'docs', [
    'label'  => 'Documentation',
    'url'    => 'https://docs.example.com',
    'target' => '_blank',
    'icon'   => 'https://example.com/icon.png',
] );

Validation

Links missing label or url are silently dropped — no PHP notice, no broken entry in the UI.

// silently dropped — no 'url'
SidebarLinkRegistry::add( 'bad', [ 'label' => 'Broken' ] );

// silently dropped — no 'label'
SidebarLinkRegistry::add( 'also-bad', [ 'url' => '/somewhere/' ] );

For backward compatibility, the registry applies this filter before sorting and sanitizing. Links added through it continue to work.

add_filter( 'masteriyo_account_sidebar_common_links', function( array $links ) {
    $links['legacy-link'] = [
        'label'    => 'Legacy Link',
        'url'      => '/legacy/',
        'priority' => 15,
    ];
    return $links;
} );
Caution: Since the version that introduced SidebarLinkRegistry, the array passed to this filter is keyed by link ID, not numerically indexed. Callbacks that used array_push() or numeric keys should be updated to use associative keys. Prefer SidebarLinkRegistry::add() for new code; the filter is maintained for compatibility only.

Complete example

use Masteriyo\Account\SidebarLinkRegistry;

add_action( 'wp_enqueue_scripts', function() {

    // Internal SPA link with SVG icon
    SidebarLinkRegistry::add( 'my-addon-home', [
        'label'    => 'My Addon',
        'url'      => '/my-addon/',
        'icon'     => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
             fill="none" stroke="currentColor" stroke-width="2">
    <circle cx="12" cy="12" r="10"/>
    <path d="M12 8v4l3 3"/>
</svg>',
        'priority' => 8,
    ] );

    // External link that opens in a new tab
    SidebarLinkRegistry::add( 'my-addon-docs', [
        'label'  => 'Addon Docs',
        'url'    => 'https://docs.my-addon.com',
        'target' => '_blank',
        'icon'   => 'https://my-addon.com/favicon.png',
    ] );

    // Conditionally remove based on option
    if ( ! get_option( 'my_addon_show_sidebar_link' ) ) {
        SidebarLinkRegistry::remove( 'my-addon-home' );
    }

} );

Reference

ClassMasteriyo\Account\SidebarLinkRegistry
Fileincludes/Account/SidebarLinkRegistry.php
Filtermasteriyo_account_sidebar_common_links
Register onwp_enqueue_scripts or earlier
Since2.3.0
PHP target7.4+


Was this article helpful to you?
Give us Rating

Last edited on July 23, 2026.
Edit this page