Changeset 56857 for branches/4.5/src/wp-includes/media.php
- Timestamp:
- 10/12/2023 02:34:12 PM (2 years ago)
- File:
-
- 1 edited
-
branches/4.5/src/wp-includes/media.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.5/src/wp-includes/media.php
r55780 r56857 1634 1634 } 1635 1635 } elseif ( ! empty( $atts['exclude'] ) ) { 1636 $post_parent_id = $id; 1636 1637 $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'] ) ); 1637 1638 } else { 1639 $post_parent_id = $id; 1638 1640 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); 1641 } 1642 1643 if ( ! empty( $post_parent_id ) ) { 1644 $post_parent = get_post( $post_parent_id ); 1645 1646 // terminate the shortcode execution if user cannot read the post or password-protected 1647 if ( 1648 ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) ) 1649 || post_password_required( $post_parent ) ) { 1650 return ''; 1651 } 1639 1652 } 1640 1653 … … 1938 1951 } 1939 1952 1953 if ( ! empty( $args['post_parent'] ) ) { 1954 $post_parent = get_post( $id ); 1955 1956 // terminate the shortcode execution if user cannot read the post or password-protected 1957 if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) { 1958 return ''; 1959 } 1960 } 1961 1940 1962 if ( empty( $attachments ) ) { 1941 1963 return '';
Note: See TracChangeset
for help on using the changeset viewer.