Changeset 56884 for branches/5.8/src/wp-includes/media.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-includes/media.php
r55777 r56884 2339 2339 } 2340 2340 } elseif ( ! empty( $atts['exclude'] ) ) { 2341 $post_parent_id = $id; 2341 2342 $attachments = get_children( 2342 2343 array( … … 2351 2352 ); 2352 2353 } else { 2354 $post_parent_id = $id; 2353 2355 $attachments = get_children( 2354 2356 array( … … 2361 2363 ) 2362 2364 ); 2365 } 2366 2367 if ( ! empty( $post_parent_id ) ) { 2368 $post_parent = get_post( $post_parent_id ); 2369 2370 // terminate the shortcode execution if user cannot read the post or password-protected 2371 if ( 2372 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 2373 || post_password_required( $post_parent ) ) { 2374 return ''; 2375 } 2363 2376 } 2364 2377 … … 2689 2702 } 2690 2703 2704 if ( ! empty( $args['post_parent'] ) ) { 2705 $post_parent = get_post( $id ); 2706 2707 // terminate the shortcode execution if user cannot read the post or password-protected 2708 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2709 return ''; 2710 } 2711 } 2712 2691 2713 if ( empty( $attachments ) ) { 2692 2714 return '';
Note: See TracChangeset
for help on using the changeset viewer.