From f2aa089166149ccbc5a17280a579ccc610735a80 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 20 Mar 2015 00:18:00 +0000 Subject: [PATCH] Press This: small clean-up when generating the suggested content. Ensure all keys are always set in the array that is passed through the filter. See #31637. git-svn-id: https://develop.svn.wordpress.org/trunk@31836 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-press-this.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/includes/class-wp-press-this.php b/src/wp-admin/includes/class-wp-press-this.php index 39665dd021..fd06334ae7 100644 --- a/src/wp-admin/includes/class-wp-press-this.php +++ b/src/wp-admin/includes/class-wp-press-this.php @@ -1002,21 +1002,17 @@ class WP_Press_This { } } + $default_html = array( 'quote' => '', 'link' => '', 'embed' => '' ); + require_once( ABSPATH . WPINC . '/class-oembed.php' ); $oembed = _wp_oembed_get_object(); if ( ! empty( $data['u'] ) && $oembed->get_provider( $data['u'], array( 'discover' => false ) ) ) { - $default_html = array( - 'quote' => '', - 'link' => '', - 'embed' => '

[embed]' . $data['u'] . '[/embed]

', - ); + $default_html['embed'] = '

[embed]' . $data['u'] . '[/embed]

'; } else { - $default_html = array( - 'quote' => '
%1$s
', - 'link' => '

' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) . - ' %2$s

', - ); + $default_html['quote'] = '
%1$s
'; + $default_html['link'] = '

' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) . + ' %2$s

'; } /**