In `class-oembed.php`, clarify/add some `return` docs.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32533


git-svn-id: http://core.svn.wordpress.org/trunk@32503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-05-21 21:31:27 +00:00
parent ed4aafa692
commit 3c24a2b32b
2 changed files with 16 additions and 6 deletions

View File

@ -195,7 +195,7 @@ class WP_oEmbed {
*
* @param string $url The URL to the content.
* @param string|array $args Optional provider arguments.
* @return bool|string False on failure, otherwise the oEmbed provider URL.
* @return false|string False on failure, otherwise the oEmbed provider URL.
*/
public function get_provider( $url, $args = '' ) {
@ -306,7 +306,7 @@ class WP_oEmbed {
* Attempts to discover link tags at the given URL for an oEmbed provider.
*
* @param string $url The URL that should be inspected for discovery `<link>` tags.
* @return bool|string False on failure, otherwise the oEmbed provider URL.
* @return false|string False on failure, otherwise the oEmbed provider URL.
*/
public function discover( $url ) {
$providers = array();
@ -384,7 +384,7 @@ class WP_oEmbed {
* @param string $provider The URL to the oEmbed provider.
* @param string $url The URL to the content that is desired to be embedded.
* @param array $args Optional arguments. Usually passed from a shortcode.
* @return bool|object False on failure, otherwise the result in the form of an object.
* @return false|object False on failure, otherwise the result in the form of an object.
*/
public function fetch( $provider, $url, $args = '' ) {
$args = wp_parse_args( $args, wp_embed_defaults( $url ) );
@ -420,7 +420,7 @@ class WP_oEmbed {
* @access private
* @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.)
* @param string $format Format to use
* @return bool|object False on failure, otherwise the result in the form of an object.
* @return false|object|WP_Error False on failure, otherwise the result in the form of an object.
*/
private function _fetch_with_format( $provider_url_with_args, $format ) {
$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );
@ -442,9 +442,13 @@ class WP_oEmbed {
*
* @since 3.0.0
* @access private
*
* @param string $response_body
* @return object|false
*/
private function _parse_json( $response_body ) {
return ( ( $data = json_decode( trim( $response_body ) ) ) && is_object( $data ) ) ? $data : false;
$data = json_decode( trim( $response_body ) );
return ( $data && is_object( $data ) ) ? $data : false;
}
/**
@ -452,6 +456,9 @@ class WP_oEmbed {
*
* @since 3.0.0
* @access private
*
* @param string $response_body
* @return object|false
*/
private function _parse_xml( $response_body ) {
if ( ! function_exists( 'libxml_disable_entity_loader' ) )
@ -473,6 +480,9 @@ class WP_oEmbed {
*
* @since 3.6.0
* @access private
*
* @param string $response_body
* @return object|false
*/
private function _parse_xml_body( $response_body ) {
if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument' ) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32532';
$wp_version = '4.3-alpha-32533';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.