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

Yoast / wordpress-seo / 99ff5821fbe8444b259463501ff00132570d3061

25 Mar 2025 09:23AM UTC coverage: 52.446% (+3.7%) from 48.71%
99ff5821fbe8444b259463501ff00132570d3061

Pull #21958

github

web-flow
Merge d493347a3 into facbdded4
Pull Request #21958: Improve function words list for Farsi

7990 of 14101 branches covered (56.66%)

Branch coverage included in aggregate %.

20 of 20 new or added lines in 1 file covered. (100.0%)

1567 existing lines in 41 files now uncovered.

29816 of 57984 relevant lines covered (51.42%)

41124.2 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|null
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 ( self::$custom_taxonomies !== null ) {
×
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