Changeset 56852 for branches/4.3/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:28:05 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.3/src/wp-includes/media.php
r55776 r56852 1029 1029 } 1030 1030 } elseif ( ! empty( $atts['exclude'] ) ) { 1031 $post_parent_id = $id; 1031 1032 $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'] ) ); 1032 1033 } else { 1034 $post_parent_id = $id; 1033 1035 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 1036 } 1037 1038 if ( ! empty( $post_parent_id ) ) { 1039 $post_parent = get_post( $post_parent_id ); 1040 1041 // terminate the shortcode execution if user cannot read the post or password-protected 1042 if ( 1043 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1044 || post_password_required( $post_parent ) ) { 1045 return ''; 1046 } 1034 1047 } 1035 1048 … … 1327 1340 } 1328 1341 1342 if ( ! empty( $args['post_parent'] ) ) { 1343 $post_parent = get_post( $id ); 1344 1345 // terminate the shortcode execution if user cannot read the post or password-protected 1346 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 1347 return ''; 1348 } 1349 } 1350 1329 1351 if ( empty( $attachments ) ) { 1330 1352 return '';
Note: See TracChangeset
for help on using the changeset viewer.