2020-08-05 16:10:39 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-08-05 16:10:39 +00:00
|
|
|
/**
|
2022-02-19 16:06:11 +00:00
|
|
|
* @copyright 2020 Ad Aures
|
2020-08-05 16:10:39 +00:00
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Config\Services;
|
|
|
|
|
2021-05-19 16:35:13 +00:00
|
|
|
if (! function_exists('render_breadcrumb')) {
|
2021-05-06 14:00:48 +00:00
|
|
|
/**
|
|
|
|
* Renders the breadcrumb navigation through the Breadcrumb service
|
|
|
|
*
|
2022-07-03 16:42:20 +00:00
|
|
|
* @param string|null $class to be added to the breadcrumb nav
|
2021-05-06 14:00:48 +00:00
|
|
|
* @return string html breadcrumb
|
|
|
|
*/
|
|
|
|
function render_breadcrumb(string $class = null): string
|
|
|
|
{
|
|
|
|
$breadcrumb = Services::breadcrumb();
|
|
|
|
return $breadcrumb->render($class);
|
|
|
|
}
|
2020-08-05 16:10:39 +00:00
|
|
|
}
|
|
|
|
|
2021-05-19 16:35:13 +00:00
|
|
|
if (! function_exists('replace_breadcrumb_params')) {
|
2021-05-14 17:59:35 +00:00
|
|
|
/**
|
|
|
|
* @param string[] $newParams
|
|
|
|
*/
|
|
|
|
function replace_breadcrumb_params(array $newParams): void
|
2021-05-06 14:00:48 +00:00
|
|
|
{
|
|
|
|
$breadcrumb = Services::breadcrumb();
|
2022-03-04 14:33:48 +00:00
|
|
|
$breadcrumb->replaceParams(esc($newParams));
|
2021-05-06 14:00:48 +00:00
|
|
|
}
|
2020-08-05 16:10:39 +00:00
|
|
|
}
|