Embeds: Cache oEmbeds in an oembed_cache custom post type instead of postmeta when there is no global $post.

Add processing of embeds to rich Text widget.

Props swissspidy, westonruter, ocean90, johnbillion.
See #40854, #39994, #40935.
Fixes #34115.


git-svn-id: https://develop.svn.wordpress.org/trunk@41651 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-09-30 01:14:34 +00:00
parent 743494b654
commit 6e74a9bf23
4 changed files with 230 additions and 76 deletions

View File

@@ -195,6 +195,21 @@ function create_initial_post_types() {
),
) );
register_post_type( 'oembed_cache', array(
'labels' => array(
'name' => __( 'oEmbed Responses' ),
'singular_name' => __( 'oEmbed Response' ),
),
'public' => false,
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => false,
'can_export' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'supports' => array(),
) );
register_post_status( 'publish', array(
'label' => _x( 'Published', 'post status' ),
'public' => true,
@@ -3003,7 +3018,7 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
* @type string $guid Global Unique ID for referencing the post. Default empty.
* @type array $post_category Array of category names, slugs, or IDs.
* Defaults to value of the 'default_category' option.
* @type array $tags_input Array of tag names, slugs, or IDs. Default empty.
* @type array $tags_input Array of tag names, slugs, or IDs. Default empty.
* @type array $tax_input Array of taxonomy terms keyed by their taxonomy name. Default empty.
* @type array $meta_input Array of post meta values keyed by their post meta key. Default empty.
* }