Changeset 56878 for branches/5.4/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 10/12/2023 03:06:49 PM (16 months ago)
- Location:
- branches/5.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
- Property svn:mergeinfo changed
/trunk merged: 56833-56836,56838
- Property svn:mergeinfo changed
-
branches/5.4/src/wp-admin/includes/ajax-actions.php
r55785 r56878 3740 3740 $shortcode = wp_unslash( $_POST['shortcode'] ); 3741 3741 3742 // Only process previews for media related shortcodes: 3743 $found_shortcodes = get_shortcode_tags_in_content( $shortcode ); 3744 $media_shortcodes = array( 3745 'audio', 3746 'embed', 3747 'playlist', 3748 'video', 3749 'gallery', 3750 ); 3751 3752 $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes ); 3753 3754 if ( ! empty( $other_shortcodes ) ) { 3755 wp_send_json_error(); 3756 } 3757 3742 3758 if ( ! empty( $_POST['post_ID'] ) ) { 3743 3759 $post = get_post( (int) $_POST['post_ID'] ); … … 3746 3762 // The embed shortcode requires a post. 3747 3763 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3748 if ( 'embed' === $shortcode) {3764 if ( in_array( 'embed', $found_shortcodes, true ) ) { 3749 3765 wp_send_json_error(); 3750 3766 }
Note: See TracChangeset
for help on using the changeset viewer.