Developer Docs
Table of Contents
WP Help Scout Docs offers several filters and constants, which allow developers and agencies to change its behavior from a custom plugin or their theme’s functions.php. Sorted alphabetically.
wp_help_scout_docs_api_page_size
Filter for the number of items WP Help Scout Docs requests per page from the Help Scout Docs API while syncing (default and maximum: 100). Lower it if your server runs into timeouts or memory limits while syncing large collections.
add_filter( 'wp_help_scout_docs_api_page_size', function () {
return 50;
} );
Code language: JavaScript (javascript)
wp_help_scout_docs_category_page_compat
Return false to keep using your (classic) theme’s archive template for category pages, instead of the design of your Documentation page. See Customize your Documentation.
add_filter( 'wp_help_scout_docs_category_page_compat', '__return_false' );
Code language: JavaScript (javascript)
wp_help_scout_docs_search_page_compat
Return false to keep using your (classic) theme’s search template for searches within your docs, instead of the design of your Documentation page. See Customize your Documentation.
add_filter( 'wp_help_scout_docs_search_page_compat', '__return_false' );
Code language: JavaScript (javascript)
wp_help_scout_docs_setting_{option_name}
Filter to force the value of a single setting, e.g. to keep it the same on all your clients’ sites. The option names are api_key, base, collection_id, auto_toc, restrict_search, use_archive, debug, scheduled_rebuild and rebuild_schedule. Checkboxes are 'on' when enabled.
add_filter( 'wp_help_scout_docs_setting_auto_toc', function () {
return 'on';
} );
Code language: JavaScript (javascript)
wp_help_scout_docs_settings
Filter for all settings at once, after they’re loaded from the database. Useful to change several settings in one go.
wp_help_scout_docs_settings_defaults
Filter for the default values of all settings, which are used as long as a setting hasn’t been saved.
wp_help_scout_docs_toc_title
Filter for the title above the Table of Contents, when Auto TOC is enabled (default: <h2>Table of Contents</h2>).
add_filter( 'wp_help_scout_docs_toc_title', function () {
return '<h2>On this page</h2>';
} );
Code language: JavaScript (javascript)
Constants
Instead of using the settings screen, you can also configure WP Help Scout Docs by defining constants in your wp-config.php file. Constants always take precedence over the settings screen.
WP_HELP_SCOUT_DOCS_API_KEY: API KeyWP_HELP_SCOUT_DOCS_BASE: Base URIWP_HELP_SCOUT_DOCS_COLLECTION_ID: CollectionWP_HELP_SCOUT_DOCS_TOC: Auto TOCWP_HELP_SCOUT_DOCS_RESTRICT_SEARCH: Restrict Search to DocsWP_HELP_SCOUT_DOCS_ARCHIVE: Theme & Page Builder SupportWP_HELP_SCOUT_DOCS_SCHEDULED_REBUILD: Sync Docs by ScheduleWP_HELP_SCOUT_DOCS_REBUILD_SCHEDULE: Sync Schedule (daily,twice_weekly,weekly,twice_monthlyormonthly)WP_HELP_SCOUT_DOCS_DEBUG: Debug Mode
define( 'WP_HELP_SCOUT_DOCS_API_KEY', 'your-api-key' );
define( 'WP_HELP_SCOUT_DOCS_TOC', 'on' );
Code language: JavaScript (javascript)