Changeset 56859 for branches/4.6/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:43:19 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6/src/wp-includes/media.php
r55783 r56859 1660 1660 } 1661 1661 } elseif ( ! empty( $atts['exclude'] ) ) { 1662 $post_parent_id = $id; 1662 1663 $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'] ) ); 1663 1664 } else { 1665 $post_parent_id = $id; 1664 1666 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 1667 } 1668 1669 if ( ! empty( $post_parent_id ) ) { 1670 $post_parent = get_post( $post_parent_id ); 1671 1672 // terminate the shortcode execution if user cannot read the post or password-protected 1673 if ( 1674 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1675 || post_password_required( $post_parent ) ) { 1676 return ''; 1677 } 1665 1678 } 1666 1679 … … 1964 1977 } 1965 1978 1979 if ( ! empty( $args['post_parent'] ) ) { 1980 $post_parent = get_post( $id ); 1981 1982 // terminate the shortcode execution if user cannot read the post or password-protected 1983 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 1984 return ''; 1985 } 1986 } 1987 1966 1988 if ( empty( $attachments ) ) { 1967 1989 return '';
Note: See TracChangeset
for help on using the changeset viewer.