| Server IP : 39.106.62.82 / Your IP : 216.73.217.128 Web Server : nginx/1.14.1 System : Linux iz2ze1m0zmp2dk5c3j5ap5z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /webdata/gohomesh.com/wp-content/plugins/members/inc/ |
Upload File : |
<?php
/**
* Role groups API. Offers a standardized method for creating role groups.
*
* @package Members
* @subpackage Admin
* @author Justin Tadlock <justintadlock@gmail.com>
* @copyright Copyright (c) 2009 - 2018, Justin Tadlock
* @link https://themehybrid.com/plugins/members
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
# Registers default groups.
add_action( 'init', 'members_register_role_groups', 95 );
add_action( 'members_register_role_groups', 'members_register_default_role_groups', 5 );
/**
* Fires the role group registration action hook.
*
* @since 1.0.0
* @access public
* @return void
*/
function members_register_role_groups() {
do_action( 'members_register_role_groups' );
}
/**
* Registers the default role groups.
*
* @since 2.0.0
* @access public
* @return void
*/
function members_register_default_role_groups() {
// Register the WordPress group.
members_register_role_group( 'wordpress',
array(
'label' => esc_html__( 'WordPress', 'members' ),
'label_count' => _n_noop( 'WordPress %s', 'WordPress %s', 'members' ),
'roles' => members_get_wordpress_roles(),
)
);
}
/**
* Returns the instance of the role group registry.
*
* @since 2.0.0
* @access public
* @return object
*/
function members_role_group_registry() {
return \Members\Registry::get_instance( 'role_group' );
}
/**
* Function for registering a role group.
*
* @since 1.0.0
* @access public
* @param string $name
* @param array $args
* @return void
*/
function members_register_role_group( $name, $args = array() ) {
members_role_group_registry()->register( $name, new \Members\Role_Group( $name, $args ) );
}
/**
* Unregisters a group.
*
* @since 1.0.0
* @access public
* @param string $name
* @return void
*/
function members_unregister_role_group( $name ) {
members_role_group_registry()->unregister( $name );
}
/**
* Checks if a group exists.
*
* @since 1.0.0
* @access public
* @param string $name
* @return bool
*/
function members_role_group_exists( $name ) {
return members_role_group_registry()->exists( $name );
}
/**
* Returns an array of registered group objects.
*
* @since 1.0.0
* @access public
* @return array
*/
function members_get_role_groups() {
return members_role_group_registry()->get_collection();
}
/**
* Returns a group object if it exists. Otherwise, `FALSE`.
*
* @since 1.0.0
* @access public
* @param string $name
* @return object|bool
*/
function members_get_role_group( $name ) {
return members_role_group_registry()->get( $name );
}