Server IP : 104.21.14.103 / Your IP : 3.139.93.208 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/thietke365.net/wp-content/plugins/woocommerce/src/Internal/Utilities/ |
Upload File : |
<?php namespace Automattic\WooCommerce\Internal\Utilities; /** * Helper functions for working with users. */ class Users { /** * Indicates if the user qualifies as site administrator. * * In the context of multisite networks, this means that they must have the `manage_sites` * capability. In all other cases, they must have the `manage_options` capability. * * @param int $user_id Optional, used to specify a specific user (otherwise we look at the current user). * * @return bool */ public static function is_site_administrator( int $user_id = 0 ): bool { $user = 0 === $user_id ? wp_get_current_user() : get_user_by( 'id', $user_id ); if ( false === $user ) { return false; } return is_multisite() ? $user->has_cap( 'manage_sites' ) : $user->has_cap( 'manage_options' ); } }