Skip to content
Corex

DocsUrl

Corex\Config\Docs\DocsUrl · class · Config layer

Resolves a relative Corex docs path (e.g. /guides/media/) to an absolute URL for admin links. Add-on/registry docs paths are stored relative so they survive different docs hosts; this resolver is the one place that turns them into a full URL. Why this exists: a relative href="/guides/media/" in wp-admin resolves against the active WordPress site — i.e. the client/company domain being built — which is never where the Corex framework docs live. This resolver always returns an absolute URL so a docs link can never point at the client site. Resolution order: 1. The configured docs base (docs.base_url config key), overridable by the corex_docs_base_url filter — e.g. http://docs.corex.local on a WAMP docs vhost. 2. If no base is configured, the framework’s canonical docs source on GitHub, so the link is still absolute and useful out of the box.

Absolute URL for a relative docs path. An empty path yields an empty string (no link). An already-absolute URL (http/https) is returned unchanged.

Whether this site names its own docs host, rather than falling back to the framework’s. Both answers now produce a real documentation site, so this no longer distinguishes “a site” from “raw source” — it distinguishes whose site, which is what a team hosting their own needs to know.