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

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/admin/menu/class-submenu-capability-normalize.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Menu
6
 */
7

8
/**
9
 * Normalize submenu capabilities to `wpseo_manage_options`.
10
 */
11
class WPSEO_Submenu_Capability_Normalize implements WPSEO_WordPress_Integration {
12

13
        /**
14
         * Registers all hooks to WordPress.
15
         *
16
         * @return void
17
         */
18
        public function register_hooks() {
×
19
                add_filter( 'wpseo_submenu_pages', [ $this, 'normalize_submenus_capability' ] );
×
20
        }
21

22
        /**
23
         * Normalizes any `manage_options` to `wpseo_manage_options`.
24
         *
25
         * This is needed as the module plugins are not updated with the new capabilities directly,
26
         * but they should not be shown as main menu items.
27
         *
28
         * @param array $submenu_pages List of subpages to convert.
29
         *
30
         * @return array Converted subpages.
31
         */
32
        public function normalize_submenus_capability( $submenu_pages ) {
×
33
                foreach ( $submenu_pages as $index => $submenu_page ) {
×
34
                        if ( $submenu_page[3] === 'manage_options' ) {
×
35
                                $submenu_pages[ $index ][3] = 'wpseo_manage_options';
×
36
                        }
37
                }
38

39
                return $submenu_pages;
×
40
        }
41
}
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