Server : LiteSpeed
System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64
User : gazetufm ( 1431)
PHP Version : 8.1.35
Disable Function : NONE
Directory :  /home2/gazetufm/pelasgus.al/wp-content/plugins/code-snippets/php/Utils/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: requests.php

Path: //home2/gazetufm/pelasgus.al/wp-content/plugins/code-snippets/php/Utils/requests.php

Size: 599 B

Permissions: 0644

<?php
/**
 * A collection of utilities for handling REST requests and responses.
 *
 * @package Code_Snippets
 */

namespace Code_Snippets\Utils;

use WP_Error;

/**
 * Unpack JSON data from a request response.
 *
 * @param array|WP_Error $response Response from wp_request_*.
 *
 * @return array<string, mixed>|null Associative array of JSON data on success, null on failure.
 */
function unpack_response_body( $response ): ?array {
	$body = wp_remote_retrieve_body( $response );

	if ( $body ) {
		$json = json_decode( $body, true );
		return is_array( $json ) ? $json : null;
	}

	return null;
}

← Back to Directory Edit File 🔒 Chmod

WP File Manager