Changeset 56838 for trunk/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 12:45:49 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r56743 r56838 2608 2608 } 2609 2609 } elseif ( ! empty( $atts['exclude'] ) ) { 2610 $post_parent_id = $id; 2610 2611 $attachments = get_children( 2611 2612 array( … … 2620 2621 ); 2621 2622 } else { 2623 $post_parent_id = $id; 2622 2624 $attachments = get_children( 2623 2625 array( … … 2630 2632 ) 2631 2633 ); 2634 } 2635 2636 if ( ! empty( $post_parent_id ) ) { 2637 $post_parent = get_post( $post_parent_id ); 2638 2639 // terminate the shortcode execution if user cannot read the post or password-protected 2640 if ( 2641 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 2642 || post_password_required( $post_parent ) ) { 2643 return ''; 2644 } 2632 2645 } 2633 2646 … … 2964 2977 } 2965 2978 2979 if ( ! empty( $args['post_parent'] ) ) { 2980 $post_parent = get_post( $id ); 2981 2982 // terminate the shortcode execution if user cannot read the post or password-protected 2983 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2984 return ''; 2985 } 2986 } 2987 2966 2988 if ( empty( $attachments ) ) { 2967 2989 return '';
Note: See TracChangeset
for help on using the changeset viewer.