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