Changeset 56864 for branches/4.8/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:50:31 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8/src/wp-includes/media.php
r55786 r56864 1690 1690 } 1691 1691 } elseif ( ! empty( $atts['exclude'] ) ) { 1692 $post_parent_id = $id; 1692 1693 $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'] ) ); 1693 1694 } else { 1695 $post_parent_id = $id; 1694 1696 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 1697 } 1698 1699 if ( ! empty( $post_parent_id ) ) { 1700 $post_parent = get_post( $post_parent_id ); 1701 1702 // terminate the shortcode execution if user cannot read the post or password-protected 1703 if ( 1704 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1705 || post_password_required( $post_parent ) ) { 1706 return ''; 1707 } 1695 1708 } 1696 1709 … … 1994 2007 } 1995 2008 2009 if ( ! empty( $args['post_parent'] ) ) { 2010 $post_parent = get_post( $id ); 2011 2012 // terminate the shortcode execution if user cannot read the post or password-protected 2013 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2014 return ''; 2015 } 2016 } 2017 1996 2018 if ( empty( $attachments ) ) { 1997 2019 return '';
Note: See TracChangeset
for help on using the changeset viewer.