...

Admin Help Docs

The Admin Help Docs plugin has some useful hooks for developers to use to further enhance its functionality.

helpdocs_admin_bar_truncated_title_length

TYPE ⇢ Filter

This filter allows developers to control the maximum length of the Help Docs title when it is displayed in the WordPress admin bar. When content inclusion in the admin bar is enabled, titles are truncated to improve readability and prevent layout issues. The default length is 50 characters, but this value can be increased or decreased as needed.

Example Usage

PHP
/**  * Increase the truncated title length in the admin bar.  *  * @param int $length The default truncated length.  *  * @return int Modified truncated length.  */ add_filter( 'helpdocs_admin_bar_truncated_title_length', function( $length ) {     return 100; }, 10 );

helpdocs_admin_role

TYPE ⇢ Filter

This filter allows developers to control which WordPress role is treated as the “admin” role for Help Docs permissions. By default, it uses the administrator role, but you can override it to grant access to a custom role instead. This is useful in environments where a different role is used to manage site settings or when you want to restrict access to a subset of administrators.

Example Usage

PHP
/**  * Restrict Help Docs admin access to a custom role.  *  * @param string $role The default admin role.  *  * @return string Modified role.  */ add_filter( 'helpdocs_admin_role', function( $role ) {     return 'site_manager'; }, 10 );

helpdocs_allowed_html

TYPE ⇢ Filter

TThis filter lets developers extend the set of HTML tags and attributes permitted in the Help Docs content. While the plugin already allows elements like <video>, <iframe>, <script>, and <source> through wp_kses_allowed_html(), this hook provides a way to safely include additional semantic or interactive elements that WordPress would otherwise remove.

Example Usage

PHP
/**  * Allow additional media-related tags in Admin Help Docs content.  *  * @param array $tags The default allowed HTML tags and attributes.  *  * @return array Modified set including additional safe tags.  */ add_filter( 'helpdocs_allowed_html', function( $tags ) {     return array_merge( $tags, [          // Enable <audio> tag with common attributes         'audio' => [             'src'       => true,             'controls'  => true,             'autoplay'  => true,             'loop'      => true,             'muted'     => true,             'preload'   => true,         ],          // Enable <track> inside media for subtitles or captions         'track' => [             'src'        => true,             'kind'       => true,             'srclang'    => true,             'label'      => true,             'default'    => true,         ],      ] ); }, 10 ); 

helpdocs_color_defaults

TYPE ⇢ Filter

This filter allows developers to modify the default color configuration used throughout Admin Help Docs. Each entry defines a color key with a color value and a human-readable label. These defaults are used to build themes and control the base styling of the documentation interface. You can override existing defaults, adjust labels, or add entirely new color keys that can be leveraged in custom themes.

Example Usage

PHP
/**  * Modify default colors and add a new custom color option.  *  * @param array $defaults The default color definitions.  *  * @return array Modified color definitions.  */ add_filter( 'helpdocs_color_defaults', function( $defaults ) {     // Override an existing default color     if ( isset( $defaults[ 'doc_accent' ] ) ) {         $defaults[ 'doc_accent' ][ 'color' ] = '#FF5722';         $defaults[ 'doc_accent' ][ 'label' ] = __( 'Primary Accent Color', 'admin-help-docs' );     }      // Add a new custom color option     $defaults[ 'custom_border' ] = [         'color' => '#CCCCCC',         'label' => __( 'Custom Border Color', 'admin-help-docs' ),     ];      return $defaults; }, 10 );

helpdocs_color_themes

TYPE ⇢ Filter

This filter allows developers to modify, extend, or replace the available color themes used by Admin Help Docs. Each theme is defined as an associative array containing a label and a colors array, where each color key controls a specific UI element (e.g., document background, header, buttons, links). You can add new themes, override existing ones, or dynamically adjust colors based on context such as user roles or environment.

Example Usage

PHP
/**  * Add a custom dark theme and modify an existing theme.  *  * @param array $themes The default themes array.  *  * @return array Modified themes array.  */ add_filter( 'helpdocs_color_themes', function( $themes ) {     // Add a new custom theme     $themes[ 'dark_mode' ] = [         'label'  => __( 'Dark Mode', 'admin-help-docs' ),         'colors' => [             'doc_accent'      => '#BB86FC',             'doc_bg'          => '#121212',             'doc_title'       => '#FFFFFF',             'doc_font'        => '#E0E0E0',             'doc_link'        => '#03DAC6',             'header_bg'       => '#1F1F1F',             'header_font'     => '#FFFFFF',             'header_tab'      => '#BB86FC',             'header_tab_link' => '#E0E0E0',             'subheader_bg'    => '#1A1A1A',             'subheader_font'  => '#FFFFFF',             'button'          => '#BB86FC',             'button_font'     => '#000000',             'button_hover'    => '#9A67EA',         ],     ];      // Modify an existing theme     if ( isset( $themes[ 'corporate' ] ) ) {         $themes[ 'corporate' ][ 'colors' ][ 'doc_link' ] = '#FF5722';     }      return $themes; }, 10 );

helpdocs_dashboard_no_docs_text

TYPE ⇢ Filter

This filter allows developers to customize the fallback message displayed on the WordPress dashboard when replacing the entire dashboard is enabled and when no Help Docs are available for the current user or context. By default, it shows a simple message indicating that everything can be found in the menu, but you can modify this text to better fit your site’s tone, provide additional instructions, or dynamically adjust the message based on user roles or conditions.

Example Usage

PHP
/**  * Customize the "no docs available" dashboard message.  *  * @param string $text The default no-docs text.  *  * @return string Modified no-docs text.  */ add_filter( 'helpdocs_dashboard_no_docs_text', function( $text ) {     return 'No documentation is available right now. Please check back later or contact support.'; }, 10 );

helpdocs_post_type_supports

TYPE ⇢ Filter

This filter allows developers to customize which core WordPress features are supported by the Help Documents custom post type (CPT), such as the title, editor, author, excerpt, and revisions.

Example Usage

PHP
/**  * Add additional post type supports to Help Documents.  *  * @param array $supports The default supported features (e.g., title, editor, revisions).  *  * @return array Modified array including extra supported features.  */ add_filter( 'helpdocs_post_type_supports', function( $supports ) {     // Enable featured images     $supports[] = 'thumbnail';      // Enable comment support     $supports[] = 'comments';      return $supports; }, 10 );

helpdocs_post_type_taxonomies

TYPE ⇢ Filter

This filter lets developers attach taxonomies (built-in or custom) to the Help Documents CPT for better organization and filtering.

Example Usage

PHP
/**  * Register additional taxonomies for Help Documents.  *  * @param array $taxonomies The default taxonomies attached to the post type (usually empty).  *  * @return array Modified array of taxonomy slugs.  */ add_filter( 'helpdocs_post_type_taxonomies', function( $taxonomies ) {     // Attach the default 'category' taxonomy     $taxonomies[] = 'category';      // Optionally add a custom taxonomy if registered elsewhere     $taxonomies[] = 'helpdoc_tag';      return $taxonomies; }, 10 ); 

helpdocs_imports_supports

TYPE ⇢ Filter

This filter allows developers to customize which core WordPress features are supported by the “Imports” custom post type (CPT). By default, the “Imports” CPT supports features like title and excerpt. This filter allows developers to add or remove supports for other features like thumbnail, comments, etc., for better content management and flexibility.

Example Usage

PHP
/**  * Add additional post type supports to Imports CPT.  *  * @param array $supports The default supported features (e.g., title, excerpt).  *  * @return array Modified array including extra supported features.  */ add_filter( 'helpdocs_imports_supports', function( $supports ) {     // Enable featured images     $supports[] = 'thumbnail';      // Enable comments support     $supports[] = 'comments';      return $supports; }, 10 );

helpdocs_imports_taxonomies

TYPE ⇢ Filter

This filter allows developers to attach custom taxonomies (either built-in or custom) to the “Imports” custom post type (CPT). It gives the ability to organize and categorize imports more efficiently by using custom taxonomies such as category, post_tag, or any other registered taxonomy.

Example Usage

PHP
/**  * Register additional taxonomies for Imports CPT.  *  * @param array $taxonomies The default taxonomies attached to the post type (usually empty).  *  * @return array Modified array of taxonomy slugs.  */ add_filter( 'helpdocs_imports_taxonomies', function( $taxonomies ) {     // Attach the default 'category' taxonomy     $taxonomies[] = 'category';      // Optionally, add a custom taxonomy     $taxonomies[] = 'import_tag';      return $taxonomies; }, 10 );

helpdocs_import_cache_duration

TYPE ⇢ Filter

This filter allows developers to control how long imported Help Docs data is cached before being refreshed from the remote site. The value is expressed in seconds and is applied when storing the transient for remote import data. By default, the cache lasts 12 hours. You can adjust this to reduce remote requests, improve performance, or force more frequent updates depending on your use case.

Example Usage

PHP
/**  * Increase the cache duration for imported Help Docs data.  *  * @param int    $duration     The default cache duration in seconds.  * @param string $website_url  The remote website URL being queried.  *  * @return int Modified cache duration.  */ add_filter( 'helpdocs_import_cache_duration', function( $duration, $website_url ) {     return DAY_IN_SECONDS; }, 10, 2 );

helpdocs_support_form_fields

TYPE ⇢ Filter

This filter allows developers to modify the fields used in the Help Docs “Contact Support” form. You can add new fields, remove existing ones, change labels, adjust validation, or dynamically alter field behavior based on the current user. The filter receives both the default field configuration and the current user object, making it possible to personalize or conditionally adjust the form.

Example Usage

PHP
/**  * Add a custom field to the support form and modify an existing field.  *  * @param array      $fields The default form fields.  * @param WP_User    $user   The current user object.  *  * @return array Modified form fields.  */ add_filter( 'helpdocs_support_form_fields', function( $fields, $user ) {     // Add a custom field     $fields[] = [         'name'     => 'order_id',         'type'     => 'text',         'label'    => __( 'Order ID', 'admin-help-docs' ),         'desc'     => __( 'If your issue is related to an order, enter the ID here.', 'admin-help-docs' ),         'sanitize' => 'sanitize_text_field',     ];      // Modify an existing field     foreach ( $fields as &$field ) {         if ( $field[ 'name' ] === 'subject' ) {             $field[ 'label' ] = __( 'Support Subject', 'admin-help-docs' );         }     }      return $fields; }, 10, 2 );

helpdocs_support_form_box_label

TYPE ⇢ Filter

Changes the heading text displayed above the support form. Default is “Complete the form below to send a message to support.”

Example Usage

PHP
/**  * Change the support form heading label.  *  * @param string $label Default label text.  *  * @return string Modified label text.  */ add_filter( 'helpdocs_support_form_box_label', function( $label ) {     return __( 'Contact Our Support Team', 'text-domain' ); } );

helpdocs_support_form_submit_label

TYPE ⇢ Filter

Changes the text displayed on the support form submit button. Default is “Send Support Request.”

Example Usage

PHP
/**  * Change the submit button label.  *  * @param string $label Default button text.  *  * @return string Modified button text.  */ add_filter( 'helpdocs_support_form_submit_label', function( $label ) {     return __( 'Submit Ticket', 'text-domain' ); } );

helpdocs_before_support_form

TYPE ⇢ Action

Runs before the support form is rendered. Allows injection of content or logic above the form.

Example Usage

PHP
/**  * Output content before the support form.  *  * @param array $contact_info Contact information array.  */ add_action( 'helpdocs_before_support_form', function( $contact_info ) {     echo '<p>Please include as much detail as possible.</p>'; } );

helpdocs_after_support_form

TYPE ⇢ Action

Runs after the support form is rendered. Allows injection of content or logic below the form.

Example Usage

PHP
/**  * Output content after the support form.  *  * @param array $contact_info Contact information array.  */ add_action( 'helpdocs_after_support_form', function( $contact_info ) {     echo '<p>We typically respond within 24 hours.</p>'; } );

helpdocs_support_contact_info

TYPE ⇢ Filter

This filter allows developers to modify the support contact information used on the Contact Support page. The contact name and phone are displayed in the top-right corner of the page, while the emails array is used as the recipient list for support form submissions. You can use this filter to dynamically adjust contact details based on conditions such as the current user, environment, or role.

Example Usage

PHP
/**  * Dynamically adjust support contact info based on the current user.  *  * @param array $contact_info The default contact information.  *  * @return array Modified contact information.  */ add_filter( 'helpdocs_support_contact_info', function( $contact_info ) {     $user = wp_get_current_user();      // Example: route support emails differently for administrators     if ( in_array( 'administrator', (array) $user->roles, true ) ) {         $contact_info[ 'emails' ] = [ '[email protected]' ];     }      return $contact_info; }, 10 );

helpdocs_support_details_box_content

TYPE ⇢ Filter

This filter allows developers to modify the entire HTML output of the support contact details box. It receives the rendered HTML string along with the full contact information array, allowing you to completely customize how the contact details are displayed, add additional markup, or replace the output entirely.

Example Usage

PHP
/**  * Customize the support contact details box output.  *  * @param string $content      The default HTML content of the details box.  * @param array  $contact_info The contact information array.  *  * @return string Modified HTML content.  */ add_filter( 'helpdocs_support_details_box_content', function( $content, $contact_info ) {     // Example: Append additional support instructions     $content .= '<div class="helpdocs-support-note">' . esc_html__( 'For urgent issues, contact us directly.', 'admin-help-docs' ) . '</div>';      return $content; }, 10, 2 );

helpdocs_support_max_attachment_size

TYPE ⇢ Filter

This filter allows developers to control the maximum total size (in megabytes) of all attachments uploaded through the Help Docs support form. The default limit is 10 MB. Adjusting this value lets you increase or decrease the allowed upload size based on server constraints, storage policies, or support requirements.

Example Usage

PHP
/**  * Increase the maximum allowed attachment size for support form uploads.  *  * @param int $size The default maximum size in MB.  *  * @return int Modified maximum size in MB.  */ add_filter( 'helpdocs_support_max_attachment_size', function( $size ) {     return 25; }, 10 );

helpdocs_support_email_args

TYPE ⇢ Filter

Allows full modification of the email arguments before the support email is sent. This includes recipients, subject, message body, headers, and attachments.

Example Usage

PHP
/**  * Modify the support email arguments before sending.  *  * @param array $email_args {  *     Email arguments.  *  *     @type array  $to          Recipient email addresses.  *     @type string $subject     Email subject.  *     @type string $message     Email body content.  *     @type array  $headers     Email headers.  *     @type array  $attachments File attachments.  * }  *  * @param array $data_to_send Sanitized form data.  *  * @return array Modified email arguments.  */ add_filter( 'helpdocs_support_email_args', function( $email_args, $data_to_send ) {      // Example: Add a BCC recipient     $email_args[ 'headers' ][] = 'Bcc: [email protected]';      return $email_args;  }, 10, 2 );

helpdocs_support_logging_enabled

TYPE ⇢ Filter

This filter allows developers to disable logging for the Help Docs support system. Logging is enabled by default, but you can use this filter to turn it off entirely if you do not want support requests or related activity to be recorded. This is useful for privacy requirements, performance optimization, or custom logging implementations.

Example Usage

PHP
/**  * Disable support logging.  *  * @param bool $enabled Whether logging is enabled by default.  *  * @return bool Modified logging state.  */ add_filter( 'helpdocs_support_logging_enabled', '__return_false' );

helpdocs_support_log_date_format

TYPE ⇢ Filter

This filter allows developers to control the date format used when displaying timestamps in the Help Docs support logs. The default format is M j, Y g:i a. You can customize this to match your preferred date and time format using standard PHP date formatting.

Example Usage

PHP
/**  * Change the date format used in support logs.  *  * @param string $format The default date format.  *  * @return string Modified date format.  */ add_filter( 'helpdocs_support_log_date_format', function( $format ) {     return 'Y-m-d H:i:s'; }, 10 );

helpdocs_support_log_quantity

TYPE ⇢ Filter

This filter allows developers to control how many support form submissions are retained in the log. The default value is 20 submissions. Adjusting this value lets you increase or decrease log retention based on storage limits, debugging needs, or data retention policies.

Example Usage

PHP
/**  * Disable support logging.  *  * @param bool $enabled Whether logging is enabled by default.  *  * @return bool Modified logging state.  */ add_filter( 'helpdocs_support_logging_enabled', '__return_false' );

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.