~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-includes/class-oembed.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        public static $early_providers = array();
39
39
 
40
40
        /**
41
 
         * A list of private/protected methods, used for backwards compatibility.
 
41
         * A list of private/protected methods, used for backward compatibility.
42
42
         *
43
43
         * @since 4.2.0
44
44
         * @access private
115
115
                self::$early_providers = array();
116
116
 
117
117
                /**
118
 
                 * Filter the list of whitelisted oEmbed providers.
 
118
                 * Filters the list of whitelisted oEmbed providers.
119
119
                 *
120
120
                 * Since WordPress 4.4, oEmbed discovery is enabled for all users and allows embedding of sanitized
121
121
                 * iframes. The providers in this list are whitelisted, meaning they are trusted and allowed to
192
192
        }
193
193
 
194
194
        /**
195
 
         * Exposes private/protected methods for backwards compatibility.
 
195
         * Exposes private/protected methods for backward compatibility.
196
196
         *
197
197
         * @since 4.0.0
198
198
         * @access public
221
221
         * @return false|string False on failure, otherwise the oEmbed provider URL.
222
222
         */
223
223
        public function get_provider( $url, $args = '' ) {
 
224
                $args = wp_parse_args( $args );
224
225
 
225
226
                $provider = false;
226
227
 
315
316
         * @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
316
317
         */
317
318
        public function get_html( $url, $args = '' ) {
 
319
                $args = wp_parse_args( $args );
 
320
 
318
321
                /**
319
322
                 * Filters the oEmbed result before any HTTP requests are made.
320
323
                 *
343
346
                }
344
347
 
345
348
                /**
346
 
                 * Filter the HTML returned by the oEmbed provider.
 
349
                 * Filters the HTML returned by the oEmbed provider.
347
350
                 *
348
351
                 * @since 2.9.0
349
352
                 *
370
373
                );
371
374
 
372
375
                /**
373
 
                 * Filter oEmbed remote get arguments.
 
376
                 * Filters oEmbed remote get arguments.
374
377
                 *
375
378
                 * @since 4.0.0
376
379
                 *
386
389
                if ( $html = wp_remote_retrieve_body( $request ) ) {
387
390
 
388
391
                        /**
389
 
                         * Filter the link types that contain oEmbed provider URLs.
 
392
                         * Filters the link types that contain oEmbed provider URLs.
390
393
                         *
391
394
                         * @since 2.9.0
392
395
                         *
457
460
                $provider = add_query_arg( 'url', urlencode($url), $provider );
458
461
 
459
462
                /**
460
 
                 * Filter the oEmbed URL to be fetched.
 
463
                 * Filters the oEmbed URL to be fetched.
461
464
                 *
462
465
                 * @since 2.9.0
463
466
                 *
620
623
                }
621
624
 
622
625
                /**
623
 
                 * Filter the returned oEmbed HTML.
 
626
                 * Filters the returned oEmbed HTML.
624
627
                 *
625
628
                 * Use this filter to add support for custom data types, or to filter the result.
626
629
                 *