Changeset 56882 for branches/5.6/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 03:12:09 PM (18 months ago)
- Location:
- branches/5.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.6
- Property svn:mergeinfo changed
/trunk merged: 56833-56838
- Property svn:mergeinfo changed
-
branches/5.6/src/wp-includes/media.php
r55781 r56882 2249 2249 } 2250 2250 } elseif ( ! empty( $atts['exclude'] ) ) { 2251 $post_parent_id = $id; 2251 2252 $attachments = get_children( 2252 2253 array( … … 2261 2262 ); 2262 2263 } else { 2264 $post_parent_id = $id; 2263 2265 $attachments = get_children( 2264 2266 array( … … 2271 2273 ) 2272 2274 ); 2275 } 2276 2277 if ( ! empty( $post_parent_id ) ) { 2278 $post_parent = get_post( $post_parent_id ); 2279 2280 // terminate the shortcode execution if user cannot read the post or password-protected 2281 if ( 2282 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 2283 || post_password_required( $post_parent ) ) { 2284 return ''; 2285 } 2273 2286 } 2274 2287 … … 2599 2612 } 2600 2613 2614 if ( ! empty( $args['post_parent'] ) ) { 2615 $post_parent = get_post( $id ); 2616 2617 // terminate the shortcode execution if user cannot read the post or password-protected 2618 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2619 return ''; 2620 } 2621 } 2622 2601 2623 if ( empty( $attachments ) ) { 2602 2624 return '';
Note: See TracChangeset
for help on using the changeset viewer.