| Server IP : 43.130.17.34 / Your IP : 216.73.217.6 Web Server : nginx/1.28.0 System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64 User : www ( 1000) PHP Version : 8.0.26 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 : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/yespkg.com/wp-content/plugins/admin-columns-pro.5.1.3/classes/Export/Strategy/ |
Upload File : |
<?php
namespace ACP\Export\Strategy;
use AC;
use AC\ListTable;
use ACP\Export\Strategy;
use WP_User_Query;
/**
* Exportability class for users list screen
* @property AC\ListScreen\User $list_screen
*/
class User extends Strategy {
/**
* @param AC\ListScreen\User $list_screen
*/
public function __construct( AC\ListScreen\User $list_screen ) {
parent::__construct( $list_screen );
}
protected function get_list_table() {
return new ListTable\User();
}
/**
* @since 1.0
* @see ACP_Export_ExportableListScreen::ajax_export()
*/
protected function ajax_export() {
add_filter( 'users_list_table_query_args', [ $this, 'catch_users_query' ], PHP_INT_MAX - 100 );
}
/**
* Modify the users query to use the correct pagination arguments, and epxort the resulting
* items. This should be attached to the users_list_table_query_args hook when an AJAX request
* is sent
*
* @param $args
*
* @see filter:users_list_table_query_args
* @since 1.0
*/
public function catch_users_query( $args ) {
$per_page = $this->get_num_items_per_iteration();
$args['offset'] = $this->get_export_counter() * $per_page;
$args['number'] = $per_page;
$args['fields'] = 'ids';
// Construct users query
$query = new WP_User_Query( $args );
// Export
$this->export( $query->get_results() );
}
}