Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 18 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /** |
| 3 | * Articles loop template. |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @global \WP_Query $article_query Article query. |
| 7 | * @global array $attributes |
| 8 | * @global array $newspack_blocks_post_id |
| 9 | */ |
| 10 | |
| 11 | call_user_func( |
| 12 | function( $data ) { |
| 13 | $attributes = $data['attributes']; |
| 14 | $article_query = $data['article_query']; |
| 15 | |
| 16 | global $newspack_blocks_post_id; |
| 17 | do_action( 'newspack_blocks_homepage_posts_before_render' ); |
| 18 | |
| 19 | Newspack_Blocks::filter_excerpt( $attributes ); |
| 20 | |
| 21 | while ( $article_query->have_posts() ) { |
| 22 | $article_query->the_post(); |
| 23 | if ( Newspack_Blocks::should_deduplicate_block( $attributes ) ) { |
| 24 | $newspack_blocks_post_id[ get_the_ID() ] = true; |
| 25 | } |
| 26 | echo Newspack_Blocks::template_inc( __DIR__ . '/article.php', array( 'attributes' => $attributes ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 27 | } |
| 28 | |
| 29 | Newspack_Blocks::remove_excerpt_filter(); |
| 30 | |
| 31 | do_action( 'newspack_blocks_homepage_posts_after_render' ); |
| 32 | wp_reset_postdata(); |
| 33 | }, |
| 34 | $data // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 35 | ); |