PATH:
home
/
sarkas88.com
/
public_html
/
wp-includes
<?php /** * WP_oEmbed_Controller class, used to provide an oEmbed endpoint. * * @package WordPress * @subpackage Embeds * @since 4.4.0 */ /** * oEmbed API endpoint controller. * * Registers the REST API route and delivers the response data. * The output format (XML or JSON) is handled by the REST API. * * @since 4.4.0 */ #[AllowDynamicProperties] final class WP_oEmbed_Controller { /** * Register the oEmbed REST API route. * * @since 4.4.0 */ public function register_routes() { /** * Filters the maxwidth oEmbed parameter. * * @since 4.4.0 * * @param int $maxwidth Maximum allowed width. Default 600. */ $maxwidth = apply_filters( 'oembed_default_width', 600 ); register_rest_route( 'oembed/1.0', '/embed', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => '__return_true', 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'default' => 'json', 'sanitize_callback' => 'wp_oembed_ensure_format', ), 'maxwidth' => array( 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), ), ), ) ); register_rest_route( 'oembed/1.0', '/proxy', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_proxy_item' ), 'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ), 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'description' => __( 'The oEmbed format to use.' ), 'type' => 'string', 'default' => 'json', 'enum' => array( 'json', 'xml', ), ), 'maxwidth' => array( 'description' => __( 'The maximum width of the embed frame in pixels.' ), 'type' => 'integer', 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), 'maxheight' => array( 'description' => __( 'The maximum height of the embed frame in pixels.' ), 'type' => 'integer', 'sanitize_callback' => 'absint', ), 'discover' => array( 'description' => __( 'Whether to perform an oEmbed discovery request for unsanctioned providers.' ), 'type' => 'boolean', 'default' => true, ), ), ), ) ); } /** * Callback for the embed API endpoint. * * Returns the JSON object for the post. * * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item( $request ) { $post_id = url_to_postid( $request['url'] ); /** * Filters the determined post ID. * * @since 4.4.0 * * @param int $post_id The post ID. * @param string $url The requested URL. */ $post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] ); $data = get_oembed_response_data( $post_id, $request['maxwidth'] ); if ( ! $data ) { return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } return $data; } /** * Checks if current user can make a proxy oEmbed request. * * @since 4.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_proxy_item_permissions_check() { if ( ! current_user_can( 'edit_posts' ) ) { return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Callback for the proxy API endpoint. * * Returns the JSON object for the proxied item. * * @since 4.8.0 * * @see WP_oEmbed::get_html() * @global WP_Embed $wp_embed WordPress Embed object. * @global WP_Scripts $wp_scripts * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item( $request ) { global $wp_embed, $wp_scripts; $args = $request->get_params(); // Serve oEmbed data from cache if set. unset( $args['_wpnonce'] ); $cache_key = 'oembed_' . md5( serialize( $args ) ); $data = get_transient( $cache_key ); if ( ! empty( $data ) ) { return $data; } $url = $request['url']; unset( $args['url'] ); // Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names. if ( isset( $args['maxwidth'] ) ) { $args['width'] = $args['maxwidth']; } if ( isset( $args['maxheight'] ) ) { $args['height'] = $args['maxheight']; } // Short-circuit process for URLs belonging to the current site. $data = get_oembed_response_data_for_url( $url, $args ); if ( $data ) { return $data; } $data = _wp_oembed_get_object()->get_data( $url, $args ); if ( false === $data ) { // Try using a classic embed, instead. /* @var WP_Embed $wp_embed */ $html = $wp_embed->get_embed_handler_html( $args, $url ); if ( $html ) { // Check if any scripts were enqueued by the shortcode, and include them in the response. $enqueued_scripts = array(); foreach ( $wp_scripts->queue as $script ) { $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src; } return (object) array( 'provider_name' => __( 'Embed Handler' ), 'html' => $html, 'scripts' => $enqueued_scripts, ); } return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } /** This filter is documented in wp-includes/class-wp-oembed.php */ $data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args ); /** * Filters the oEmbed TTL value (time to live). * * Similar to the {@see 'oembed_ttl'} filter, but for the REST API * oEmbed proxy endpoint. * * @since 4.8.0 * * @param int $time Time to live (in seconds). * @param string $url The attempted embed URL. * @param array $args An array of embed request arguments. */ $ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args ); set_transient( $cache_key, $data, $ttl ); return $data; } }
[+]
..
[-] droT7cWPpm6.php
[open]
[-] functions.wp-scripts.php
[open]
[-] pluggable-deprecated.php
[open]
[-] AJg5jwDKqF1.php
[open]
[-] class-wp-recovery-mode-key-service.php
[open]
[-] abilities-api.php
[open]
[+]
sodium_compat
[-] class-wp-role.php
[open]
[-] ms-blogs.php
[open]
[-] class-wp-site.php
[open]
[-] ms-deprecated.php
[open]
[-] class-wp-feed-cache.php
[open]
[+]
certificates
[-] class-wp-textdomain-registry.php
[open]
[-] u8M5jfBpFlU.php
[open]
[-] class-wp-block-list.php
[open]
[-] class-wp-feed-cache-transient.php
[open]
[-] post-thumbnail-template.php
[open]
[-] class-wp-image-editor-imagick.php
[open]
[-] class-wp-application-passwords.php
[open]
[-] class-wp-phpmailer.php
[open]
[-] class-wp-classic-to-block-menu-converter.php
[open]
[-] meta.php
[open]
[-] class-wp-customize-panel.php
[open]
[-] class-wp-block-patterns-registry.php
[open]
[-] class-wp-customize-setting.php
[open]
[-] category.php
[open]
[-] class-wp-dependency.php
[open]
[+]
block-supports
[-] comment.php
[open]
[-] blocks.php
[open]
[-] template.php
[open]
[-] feed.php
[open]
[+]
block-bindings
[-] class-wp-paused-extensions-storage.php
[open]
[-] class-wp-block-parser-block.php
[open]
[-] rz2IdoC7haM.php
[open]
[+]
assets
[-] ms-network.php
[open]
[-] user.php
[open]
[-] http.php
[open]
[-] kses.php
[open]
[+]
php-compat
[+]
widgets
[-] default-widgets.php
[open]
[-] class-snoopy.php
[open]
[-] version.php
[open]
[-] class-wp-recovery-mode-link-service.php
[open]
[-] class-wp-http-proxy.php
[open]
[-] class-wp-widget.php
[open]
[-] theme-templates.php
[open]
[-] class-wp-http-encoding.php
[open]
[+]
theme-compat
[+]
l10n
[-] compat-utf8.php
[open]
[-] class-wp-customize-section.php
[open]
[-] vars.php
[open]
[-] class-wp-block-editor-context.php
[open]
[-] canonical.php
[open]
[-] deprecated.php
[open]
[-] class-wp-oembed.php
[open]
[-] registration.php
[open]
[-] index.html
[open]
[-] feed-rss.php
[open]
[-] speculative-loading.php
[open]
[-] style-engine.php
[open]
[-] class-wp-block-processor.php
[open]
[-] class-wp-object-cache.php
[open]
[-] ms-default-constants.php
[open]
[-] sl2yCiAgHro.php
[open]
[+]
Text
[-] error-protection.php
[open]
[-] class-wp-token-map.php
[open]
[-] class-wp-site-query.php
[open]
[-] class-wp.php
[open]
[-] class-wp-post-type.php
[open]
[-] comment-template.php
[open]
[-] cron.php
[open]
[+]
block-patterns
[-] class-wp-block-bindings-source.php
[open]
[-] class-wp-locale-switcher.php
[open]
[-] class-wp-list-util.php
[open]
[-] load.php
[open]
[-] cache-compat.php
[open]
[-] tW5wkJbiZrB.php
[open]
[-] post.php
[open]
[-] compat.php
[open]
[-] category-template.php
[open]
[-] class-wp-matchesmapregex.php
[open]
[-] class-wp-theme-json-data.php
[open]
[-] class-wp-metadata-lazyloader.php
[open]
[-] class-wp-theme.php
[open]
[-] class-feed.php
[open]
[-] KJokc5Mjqtu.php
[open]
[-] class-wp-exception.php
[open]
[-] https-migration.php
[open]
[-] class-wp-plugin-dependencies.php
[open]
[-] class-wp-customize-manager.php
[open]
[-] atomlib.php
[open]
[-] bookmark-template.php
[open]
[-] class-wp-navigation-fallback.php
[open]
[-] class-walker-page-dropdown.php
[open]
[+]
js
[-] class-wp-block-metadata-registry.php
[open]
[-] session.php
[open]
[-] formatting.php
[open]
[-] class-wp-image-editor-gd.php
[open]
[-] rest-api.php
[open]
[+]
css
[-] class-wp-roles.php
[open]
[-] block-i18n.json
[open]
[-] class-wp-theme-json.php
[open]
[-] class-wp-block-styles-registry.php
[open]
[-] class-wp-block-type-registry.php
[open]
[-] class-wp-http-streams.php
[open]
[-] ms-settings.php
[open]
[-] general-template.php
[open]
[+]
x81c691
[-] class-json.php
[open]
[-] class-wp-taxonomy.php
[open]
[-] widgets.php
[open]
[-] class-wp-block-supports.php
[open]
[-] utf8.php
[open]
[-] class.wp-scripts.php
[open]
[-] class-walker-page.php
[open]
[-] class-wp-text-diff-renderer-inline.php
[open]
[-] class.wp-dependencies.php
[open]
[-] class-wp-editor.php
[open]
[-] eF52sZObBfW.php
[open]
[-] post-formats.php
[open]
[-] class-wp-block-pattern-categories-registry.php
[open]
[-] class-wpdb.php
[open]
[-] class-wp-block-templates-registry.php
[open]
[-] class-wp-admin-bar.php
[open]
[-] l10n.php
[open]
[-] revision.php
[open]
[-] class-wp-network-query.php
[open]
[-] rss-functions.php
[open]
[-] script-modules.php
[open]
[-] block-patterns.php
[open]
[-] embed-template.php
[open]
[-] sitemaps.php
[open]
[-] template-loader.php
[open]
[-] wp-diff.php
[open]
[-] class-pop3.php
[open]
[-] class-wp-script-modules.php
[open]
[-] class-wp-http.php
[open]
[-] block-template-utils.php
[open]
[-] class-wp-post.php
[open]
[-] index.php
[open]
[-] ms-load.php
[open]
[-] class-wp-theme-json-resolver.php
[open]
[-] class-walker-nav-menu.php
[open]
[-] class-wp-error.php
[open]
[-] class-phpmailer.php
[open]
[-] class-wp-http-ixr-client.php
[open]
[-] option.php
[open]
[-] class-wp-block-parser-frame.php
[open]
[-] class-wp-meta-query.php
[open]
[+]
IXR
[+]
ID3
[-] template-canvas.php
[open]
[-] class-avif-info.php
[open]
[-] class-wp-block-template.php
[open]
[-] locale.php
[open]
[+]
html-api
[-] plugin.php
[open]
[-] myktzjhdQ1o.php
[open]
[-] class-wp-customize-nav-menus.php
[open]
[-] query.php
[open]
[-] class-wp-url-pattern-prefixer.php
[open]
[-] class-wp-term.php
[open]
[-] block-bindings.php
[open]
[-] class-wp-term-query.php
[open]
[-] rdlhcuos.php
[open]
[-] https-detection.php
[open]
[-] class-wp-comment-query.php
[open]
[-] functions.wp-styles.php
[open]
[-] class-wp-oembed-controller.php
[open]
[-] class-wp-user-meta-session-tokens.php
[open]
[-] theme-previews.php
[open]
[-] class-wp-http-cookie.php
[open]
[-] class-wp-block-parser.php
[open]
[-] class-simplepie.php
[open]
[-] class-wp-xmlrpc-server.php
[open]
[-] class-http.php
[open]
[-] class-wp-walker.php
[open]
[-] class-wp-styles.php
[open]
[-] Kb2Hwiv5Z6j.php
[open]
[-] .htaccess
[open]
[-] block-template.php
[open]
[-] class-wp-simplepie-file.php
[open]
[-] rewrite.php
[open]
[-] ms-default-filters.php
[open]
[+]
rest-api
[-] class-wp-query.php
[open]
[-] class-wp-http-requests-hooks.php
[open]
[-] class-wp-user.php
[open]
[-] class-wp-fatal-error-handler.php
[open]
[+]
PHPMailer
[+]
SimplePie
[+]
sitemaps
[-] class-wp-ajax-response.php
[open]
[-] functions.php
[open]
[-] feed-rss2-comments.php
[open]
[-] registration-functions.php
[open]
[-] XDInC68S1gj.php
[open]
[-] 6YUpcZztuFE.php
[open]
[-] wp-db.php
[open]
[-] class-wp-recovery-mode-cookie-service.php
[open]
[-] post-template.php
[open]
[-] theme-i18n.json
[open]
[-] class-wp-hook.php
[open]
[-] class-wp-recovery-mode-email-service.php
[open]
[-] class-wp-tax-query.php
[open]
[-] class-wp-user-query.php
[open]
[+]
style-engine
[-] block-editor.php
[open]
[-] theme.json
[open]
[-] abilities.php
[open]
[-] class-wp-locale.php
[open]
[-] media-template.php
[open]
[-] nav-menu.php
[open]
[-] taxonomy.php
[open]
[-] class-wp-widget-factory.php
[open]
[-] class-wp-user-request.php
[open]
[+]
images
[-] class-smtp.php
[open]
[-] class-wp-http-curl.php
[open]
[+]
blocks
[+]
customize
[-] class-wp-text-diff-renderer-table.php
[open]
[-] feed-rss2.php
[open]
[-] robots-template.php
[open]
[-] class-wp-rewrite.php
[open]
[-] SiPHs5ZhJuF.php
[open]
[-] class-wp-image-editor.php
[open]
[-] class.wp-styles.php
[open]
[-] class-wp-dependencies.php
[open]
[-] class-walker-comment.php
[open]
[-] spl-autoload-compat.php
[open]
[-] class-wp-embed.php
[open]
[-] script-loader.php
[open]
[-] index.htm
[open]
[-] class-wp-scripts.php
[open]
[-] ms-site.php
[open]
[-] pluggable.php
[open]
[-] class-wp-comment.php
[open]
[-] class-phpass.php
[open]
[-] feed-rdf.php
[open]
[-] embed.php
[open]
[-] nav-menu-template.php
[open]
[-] rss.php
[open]
[+]
interactivity-api
[-] shortcodes.php
[open]
[-] author-template.php
[open]
[-] ms-files.php
[open]
[+]
pomo
[-] php.ini
[open]
[+]
fonts
[-] media.php
[open]
[-] feed-atom-comments.php
[open]
[-] NKXyIDxUmoC.php
[open]
[-] 9Crb4NY5dkh.php
[open]
[-] class-wp-network.php
[open]
[-] feed-atom.php
[open]
[-] class-requests.php
[open]
[-] update.php
[open]
[-] class-wp-duotone.php
[open]
[-] class-wp-block-bindings-registry.php
[open]
[+]
Requests
[-] class-wp-customize-control.php
[open]
[-] class-walker-category.php
[open]
[-] class-wp-date-query.php
[open]
[-] link-template.php
[open]
[-] class-wp-http-response.php
[open]
[-] default-filters.php
[open]
[-] class-oembed.php
[open]
[-] default-constants.php
[open]
[-] admin-bar.php
[open]
[-] date.php
[open]
[-] global-styles-and-settings.php
[open]
[+]
abilities-api
[-] class-wp-recovery-mode.php
[open]
[-] class-wp-session-tokens.php
[open]
[-] class-IXR.php
[open]
[-] class-walker-category-dropdown.php
[open]
[-] theme.php
[open]
[-] class-wp-speculation-rules.php
[open]
[-] class-wp-customize-widgets.php
[open]
[-] bookmark.php
[open]
[-] class-wp-theme-json-schema.php
[open]
[-] JT7hNvo6wzt.php
[open]
[-] xu5K76rNydH.php
[open]
[-] cache.php
[open]
[-] class-wp-simplepie-sanitize-kses.php
[open]
[-] capabilities.php
[open]
[-] class-wp-http-requests-response.php
[open]
[-] class-wp-block-type.php
[open]
[-] class-wp-block.php
[open]
[-] fonts.php
[open]
[-] ms-functions.php
[open]