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

Yoast / wordpress-seo / bce64cd247c6a27acec1d76069b69b2f7d7be199

13 May 2024 11:43AM UTC coverage: 52.638% (-0.02%) from 52.654%
bce64cd247c6a27acec1d76069b69b2f7d7be199

push

github

web-flow
Merge pull request #21359 from Yoast/feature/v3-api-breadcrumbs

Convert the Breadcrumbs block to the Blocks V3 API

7403 of 13443 branches covered (55.07%)

Branch coverage included in aggregate %.

0 of 12 new or added lines in 3 files covered. (0.0%)

10 existing lines in 2 files now uncovered.

28308 of 54399 relevant lines covered (52.04%)

41291.94 hits per line

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

0.0
/src/integrations/blocks/abstract-dynamic-block-v3.php
1
<?php
2

3
namespace Yoast\WP\SEO\Integrations\Blocks;
4

5
use Yoast\WP\SEO\Integrations\Integration_Interface;
6

7
/**
8
 * Dynamic_Block class.
9
 */
10
abstract class Dynamic_Block_V3 implements Integration_Interface {
11

12
        /**
13
         * The name of the block.
14
         *
15
         * @var string
16
         */
17
        protected $block_name;
18

19
        /**
20
         * The editor script for the block.
21
         *
22
         * @var string
23
         */
24
        protected $script;
25

26
        /**
27
         * The base path for the block.
28
         *
29
         * @var string
30
         */
31
        protected $base_path;
32

33
        /**
34
         *  Returns the conditionals based on which this loadable should be active.
35
         *
36
         * @return array<string>
37
         */
NEW
38
        public static function get_conditionals() {
×
NEW
39
                return [];
×
40
        }
41

42
        /**
43
         * Initializes the integration.
44
         *
45
         * Integrations hooking on `init` need to have a priority of 11 or higher to
46
         * ensure that they run, as priority 10 is used by the loader to load the integrations.
47
         *
48
         * @return void
49
         */
NEW
50
        public function register_hooks() {
×
NEW
51
                \add_action( 'init', [ $this, 'register_block' ], 11 );
×
52
        }
53

54
        /**
55
         * Registers the block.
56
         *
57
         * @return void
58
         */
NEW
59
        public function register_block() {
×
NEW
60
                \register_block_type(
×
NEW
61
                        $this->base_path . $this->block_name . '/block.json',
×
62
                        [
NEW
63
                                'editor_script'   => $this->script,
×
NEW
64
                                'render_callback' => [ $this, 'present' ],
×
65
                        ]
66
                );
67
        }
68

69
        /**
70
         * Presents the block output. This is abstract because in the loop we need to be able to build the data for the
71
         * presenter in the last moment.
72
         *
73
         * @param array<string, bool|string|int|array> $attributes The block attributes.
74
         *
75
         * @return string The block output.
76
         */
77
        abstract public function present( $attributes );
78
}
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

© 2026 Coveralls, Inc