WordPress.org

Make WordPress Core

Ticket #32246: class-oembed.php.patch

File class-oembed.php.patch, 3.2 KB (added by ramiy, 4 years ago)
  • wp-includes/class-oembed.php

     
    1111 */
    1212
    1313/**
    14  * oEmbed class.
     14 * WordPress oEmbed class.
    1515 *
    1616 * @package WordPress
    1717 * @subpackage oEmbed
     
    1818 * @since 2.9.0
    1919 */
    2020class WP_oEmbed {
     21
     22        /**
     23         * A list of oEmbed providers.
     24         *
     25         * @since 2.9.0
     26         * @access public
     27         * @var array
     28         */
    2129        public $providers = array();
     30
    2231        /**
     32         * A list of an early oEmbed providers.
     33         *
     34         * @since 4.0.0
     35         * @access public
    2336         * @static
    2437         * @var array
    2538         */
    2639        public static $early_providers = array();
    2740
     41        /**
     42         * A list of private/protected methods, used for backwards compatibility.
     43         *
     44         * @since 4.2.0
     45         * @access private
     46         * @var array
     47         */
    2848        private $compat_methods = array( '_fetch_with_format', '_parse_json', '_parse_xml', '_parse_body' );
    2949
    3050        /**
    31          * Constructor
     51         * Constructor.
    3252         *
    3353         * @since 2.9.0
     54         * @access public
    3455         */
    3556        public function __construct() {
    3657                $host = urlencode( home_url() );
     
    283304         * @see WP_oEmbed::fetch()
    284305         * @see WP_oEmbed::data2html()
    285306         *
     307         * @since 2.9.0
     308         * @access public
     309         *
    286310         * @param string $url The URL to the content that should be attempted to be embedded.
    287311         * @param array $args Optional arguments. Usually passed from a shortcode.
    288312         * @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
     
    308332        /**
    309333         * Attempts to discover link tags at the given URL for an oEmbed provider.
    310334         *
     335         * @since 2.9.0
     336         * @access public
     337         *
    311338         * @param string $url The URL that should be inspected for discovery `<link>` tags.
    312339         * @return false|string False on failure, otherwise the oEmbed provider URL.
    313340         */
     
    389416        /**
    390417         * Connects to a oEmbed provider and returns the result.
    391418         *
     419         * @since 2.9.0
     420         * @access public
     421         *
    392422         * @param string $provider The URL to the oEmbed provider.
    393423         * @param string $url The URL to the content that is desired to be embedded.
    394424         * @param array $args Optional arguments. Usually passed from a shortcode.
     
    426456         *
    427457         * @since 3.0.0
    428458         * @access private
     459         *
    429460         * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.)
    430461         * @param string $format Format to use
    431462         * @return false|object|WP_Error False on failure, otherwise the result in the form of an object.
     
    524555        /**
    525556         * Converts a data object from {@link WP_oEmbed::fetch()} and returns the HTML.
    526557         *
     558         * @since 2.9.0
     559         * @access public
     560         *
    527561         * @param object $data A data object result from an oEmbed provider.
    528562         * @param string $url The URL to the content that is desired to be embedded.
    529563         * @return false|string False on error, otherwise the HTML needed to embed.
     
    577611        /**
    578612         * Strip any new lines from the HTML.
    579613         *
     614         * @since 2.9.0
     615         * @since 3.0.0 Renamed from strip_scribd_newlines() to _strip_newlines()
    580616         * @access public
     617         *
    581618         * @param string $html Existing HTML.
    582619         * @param object $data Data object from WP_oEmbed::data2html()
    583620         * @param string $url The original URL passed to oEmbed.