Submit
Path:
~
/
home
/
getwphos
/
public_html
/
kingpanel
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
helpers
/
File Content:
capability-helper.php
<?php namespace Yoast\WP\SEO\Helpers; /** * A helper object for user capabilities. */ class Capability_Helper { /** * Checks if the user has at least one of the proper capabilities. * * @param string $capability Capability to check. * * @return bool True if the user has at least one of the proper rights. */ public function current_user_can( $capability ) { if ( $capability === 'wpseo_manage_options' ) { return \current_user_can( $capability ); } return $this->has_any( [ 'wpseo_manage_options', $capability ] ); } /** * Retrieves the users that have the specified capability. * * @param string $capability The name of the capability. * * @return array The users that have the capability. */ public function get_applicable_users( $capability ) { $applicable_roles = $this->get_applicable_roles( $capability ); if ( $applicable_roles === [] ) { return []; } return \get_users( [ 'role__in' => $applicable_roles ] ); } /** * Retrieves the roles that have the specified capability. * * @param string $capability The name of the capability. * * @return array The names of the roles that have the capability. */ public function get_applicable_roles( $capability ) { $roles = \wp_roles(); $role_names = $roles->get_names(); $applicable_roles = []; foreach ( \array_keys( $role_names ) as $role_name ) { $role = $roles->get_role( $role_name ); if ( ! $role ) { continue; } // Add role if it has the capability. if ( \array_key_exists( $capability, $role->capabilities ) && $role->capabilities[ $capability ] === true ) { $applicable_roles[] = $role_name; } } return $applicable_roles; } /** * Checks if the current user has at least one of the supplied capabilities. * * @param array $capabilities Capabilities to check against. * * @return bool True if the user has at least one capability. */ private function has_any( array $capabilities ) { foreach ( $capabilities as $capability ) { if ( \current_user_can( $capability ) ) { return true; } } return false; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
open-graph
---
0755
schema
---
0755
twitter
---
0755
aioseo-helper.php
1266 bytes
0644
asset-helper.php
2572 bytes
0644
attachment-cleanup-helper.php
2294 bytes
0644
author-archive-helper.php
5375 bytes
0644
blocks-helper.php
2378 bytes
0644
capability-helper.php
2116 bytes
0644
crawl-cleanup-helper.php
8294 bytes
0644
curl-helper.php
655 bytes
0644
current-page-helper.php
16008 bytes
0644
date-helper.php
3208 bytes
0644
environment-helper.php
793 bytes
0644
first-time-configuration-notice-helper.php
5486 bytes
0644
home-url-helper.php
681 bytes
0644
image-helper.php
11972 bytes
0644
import-cursor-helper.php
1392 bytes
0644
import-helper.php
716 bytes
0644
indexable-helper.php
9459 bytes
0644
indexable-to-postmeta-helper.php
6913 bytes
0644
indexing-helper.php
12992 bytes
0644
language-helper.php
2716 bytes
0644
meta-helper.php
2982 bytes
0644
notification-helper.php
2057 bytes
0644
options-helper.php
4758 bytes
0644
pagination-helper.php
5815 bytes
0644
permalink-helper.php
1641 bytes
0644
post-helper.php
5553 bytes
0644
post-type-helper.php
7350 bytes
0644
primary-term-helper.php
1398 bytes
0644
product-helper.php
1103 bytes
0644
redirect-helper.php
1768 bytes
0644
require-file-helper.php
326 bytes
0644
robots-helper.php
1777 bytes
0644
robots-txt-helper.php
3433 bytes
0644
route-helper.php
694 bytes
0644
sanitization-helper.php
1056 bytes
0644
score-icon-helper.php
2846 bytes
0644
short-link-helper.php
3607 bytes
0644
site-helper.php
566 bytes
0644
social-profiles-helper.php
10991 bytes
0644
string-helper.php
1218 bytes
0644
taxonomy-helper.php
5100 bytes
0644
url-helper.php
8324 bytes
0644
user-helper.php
4026 bytes
0644
wincher-helper.php
2569 bytes
0644
woocommerce-helper.php
1302 bytes
0644
wordpress-helper.php
512 bytes
0644
wpdb-helper.php
937 bytes
0644
N4ST4R_ID | Naxtarrr