wp_remote_retrieve_body( array|WP_Error $response )
Retrieve only the body from the raw response.
Description #Description
Parameters #Parameters
- $response
-
(array|WP_Error) (Required) HTTP response.
Return #Return
(string) The body of the response. Empty string if no body or incorrect parameter given.
Source #Source
File: wp-includes/http.php
function wp_remote_retrieve_body( $response ) { if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) { return ''; } return $response['body']; }
Expand full source code Collapse full source code View on Trac
Changelog #Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
Related #Related
Uses #Uses
Uses | Description |
---|---|
wp-includes/load.php: is_wp_error() |
Check whether variable is a WordPress Error. |
Used By #Used By
Used By | Description |
---|---|
wp-admin/includes/class-wp-site-health.php: WP_Site_Health::get_test_rest_availability() |
Test if the REST API is accessible. |
wp-admin/includes/class-wp-site-health-auto-updates.php: WP_Site_Health_Auto_Updates::test_wp_version_check_attached() |
Check if updates are intercepted by a filter. |
wp-admin/includes/misc.php: wp_check_php_version() |
Checks if the user needs to update PHP. |
wp-admin/includes/file.php: wp_edit_theme_plugin_file() |
Attempt to edit a file for a theme or plugin. |
wp-admin/includes/class-wp-community-events.php: WP_Community_Events::get_events() |
Gets data about events near a particular location. |
wp-admin/includes/translation-install.php: translations_api() |
Retrieve translations from WordPress Translation API. |
wp-admin/includes/network.php: network_step2() |
Prints step 2 for Network installation process. |
wp-admin/includes/theme.php: themes_api() |
Retrieves theme installer pages from the WordPress.org Themes API. |
wp-admin/includes/update.php: get_core_checksums() |
Gets and caches the checksums for the given version of WordPress. |
wp-admin/includes/dashboard.php: wp_check_browser_version() |
Check if the user needs a browser update |
wp-admin/includes/plugin-install.php: plugins_api() |
Retrieves plugin installer pages from the WordPress.org Plugins API. |
wp-admin/includes/file.php: download_url() |
Downloads a URL to a local temporary file using the WordPress HTTP API. |
wp-admin/includes/import.php: wp_get_popular_importers() |
Returns a list from WordPress.org of popular importer plugins. |
wp-admin/includes/credits.php: wp_credits() |
Retrieve the contributor credits. |
wp-includes/functions.php: wp_remote_fopen() |
HTTP request for URI to retrieve content. |
wp-includes/deprecated.php: wp_get_http() |
Perform a HTTP HEAD or GET request. |
wp-includes/class-wp-simplepie-file.php: WP_SimplePie_File::__construct() |
Constructor. |
wp-includes/update.php: wp_version_check() |
Check WordPress version against the newest version. |
wp-includes/update.php: wp_update_plugins() |
Check plugin versions against the latest versions hosted on WordPress.org. |
wp-includes/update.php: wp_update_themes() |
Check theme versions against the latest versions hosted on WordPress.org. |
wp-includes/class-wp-oembed.php: WP_oEmbed::discover() |
Attempts to discover link tags at the given URL for an oEmbed provider. |
wp-includes/class-wp-oembed.php: WP_oEmbed::_fetch_with_format() |
Fetches result from an oEmbed provider for a specific format and complete provider URL |
wp-includes/class-wp-http-ixr-client.php: WP_HTTP_IXR_Client::query() | |
wp-includes/rss.php: _fetch_remote_file() |
Retrieve URL headers and content using WP HTTP Request API. |
wp-includes/class-wp-xmlrpc-server.php: wp_xmlrpc_server::pingback_ping() |
Retrieves a pingback and registers it. |
wp-includes/comment.php: discover_pingback_server_uri() |
Finds a pingback server URI based on the given URL. |
User Contributed Notes #User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example
Retrieving data from a JSON API: