Changeset 56895 for branches/6.2/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 04:07:43 PM (16 months ago)
- Location:
- branches/6.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.2
- Property svn:mergeinfo changed
/trunk merged: 56833-56838
- Property svn:mergeinfo changed
-
branches/6.2/src/wp-includes/media.php
r55769 r56895 2460 2460 } 2461 2461 } elseif ( ! empty( $atts['exclude'] ) ) { 2462 $post_parent_id = $id; 2462 2463 $attachments = get_children( 2463 2464 array( … … 2472 2473 ); 2473 2474 } else { 2475 $post_parent_id = $id; 2474 2476 $attachments = get_children( 2475 2477 array( … … 2482 2484 ) 2483 2485 ); 2486 } 2487 2488 if ( ! empty( $post_parent_id ) ) { 2489 $post_parent = get_post( $post_parent_id ); 2490 2491 // terminate the shortcode execution if user cannot read the post or password-protected 2492 if ( 2493 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 2494 || post_password_required( $post_parent ) ) { 2495 return ''; 2496 } 2484 2497 } 2485 2498 … … 2816 2829 } 2817 2830 2831 if ( ! empty( $args['post_parent'] ) ) { 2832 $post_parent = get_post( $id ); 2833 2834 // terminate the shortcode execution if user cannot read the post or password-protected 2835 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2836 return ''; 2837 } 2838 } 2839 2818 2840 if ( empty( $attachments ) ) { 2819 2841 return '';
Note: See TracChangeset
for help on using the changeset viewer.