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

Yoast / wordpress-seo / 8218b111533b92ec47f94130a94bcd0102263a45

01 Dec 2025 09:48AM UTC coverage: 53.092%. First build
8218b111533b92ec47f94130a94bcd0102263a45

push

github

web-flow
Merge pull request #22759 from Yoast/feature/task-list

Feature/task list

8697 of 16050 branches covered (54.19%)

Branch coverage included in aggregate %.

98 of 605 new or added lines in 51 files covered. (16.2%)

32413 of 61381 relevant lines covered (52.81%)

46976.02 hits per line

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

0.0
/src/helpers/route-helper.php
1
<?php
2

3
namespace Yoast\WP\SEO\Helpers;
4

5
/**
6
 * A helper object for route handling.
7
 */
8
class Route_Helper {
9

10
        /**
11
         * Gets the route from a name, rewrite and rest_base.
12
         *
13
         * @param string $name      The name.
14
         * @param array  $rewrite   The rewrite data.
15
         * @param string $rest_base The rest base.
16
         *
17
         * @return string The route.
18
         */
NEW
19
        public function get_route( $name, $rewrite, $rest_base ) {
×
NEW
20
                $route = $name;
×
NEW
21
                if ( isset( $rewrite['slug'] ) ) {
×
NEW
22
                        $route = $rewrite['slug'];
×
23
                }
NEW
24
                if ( ! empty( $rest_base ) ) {
×
NEW
25
                        $route = $rest_base;
×
26
                }
27
                // Always strip leading slashes.
NEW
28
                while ( \substr( $route, 0, 1 ) === '/' ) {
×
NEW
29
                        $route = \substr( $route, 1 );
×
30
                }
31

NEW
32
                return $route;
×
33
        }
34
}
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