DocID®DocID® Documentation
Back to DocID®
  • Overview

    • DocID® Documentation
  • Introduction

    • Introduction
    • How DocID® works
    • Core concepts
  • Getting Started

    • Getting Started
    • Drupal module
    • WordPress plugin
    • Custom website
    • Go-live checklist
  • Features

    • Features
    • Standard Login
    • Access and personalization
    • Analytics
    • Campaigns
  • Licenses

    • Licenses
  • OAuth 2.0

    • OAuth 2.0
    • Configure a client
    • Authorization code flow
    • Scopes and UserInfo
    • Security and environments
  • API

    • API
  • Help

    • Troubleshooting

Getting Started

WordPress plugin

Connect WordPress to DocID®, protect content, and use verified professional attributes in native workflows.

The official DocID® plugin connects WordPress to one of the largest online networks of healthcare professionals. It protects posts, pages, custom post types, and media and can integrate verified professional identities with native WordPress users, roles, menus, and content.

Open the DocID® plugin on WordPress.org

Prerequisites

  • A WordPress website using HTTPS and administrator access
  • A DocID® account with a configured website asset and OAuth credentials
  • A backup and a staging environment for validating site-specific themes, plugins, and access rules

Install the plugin

Using WordPress administration

Open Plugins → Add New → Upload Plugin, select the current DocID® plugin archive, install it, and choose Activate Plugin.

Using WP-CLI

Install and activate a local plugin archive from the WordPress root:

wp plugin install /path/to/docid.zip --activate

Configure OAuth and requested customer data

  1. Open Settings → DocID® → OAuth credentials.
  2. Copy the displayed callback URL into the allowed redirect URIs of the corresponding website asset in the DocID® business dashboard.
  3. Enter the asset Client ID and Client Secret.
  4. Under Requested customer data, keep openid and professional enabled and activate only the optional profile, email, or phone data the website needs.

Available scopes

ScopeStatusClaims
openidRequiredsub
professionalRequiredprofession_id, discipline_id, profession_verified
profileOptionalname, title, given_name, family_name, gender
emailOptionalemail
phoneOptionalphone_number

Optional native WordPress accounts

Enable native provisioning only when WordPress roles, capabilities, or integrations require a native current user. New users receive a stable non-personal username and are linked only through the immutable DocID® subject, never automatically by email. Email synchronization is optional and automatically enables the optional email scope. The admin bar can be hidden separately for provisioned DocID® users without affecting other WordPress users. Existing local roles assigned outside DocID® remain unchanged.

Role mappings

Map all DocID® users or exact profession, discipline, institution, or subject identifiers to one or more non-administrative WordPress roles. Matching mappings are combined and can be added, edited, or removed from the role-mapping table.

Content protection

Use the DocID® login panel on supported edit screens to protect posts, pages, custom post types, or media. The Content protection tab provides a searchable, post-type-filtered, paginated overview with direct edit links.

Login destinations

Configure local profession- or discipline-based destinations. Lower priority numbers win when several mappings match. Content requested before authentication always takes precedence over a profile-based destination.

Available shortcodes

Add Account navigation to a WordPress menu or use the shortcodes below in content, widgets, and compatible page-builder fields.

Authentication and navigation

The login link is state-aware: it shows sign in to visitors and logout to authenticated DocID® users. Its login_text and logout_text attributes customize both labels. The username tag uses the best available value in this order: title, first name and last name; title and last name; authorized email address; stable DocID® user ID.

ShortcodeDescription
[docid-account-navigation]Shows Sign in to visitors. For authenticated DocID® users, it shows the best available username followed by | Log out.
[docid-loggedin-content]Content[/docid-loggedin-content]Shows the enclosed content only to authenticated DocID® users.
[docid-loggedout-content]Content[/docid-loggedout-content]Shows the enclosed content only to visitors without an authenticated DocID® session.
[docid-login-link]Shows Sign in to visitors and Log out to authenticated DocID® users.
[docid-login-link login_text="Access" logout_text="Leave"]Uses custom plain-text labels for both authentication states.
[docid-username]Shows the best available username: title, first name, and last name; then title and last name; then the authorized email address; and finally the stable DocID® user ID.

Profile data

ShortcodeScopeDescription
[docid-profile-id]openid (required)The stable, unique DocID® account identifier.
[docid-profile-name]profile (optional; authorization required)The combined title, given name, and family name.
[docid-profile-title]profile (optional; authorization required)The title or form of address.
[docid-profile-given-name]profile (optional; authorization required)The given name.
[docid-profile-family-name]profile (optional; authorization required)The family name.
[docid-profile-gender]profile (optional; authorization required)The gender value.
[docid-profile-email]email (optional; authorization required)The transferred email address when available.
[docid-profile-phone-number]phone (optional; authorization required)The transferred phone number when available.

Access authentication status and claims in PHP

The public base API can read the current DocID® session without requiring native WordPress provisioning. Optional values are present only when their scope was requested, authorized, and returned.

Read the current identity and transferred claims
$docid = new \DOCID\Includes\DOCID_Base();$is_docid_authenticated = $docid->docid_is_loggedin();$identity = $docid->docid_get_user(); $docid_subject = is_array($identity) ? ($identity['id'] ?? NULL) : NULL;$profession_id = is_array($identity) ? ($identity['profession_id'] ?? NULL) : NULL;$discipline_id = is_array($identity) ? ($identity['discipline_id'] ?? NULL) : NULL;$institution_id = is_array($identity) ? ($identity['institution_id'] ?? NULL) : NULL;$subject_id = is_array($identity) ? ($identity['subject_id'] ?? NULL) : NULL;$profession_verified = is_array($identity)  ? (bool) ($identity['profession_verified'] ?? FALSE)  : FALSE; // Optional values exist only when their scope was authorized.$name = is_array($identity) ? ($identity['name'] ?? NULL) : NULL;$email = is_array($identity) ? ($identity['email'] ?? NULL) : NULL;$phone = is_array($identity) ? ($identity['phone'] ?? NULL) : NULL;$wordpress_user_id = is_array($identity)  ? ($identity['wordpress_user_id'] ?? NULL)  : NULL;

Test before launch

  1. Open public and protected content while signed out.
  2. Complete sign-in with an eligible test account and verify the return to the originally requested content.
  3. Continue without optional profile data and confirm that authentication still works with the required scopes.
  4. Test every configured role mapping and login destination, including a non-matching account.
  5. Sign out and confirm that protected content is no longer accessible.

The integration supplies technical authentication and access-control features. Website operators remain responsible for choosing appropriate scopes, permissions, notices, and legal bases for their implementation.

PreviousDrupal moduleNextCustom website

On this page

  1. Prerequisites
  2. Install the plugin
  3. Using WordPress administration
  4. Using WP-CLI
  5. Configure OAuth and requested customer data
  6. Available scopes
  7. Optional native WordPress accounts
  8. Role mappings
  9. Content protection
  10. Login destinations
  11. Available shortcodes
  12. Authentication and navigation
  13. Profile data
  14. Access authentication status and claims in PHP
  15. Test before launch