mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@31836 git-svn-id: http://core.svn.wordpress.org/trunk@31818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
42d7a802db
commit
1666eb5616
@ -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' => '<p>[embed]' . $data['u'] . '[/embed]</p>',
|
||||
);
|
||||
$default_html['embed'] = '<p>[embed]' . $data['u'] . '[/embed]</p>';
|
||||
} else {
|
||||
$default_html = array(
|
||||
'quote' => '<blockquote>%1$s</blockquote>',
|
||||
'link' => '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
|
||||
' <em><a href="%1$s">%2$s</a></em></p>',
|
||||
);
|
||||
$default_html['quote'] = '<blockquote>%1$s</blockquote>';
|
||||
$default_html['link'] = '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
|
||||
' <em><a href="%1$s">%2$s</a></em></p>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user