| 开发者 |
antwerpes
DocCheck agency |
|---|---|
| 更新时间 | 2026年7月3日 06:15 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
https://auth.doccheck.com)
Used to exchange the OAuth authorization code for an access token and to retrieve the authenticated user's profile data. This connection is only made when a visitor actively clicks the DocCheck login button. Please refer to the DocCheck Privacy Policy and DocCheck Terms of Service.
DocCheck CDN (https://dccdn.de)
The DocCheck login button is a web component whose script is served from DocCheck's CDN. It is loaded only on pages where the [docacc_login] shortcode or page-level protection is active — not on every page. Please refer to the DocCheck Privacy Policy.
No data is transmitted to any other third-party service.
Requirements
3.2.7) or use @latest to always load the most recent version.manage_options or edit_others_posts capabilities) are available for selection. Administrator and Editor roles cannot be assigned to DocCheck users.doccheck-access folder to the /wp-content/plugins/ directory.[docacc_login] to any page or post where you want the login button to appear.docacc_user_created — Fires after a new WordPress user is created via DocCheck login.
Parameters: $user_id (int), $user_data (array)docacc_user_logged_in — Fires when an existing user logs in via DocCheck.
Parameters: $user_id (int), $user_data (array)docacc_session_created — Fires when a user is authenticated in anonymous session mode.
Parameters: $user_data (array)docacc_map_role — Customize role assignment based on DocCheck user data.
Parameters: $current_role (string), $user_data (array), $user_id (int)
Note: roles with manage_options or edit_others_posts capabilities are silently rejected for security reasons.docacc_protected_template — Override the template used for protected pages.
Parameters: $template (string)docacc_is_authenticated — Override the authentication check result.
Parameters: $authenticated (bool)docacc_user_data — Modify the DocCheck user data array before it is used.
Parameters: $user_data (array)doccheck-protected.php in your active theme root. The plugin will load it automatically instead of the built-in fallback template.
This content is protected. Please log in with your DocCheck account to continue.
WordPress Filter
Use the docacc_protected_template filter in your theme's functions.php when you want to load a template from a custom location.
add_filter( 'docacc_protected_template', function( $template ) {
$custom_template = get_stylesheet_directory() . '/templates/doccheck/custom-protected.php';
if ( file_exists( $custom_template ) ) {
return $custom_template;
}
return $template;
} );
How the template is used: the plugin loads this template only for singular protected content when the visitor is not authenticated. Your template runs as a normal WordPress theme template, so you can use functions like get_header(), get_footer(), the_title(), and do_shortcode(). In most cases, you should render the login button with [docacc_login samepageredirect="1"] so the user returns to the same protected page after login.
User Metadata Stored
In WordPress User mode, the following meta fields are stored per user (subject to selected scopes):
docacc_unique_id — DocCheck unique identifier (always stored)docacc_profession — Profession namedocacc_country — Country ISO codedocacc_language — Interface languagefirst_name, last_name — Name fieldsdocacc_email — Email addressdocacc_discipline_name — Medical disciplinedocacc_activity_name — Activity typedocacc_area_code, docacc_street, docacc_city, docacc_state — Address fieldsdocacc_last_login — Timestamp of last DocCheck loginContact DocCheck to register your application and obtain a client ID and client secret.
Yes. The [docacc_login] shortcode accepts a size attribute (small, medium, large). You can also apply custom CSS to the dc-login-button element.
In WordPress User mode, a new account is created on the visitor's first DocCheck login. The DocCheck unique ID is stored as user meta (docacc_unique_id) and used to match subsequent logins to the same account.
Yes. Use the docacc_map_role filter:
add_filter( 'docacc_map_role', function( $role, $user_data, $user_id ) {
if ( isset( $user_data['profession'] ) && $user_data['profession'] === 'physician' ) {
return 'editor';
}
return $role;
}, 10, 3 );
Edit the page in the WordPress admin. A DocCheck Protection metabox appears in the sidebar — check Protect this page and save.
Yes. Enable Make all Pages Private under Settings > DocCheck Login.
options-general.php?page=doccheck-access.wp_list_pages() HTML returned by the [docacc_sitemap] shortcode before concatenating it into shortcode output.docacc prefix, including functions, classes, constants, options, hooks, transients, session keys, user meta keys, role slug, and shortcodes.[docacc_login], [docacc_hide_content], [docacc_logout], and [docacc_sitemap].class_exists() and function_exists() wrappers to avoid silent conflicts with other plugins or themes.docacc prefix consistently.manage_options or edit_others_posts).validate_settings() to reject high-privilege roles even if submitted directly.docacc_map_role filter result is now validated before set_role() is called, preventing privilege escalation via custom filter callbacks.allow_user_creation), defaulted to off, and defaulted new installs to Anonymous Session mode.<script> and <style> output with proper WordPress enqueue APIs.admin_enqueue_scripts + wp_add_inline_script() for settings tabs, scope/property matrix behavior, redirect URI copy button, and metabox role toggle.register_setting() arguments and adjusted client_secret sanitization to use a dedicated secret-safe callback instead of generic text-field sanitization.docacc_logout and sanitized rendered docacc_hide_content output with wp_kses_post().