context_memoizer = $context_memoizer; $this->presenter = new Breadcrumbs_Presenter(); $this->presenter->helpers = $helpers; $this->presenter->replace_vars = $replace_vars; } /** * Returns the conditionals based in which this loadable should be active. * * @return array The array of conditionals. */ public static function get_conditionals() { return []; } /** * Registers the `wpseo_breadcrumb` shortcode. * * @codeCoverageIgnore */ public function register_hooks() { \add_shortcode( 'wpseo_breadcrumb', [ $this, 'render' ] ); } /** * Renders the breadcrumbs. * * @return string The rendered breadcrumbs. */ public function render() { $context = $this->context_memoizer->for_current_page(); /** This filter is documented in src/integrations/front-end-integration.php */ $presentation = \apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context ); $this->presenter->presentation = $presentation; return $this->presenter->present(); } }