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

Yoast / wordpress-seo / dd6e866a9e6d253114633104d9e3858d807178ba

19 Jun 2024 10:03AM UTC coverage: 48.628% (-4.3%) from 52.936%
dd6e866a9e6d253114633104d9e3858d807178ba

push

github

web-flow
Merge pull request #21431 from Yoast/21429-update-copy-in-the-introduction-and-consent-modals

Updates the copy for the introduction and consent modals

7441 of 13454 branches covered (55.31%)

Branch coverage included in aggregate %.

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

3718 existing lines in 107 files now uncovered.

25100 of 53464 relevant lines covered (46.95%)

62392.47 hits per line

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

0.0
/inc/class-wpseo-custom-taxonomies.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO
6
 */
7

8
/**
9
 * WPSEO_Custom_Taxonomies.
10
 */
11
class WPSEO_Custom_Taxonomies {
12

13
        /**
14
         * Custom taxonomies cache.
15
         *
16
         * @var array
17
         */
18
        protected static $custom_taxonomies = null;
19

20
        /**
21
         * Gets the names of the custom taxonomies, prepends 'ct_' and 'ct_desc', and returns them in an array.
22
         *
23
         * @return array The custom taxonomy prefixed names.
24
         */
25
        public static function get_custom_taxonomies() {
×
26
                // Use cached value if available.
27
                if ( ! is_null( self::$custom_taxonomies ) ) {
×
28
                        return self::$custom_taxonomies;
×
29
                }
30

31
                self::$custom_taxonomies = [];
×
UNCOV
32
                $args                    = [
×
33
                        'public'   => true,
×
UNCOV
34
                        '_builtin' => false,
×
UNCOV
35
                ];
×
36
                $custom_taxonomies       = get_taxonomies( $args, 'names', 'and' );
×
37

38
                if ( is_array( $custom_taxonomies ) ) {
×
39
                        foreach ( $custom_taxonomies as $custom_taxonomy ) {
×
40
                                array_push(
×
41
                                        self::$custom_taxonomies,
×
42
                                        self::add_custom_taxonomies_prefix( $custom_taxonomy ),
×
43
                                        self::add_custom_taxonomies_description_prefix( $custom_taxonomy )
×
UNCOV
44
                                );
×
45
                        }
46
                }
47

48
                return self::$custom_taxonomies;
×
49
        }
50

51
        /**
52
         * Adds the ct_ prefix to a taxonomy.
53
         *
54
         * @param string $taxonomy The taxonomy to prefix.
55
         *
56
         * @return string The prefixed taxonomy.
57
         */
58
        private static function add_custom_taxonomies_prefix( $taxonomy ) {
×
59
                return 'ct_' . $taxonomy;
×
60
        }
61

62
        /**
63
         * Adds the ct_desc_ prefix to a taxonomy.
64
         *
65
         * @param string $taxonomy The taxonomy to prefix.
66
         *
67
         * @return string The prefixed taxonomy.
68
         */
69
        private static function add_custom_taxonomies_description_prefix( $taxonomy ) {
×
70
                return 'ct_desc_' . $taxonomy;
×
71
        }
72
}
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