• 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/capabilities/class-capability-manager-wp.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Capabilities
6
 */
7

8
/**
9
 * Default WordPress capability manager implementation.
10
 */
11
final class WPSEO_Capability_Manager_WP extends WPSEO_Abstract_Capability_Manager {
12

13
        /**
14
         * Adds the capabilities to the roles.
15
         *
16
         * @return void
17
         */
18
        public function add() {
×
19
                foreach ( $this->capabilities as $capability => $roles ) {
×
20
                        $filtered_roles = $this->filter_roles( $capability, $roles );
×
21

22
                        $wp_roles = $this->get_wp_roles( $filtered_roles );
×
23
                        foreach ( $wp_roles as $wp_role ) {
×
24
                                $wp_role->add_cap( $capability );
×
25
                        }
26
                }
27
        }
28

29
        /**
30
         * Unregisters the capabilities from the system.
31
         *
32
         * @return void
33
         */
34
        public function remove() {
×
35
                // Remove from any roles it has been added to.
36
                $roles = wp_roles()->get_names();
×
37
                $roles = array_keys( $roles );
×
38

39
                foreach ( $this->capabilities as $capability => $_roles ) {
×
40
                        $registered_roles = array_unique( array_merge( $roles, $this->capabilities[ $capability ] ) );
×
41

42
                        // Allow filtering of roles.
43
                        $filtered_roles = $this->filter_roles( $capability, $registered_roles );
×
44

45
                        $wp_roles = $this->get_wp_roles( $filtered_roles );
×
46
                        foreach ( $wp_roles as $wp_role ) {
×
47
                                $wp_role->remove_cap( $capability );
×
48
                        }
49
                }
50
        }
51
}
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