• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.33
/src/integrations/breadcrumbs-integration.php
1
<?php
2

3
namespace Yoast\WP\SEO\Integrations;
4

5
use WPSEO_Replace_Vars;
6
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
7
use Yoast\WP\SEO\Presenters\Breadcrumbs_Presenter;
8
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
9

10
/**
11
 * Adds customizations to the front end for breadcrumbs.
12
 */
13
class Breadcrumbs_Integration implements Integration_Interface {
14

15
        /**
16
         * The breadcrumbs presenter.
17
         *
18
         * @var Breadcrumbs_Presenter
19
         */
20
        private $presenter;
21

22
        /**
23
         * The meta tags context memoizer.
24
         *
25
         * @var Meta_Tags_Context_Memoizer
26
         */
27
        private $context_memoizer;
28

29
        /**
30
         * Breadcrumbs integration constructor.
31
         *
32
         * @param Helpers_Surface            $helpers          The helpers.
33
         * @param WPSEO_Replace_Vars         $replace_vars     The replace vars.
34
         * @param Meta_Tags_Context_Memoizer $context_memoizer The meta tags context memoizer.
35
         */
36
        public function __construct(
×
37
                Helpers_Surface $helpers,
38
                WPSEO_Replace_Vars $replace_vars,
39
                Meta_Tags_Context_Memoizer $context_memoizer
40
        ) {
41
                $this->context_memoizer        = $context_memoizer;
×
42
                $this->presenter               = new Breadcrumbs_Presenter();
×
43
                $this->presenter->helpers      = $helpers;
×
44
                $this->presenter->replace_vars = $replace_vars;
×
45
        }
46

47
        /**
48
         * Returns the conditionals based in which this loadable should be active.
49
         *
50
         * @return array The array of conditionals.
51
         */
52
        public static function get_conditionals() {
2✔
53
                return [];
2✔
54
        }
55

56
        /**
57
         * Registers the `wpseo_breadcrumb` shortcode.
58
         *
59
         * @codeCoverageIgnore
60
         */
61
        public function register_hooks() {
62
                \add_shortcode( 'wpseo_breadcrumb', [ $this, 'render' ] );
63
        }
64

65
        /**
66
         * Renders the breadcrumbs.
67
         *
68
         * @return string The rendered breadcrumbs.
69
         */
70
        public function render() {
2✔
71
                $context = $this->context_memoizer->for_current_page();
2✔
72

73
                /** This filter is documented in src/integrations/front-end-integration.php */
74
                $presentation = \apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
2✔
75

76
                $this->presenter->presentation = $presentation;
2✔
77

78
                return $this->presenter->present();
2✔
79
        }
80
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc