Changeset 44808 for trunk/src/wp-includes/blocks/latest-posts.php
- Timestamp:
- 03/07/2019 09:08:38 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/latest-posts.php
r44273 r44808 15 15 function render_block_core_latest_posts( $attributes ) { 16 16 $args = array( 17 'numberposts' => $attributes['postsToShow'], 18 'post_status' => 'publish', 19 'order' => $attributes['order'], 20 'orderby' => $attributes['orderBy'], 17 'posts_per_page' => $attributes['postsToShow'], 18 'post_status' => 'publish', 19 'order' => $attributes['order'], 20 'orderby' => $attributes['orderBy'], 21 'suppress_filters' => false, 21 22 ); 22 23 … … 25 26 } 26 27 27 $recent_posts = wp_get_recent_posts( $args );28 $recent_posts = get_posts( $args ); 28 29 29 30 $list_items_markup = ''; 30 31 31 32 foreach ( $recent_posts as $post ) { 32 $post_id = $post['ID']; 33 34 $title = get_the_title( $post_id ); 33 $title = get_the_title( $post ); 35 34 if ( ! $title ) { 36 35 $title = __( '(Untitled)' ); … … 38 37 $list_items_markup .= sprintf( 39 38 '<li><a href="%1$s">%2$s</a>', 40 esc_url( get_permalink( $post _id) ),41 esc_html( $title )39 esc_url( get_permalink( $post ) ), 40 $title 42 41 ); 43 42 … … 45 44 $list_items_markup .= sprintf( 46 45 '<time datetime="%1$s" class="wp-block-latest-posts__post-date">%2$s</time>', 47 esc_attr( get_the_date( 'c', $post _id) ),48 esc_html( get_the_date( '', $post _id) )46 esc_attr( get_the_date( 'c', $post ) ), 47 esc_html( get_the_date( '', $post ) ) 49 48 ); 50 49 }
Note: See TracChangeset
for help on using the changeset viewer.