'diagnostics/recovery-dashboard/', 'cloudflare' => 'cloudflare/configuration/', 'recipes' => 'reference/recipes/', 'tracking' => 'reference/client-api/', 'consent' => 'consent/cookie-banner/', 'diagnostics' => 'diagnostics/simulator/', 'license' => 'getting-started/quickstart/', ]; /** Docs page for each recipe. */ private const RECIPES = [ 'ga4' => 'recipes/ga4/', 'meta' => 'recipes/meta/', 'google_ads' => 'recipes/google-ads/', 'tiktok' => 'recipes/tiktok/', 'snapchat' => 'recipes/snapchat/', 'pinterest' => 'recipes/pinterest/', 'pinterest_capi' => 'recipes/pinterest/', 'bing' => 'recipes/bing/', 'linkedin' => 'recipes/linkedin/', 'instagram' => 'recipes/instagram-embeds/', 'reddit' => 'recipes/reddit/', 'x' => 'recipes/x/', ]; /** * @param string $path Path below the docs root, e.g. 'consent/cookie-banner/' * @return string */ public static function url(string $path = ''): string { return self::BASE . ltrim($path, '/'); } public static function forTab(string $tab): string { return self::url(self::TABS[$tab] ?? ''); } public static function forRecipe(string $recipeId): string { return self::url(self::RECIPES[$recipeId] ?? 'reference/recipes/'); } /** * A "Docs" link that opens in a new tab. * * @param string $url * @param string $label * @return string HTML */ public static function link(string $url, string $label = ''): string { $label = $label !== '' ? $label : __('Docs', 'zbridge'); return '' . esc_html($label) . ' '; } }