Changeset 56851 for branches/4.2/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:25:18 PM (2 years ago)
- File:
-
- 1 edited
-
branches/4.2/src/wp-includes/media.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/src/wp-includes/media.php
r55775 r56851 1011 1011 } 1012 1012 } elseif ( ! empty( $atts['exclude'] ) ) { 1013 $post_parent_id = $id; 1013 1014 $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'] ) ); 1014 1015 } else { 1016 $post_parent_id = $id; 1015 1017 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 1018 } 1019 1020 if ( ! empty( $post_parent_id ) ) { 1021 $post_parent = get_post( $post_parent_id ); 1022 1023 // terminate the shortcode execution if user cannot read the post or password-protected 1024 if ( 1025 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1026 || post_password_required( $post_parent ) ) { 1027 return ''; 1028 } 1016 1029 } 1017 1030 … … 1306 1319 } 1307 1320 1321 if ( ! empty( $args['post_parent'] ) ) { 1322 $post_parent = get_post( $id ); 1323 1324 // terminate the shortcode execution if user cannot read the post or password-protected 1325 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 1326 return ''; 1327 } 1328 } 1329 1308 1330 if ( empty( $attachments ) ) { 1309 1331 return '';
Note: See TracChangeset
for help on using the changeset viewer.