| Server IP : 162.253.224.18 / Your IP : 216.73.217.81 Web Server : Apache System : Linux s18.infinitysrv.com 3.10.0-962.3.2.lve1.5.89.el7.x86_64 #1 SMP Thu Jul 9 15:55:31 UTC 2026 x86_64 User : dejavumk ( 1184) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dejavumk/perbec.com/wp-content/plugins/duplicator-pro/classes/utilities/ |
Upload File : |
<?php
defined("ABSPATH") or die("");
/**
* Wordpress utility functions
*
* Standard: PSR-2
* @link http://www.php-fig.org/psr/psr-2
*
* @package DUP_PRO
* @subpackage classes/utilities
* @copyright (c) 2017, Snapcreek LLC
* @license https://opensource.org/licenses/GPL-3.0 GNU Public License
* @since 3.8.9
*
*/
/**
* Wordpress utility functions
*/
class DUP_PRO_WP_U
{
public static function getAdminUserLists()
{
if (is_multisite()) {
$superAdmins = get_site_option('site_admins');
$users = get_users(array(
'fields' => array('id', 'user_login'),
'blog_id' => 0,
'login__in' => $superAdmins
));
} else {
$users = get_users(array(
'fields' => array('id', 'user_login'),
'role' => 'administrator'
));
}
return $users;
}
public static function getPostTypesCount()
{
$postTypes = get_post_types();
$postTypeCount = array();
foreach ($postTypes as $postName) {
$postObj = get_post_type_object($postName);
if (!$postObj->public) {
continue;
}
$postCountForTypes = (array) wp_count_posts($postName);
$postCount = 0;
foreach ($postCountForTypes as $num) {
$postCount += $num;
}
$postTypeCount[$postObj->label] = $postCount;
}
return $postTypeCount;
}
}