Changeset 56846 for branches/6.3/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 01:27:29 PM (13 months ago)
- Location:
- branches/6.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.3
-
branches/6.3/src/wp-includes/media.php
r56429 r56846 2606 2606 } 2607 2607 } elseif ( ! empty( $atts['exclude'] ) ) { 2608 $post_parent_id = $id; 2608 2609 $attachments = get_children( 2609 2610 array( … … 2618 2619 ); 2619 2620 } else { 2621 $post_parent_id = $id; 2620 2622 $attachments = get_children( 2621 2623 array( … … 2628 2630 ) 2629 2631 ); 2632 } 2633 2634 if ( ! empty( $post_parent_id ) ) { 2635 $post_parent = get_post( $post_parent_id ); 2636 2637 // terminate the shortcode execution if user cannot read the post or password-protected 2638 if ( 2639 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 2640 || post_password_required( $post_parent ) ) { 2641 return ''; 2642 } 2630 2643 } 2631 2644 … … 2962 2975 } 2963 2976 2977 if ( ! empty( $args['post_parent'] ) ) { 2978 $post_parent = get_post( $id ); 2979 2980 // terminate the shortcode execution if user cannot read the post or password-protected 2981 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2982 return ''; 2983 } 2984 } 2985 2964 2986 if ( empty( $attachments ) ) { 2965 2987 return '';
Note: See TracChangeset
for help on using the changeset viewer.