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

Yoast / wordpress-seo / 5066322038

pending completion
5066322038

push

github

GitHub
Merge pull request #20316 from Yoast/JRF/ghactions-run-more-selectively

2550 of 29012 relevant lines covered (8.79%)

0.32 hits per line

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

0.0
/src/integrations/abstract-exclude-post-type.php
1
<?php
2

3
namespace Yoast\WP\SEO\Integrations;
4

5
/**
6
 * Abstract class for excluding certain post types from being indexed.
7
 */
8
abstract class Abstract_Exclude_Post_Type implements Integration_Interface {
9

10
        /**
11
         * Initializes the integration.
12
         */
13
        public function register_hooks() {
14
                \add_filter( 'wpseo_indexable_excluded_post_types', [ $this, 'exclude_post_types' ] );
×
15
        }
16

17
        /**
18
         * Exclude the post type from the indexable table.
19
         *
20
         * @param array $excluded_post_types The excluded post types.
21
         *
22
         * @return array The excluded post types, including the specific post type.
23
         */
24
        public function exclude_post_types( $excluded_post_types ) {
25
                return \array_merge( $excluded_post_types, $this->get_post_type() );
×
26
        }
27

28
        /**
29
         * This integration is only active when the child class's conditionals are met.
30
         *
31
         * @return array|string[] The conditionals.
32
         */
33
        public static function get_conditionals() {
34
                return [];
×
35
        }
36

37
        /**
38
         * Returns the names of the post types to be excluded.
39
         * To be used in the wpseo_indexable_excluded_post_types filter.
40
         *
41
         * @return array The names of the post types.
42
         */
43
        abstract public function get_post_type();
44
}
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