Changeset 56876 for branches/5.2/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 03:04:07 PM (17 months ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/trunk merged: 56833-56836,56838
- Property svn:mergeinfo changed
-
branches/5.2/src/wp-includes/media.php
r55789 r56876 1748 1748 } 1749 1749 } elseif ( ! empty( $atts['exclude'] ) ) { 1750 $attachments = get_children( 1750 $post_parent_id = $id; 1751 $attachments = get_children( 1751 1752 array( 1752 1753 'post_parent' => $id, … … 1760 1761 ); 1761 1762 } else { 1762 $attachments = get_children( 1763 $post_parent_id = $id; 1764 $attachments = get_children( 1763 1765 array( 1764 1766 'post_parent' => $id, … … 1770 1772 ) 1771 1773 ); 1774 } 1775 1776 if ( ! empty( $post_parent_id ) ) { 1777 $post_parent = get_post( $post_parent_id ); 1778 1779 // terminate the shortcode execution if user cannot read the post or password-protected 1780 if ( 1781 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1782 || post_password_required( $post_parent ) ) { 1783 return ''; 1784 } 1772 1785 } 1773 1786 … … 2079 2092 } 2080 2093 2094 if ( ! empty( $args['post_parent'] ) ) { 2095 $post_parent = get_post( $id ); 2096 2097 // terminate the shortcode execution if user cannot read the post or password-protected 2098 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 2099 return ''; 2100 } 2101 } 2102 2081 2103 if ( empty( $attachments ) ) { 2082 2104 return '';
Note: See TracChangeset
for help on using the changeset viewer.