Changeset 56850 for branches/4.1/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:21:47 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1/src/wp-includes/media.php
r55772 r56850 975 975 } 976 976 } elseif ( ! empty( $atts['exclude'] ) ) { 977 $post_parent_id = $id; 977 978 $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 978 979 } else { 980 $post_parent_id = $id; 979 981 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 982 } 983 984 if ( ! empty( $post_parent_id ) ) { 985 $post_parent = get_post( $post_parent_id ); 986 987 // terminate the shortcode execution if user cannot read the post or password-protected 988 if ( 989 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 990 || post_password_required( $post_parent ) ) { 991 return ''; 992 } 980 993 } 981 994 … … 1269 1282 } 1270 1283 1284 if ( ! empty( $args['post_parent'] ) ) { 1285 $post_parent = get_post( $id ); 1286 1287 // terminate the shortcode execution if user cannot read the post or password-protected 1288 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 1289 return ''; 1290 } 1291 } 1292 1271 1293 if ( empty( $attachments ) ) { 1272 1294 return '';
Note: See TracChangeset
for help on using the changeset viewer.