TinyMCE wpView: show an error when no items are found while parsing a audio/video/playlist shortcode. Props avryl, fixes #29114.
git-svn-id: https://develop.svn.wordpress.org/trunk@29546 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4c48ecf26d
commit
50ba21e179
@ -2715,7 +2715,16 @@ function wp_ajax_parse_media_shortcode() {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
if ( empty( $_POST['shortcode'] ) || ! current_user_can( 'edit_post', $post->ID ) ) {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
setup_postdata( $post );
|
||||
$shortcode = do_shortcode( wp_unslash( $_REQUEST['shortcode'] ) );
|
||||
|
||||
if ( empty( $shortcode ) ) {
|
||||
wp_send_json_error( array( 'statusText' => __( 'No items found.' ) ) );
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
@ -2724,7 +2733,7 @@ function wp_ajax_parse_media_shortcode() {
|
||||
printf( '<link rel="stylesheet" href="%s"/>', $style );
|
||||
}
|
||||
|
||||
echo do_shortcode( wp_unslash( $_REQUEST['shortcode'] ) );
|
||||
echo $shortcode;
|
||||
|
||||
if ( ! empty( $wp_scripts ) ) {
|
||||
$wp_scripts->done = array();
|
||||
|
Loading…
Reference in New Issue
Block a user