Server IP : 104.21.14.48 / Your IP : 3.137.178.178 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/chroot/var/www/wp-content/plugins/ultimate-dashboard/modules/admin-bar/ajax/ |
Upload File : |
<?php /** * Get menu & submenu. * * This class is not used currently. * But leave it here because in the future, if requested, it would be used for * "hide menu item for specific user(s)" functionality (inside a dropdown). * * @package Ultimate_Dashboard */ namespace Udb\AdminBar\Ajax; defined( 'ABSPATH' ) || die( "Can't access directly" ); /** * Class to get menu & submenu. */ class Get_Users { /** * Get menu & submenu. */ public function ajax() { $nonce = isset( $_GET['nonce'] ) ? sanitize_text_field( $_GET['nonce'] ) : ''; if ( ! wp_verify_nonce( $nonce, 'udb_admin_bar_get_users' ) ) { wp_send_json_error( __( 'Invalid token', 'ultimate-dashboard' ) ); } $this->load_users(); } /** * Manually load menu & submenu. */ public function load_users() { $users = get_users(); $select2_data = array(); foreach ( $users as $user ) { array_push( $select2_data, array( 'id' => $user->ID, 'text' => $user->display_name, ) ); } wp_send_json_success( $select2_data ); } }