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