Changeset 56884 for branches/5.8/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 10/12/2023 03:14:45 PM (14 months ago)
- Location:
- branches/5.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 56833-56838
- Property svn:mergeinfo changed
-
branches/5.8/src/wp-admin/includes/ajax-actions.php
r55777 r56884 3783 3783 $shortcode = wp_unslash( $_POST['shortcode'] ); 3784 3784 3785 // Only process previews for media related shortcodes: 3786 $found_shortcodes = get_shortcode_tags_in_content( $shortcode ); 3787 $media_shortcodes = array( 3788 'audio', 3789 'embed', 3790 'playlist', 3791 'video', 3792 'gallery', 3793 ); 3794 3795 $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes ); 3796 3797 if ( ! empty( $other_shortcodes ) ) { 3798 wp_send_json_error(); 3799 } 3800 3785 3801 if ( ! empty( $_POST['post_ID'] ) ) { 3786 3802 $post = get_post( (int) $_POST['post_ID'] ); … … 3789 3805 // The embed shortcode requires a post. 3790 3806 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3791 if ( 'embed' === $shortcode) {3807 if ( in_array( 'embed', $found_shortcodes, true ) ) { 3792 3808 wp_send_json_error(); 3793 3809 }
Note: See TracChangeset
for help on using the changeset viewer.