WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/24/2017 11:09:43 PM (21 months ago)
Author:
westonruter
Message:

Embeds: Improve consistency of update and refresh logic for oEmbed caching between oembed_cache and post meta.

  • Allow updating oEmbed cache during parse-embed requests for non-post editors (such as widgets).
  • Update any existing oembed_cache post when usecache and TTL has passed.
  • Do not overwrite a previously valid cache with {{unknown}}.

Props dlh.
See #34115.
Fixes #42310.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r41985 r42009  
    30283028    $wp_embed->return_false_on_fail = true;
    30293029
     3030    if ( 0 === $post_id ) {
     3031        /*
     3032         * Refresh oEmbeds cached outside of posts that are past their TTL.
     3033         * Posts are excluded because they have separate logic for refreshing
     3034         * their post meta caches. See WP_Embed::cache_oembed().
     3035         */
     3036        $wp_embed->usecache = false;
     3037    }
     3038
    30303039    if ( is_ssl() && 0 === strpos( $url, 'http://' ) ) {
    30313040        // Admin is ssl and the user pasted non-ssl URL.
Note: See TracChangeset for help on using the changeset viewer.