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

Yoast / wordpress-seo / 6638054992

25 Oct 2023 08:55AM UTC coverage: 49.106%. First build
6638054992

Pull #20653

github

vraja-pro
Merge remote-tracking branch 'origin/feature/upgrade-react-and-tests' into feature/upgrade-react-and-tests
Pull Request #20653: Feature/upgrade react and tests

64 of 157 new or added lines in 34 files covered. (40.76%)

13135 of 26748 relevant lines covered (49.11%)

3.96 hits per line

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

0.0
/src/integrations/admin/indexables-exclude-taxonomy-integration.php
1
<?php
2

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

5
use Yoast\WP\SEO\Conditionals\No_Conditionals;
6
use Yoast\WP\SEO\Helpers\Options_Helper;
7
use Yoast\WP\SEO\Integrations\Integration_Interface;
8

9
/**
10
 * Indexables_Exclude_Taxonomy_Integration class
11
 */
12
class Indexables_Exclude_Taxonomy_Integration implements Integration_Interface {
13

14
        use No_Conditionals;
15

16
        /**
17
         * The options helper.
18
         *
19
         * @var Options_Helper
20
         */
21
        private $options_helper;
22

23
        /**
24
         * Indexables_Exclude_Taxonomy_Integration constructor.
25
         *
26
         * @param Options_Helper $options_helper The options helper.
27
         */
28
        public function __construct( Options_Helper $options_helper ) {
29
                $this->options_helper = $options_helper;
×
30
        }
31

32
        /**
33
         * {@inheritDoc}
34
         */
35
        public function register_hooks() {
36
                \add_filter( 'wpseo_indexable_excluded_taxonomies', [ $this, 'exclude_taxonomies_for_indexation' ] );
×
37
        }
38

39
        /**
40
         * Exclude the taxonomy from the indexable table.
41
         *
42
         * @param array $excluded_taxonomies The excluded taxonomies.
43
         *
44
         * @return array The excluded taxonomies, including specific taxonomies.
45
         */
46
        public function exclude_taxonomies_for_indexation( $excluded_taxonomies ) {
NEW
47
                $taxonomies_to_exclude = \array_merge( $excluded_taxonomies, [ 'wp_pattern_category' ] );
×
48

49
                if ( $this->options_helper->get( 'disable-post_format', false ) ) {
×
NEW
50
                        return \array_merge( $taxonomies_to_exclude, [ 'post_format' ] );
×
51
                }
52

NEW
53
                return $taxonomies_to_exclude;
×
54
        }
55
}
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