Egenverk Docs Viewer · Documentation

Reference

v2.10.0WP 5.0+PHP 7.4+Updated

Filter: egenverk_dv_capability

Sets the capability needed to open Tools → Docs Viewer, read and search. The default is manage_options. If the filter returns anything other than a string, or an empty string, manage_options is used.

Put the filter in a small must-use plugin, for example wp-content/mu-plugins/docs-viewer-access.php:

<?php
add_filter( 'egenverk_dv_capability', function () {
	return 'edit_posts';
} );

Users with that capability see Tools → Docs Viewer, can read every scanned document, and get the links on the Plugins screen. They cannot scan or change the link setting; scanning, the multisite rescan and the link setting always require manage_options. If nothing has been scanned yet, the viewer asks them to have an administrator run a scan.

Viewer addresses

The viewer is at wp-admin/tools.php?page=egenverk-docs-viewer. You can use the parameters below in bookmarks and links:

ParameterWhat it does
dv_pluginWhich plugin or theme is shown: the plugin's folder name, theme: followed by the theme's folder name, or mu: followed by the must-use plugin's folder name
dv_fileThe file's path inside the folder, for example docs/guide.md
dv_modepreview (default) or raw
dv_searchA search query
dv_versionOpens a changelog at the section for that version

A #heading at the end of the address opens the document at that heading. The older address wp-admin/admin.php?page=egenverk-docs-viewer redirects here and keeps the parameters.

Events that rebuild the index

The index is rebuilt once, at the end of the request, when:

  • a plugin or theme is installed or updated
  • a plugin is activated, deactivated or deleted
  • a theme is deleted
  • Docs Viewer is activated

This also covers updates run from WP-Cron or WP-CLI. On multisite, where plugins are shared but each site has its own index, the other sites rebuild their index on their next admin visit by an administrator.

Stored options

See the table in Data and privacy.

Resources