Ejemplo n.º 1
0
        return $hashes;
    }
    static function get_actions()
    {
        return self::$actions;
    }
    static function get_args()
    {
        return self::$args;
    }
    static function get_arg($arg)
    {
        return isset(self::$args[$arg]) ? self::$args[$arg] : null;
    }
}
WPR_API_Request::verify_request();
// disable logging for anythign done in API requests
if (class_exists('WPRP_Log')) {
    WPRP_Log::get_instance()->disable_logging();
}
// Disable error_reporting so they don't break the json request
if (!defined('WP_DEBUG') || !WP_DEBUG) {
    error_reporting(0);
}
// Temp hack so our requests to verify file size are signed.
global $wprp_noauth_nonce;
$wprp_noauth_nonce = wp_create_nonce('wprp_calculate_backup_size');
// Log in as admin
// TODO what about if admin use doesn't exists?
wp_set_current_user(1);
include_once ABSPATH . 'wp-admin/includes/admin.php';