Skip to content

Commit

Permalink
Fix array reset
Browse files Browse the repository at this point in the history
Fix for acceptance tests failing
  • Loading branch information
lithrel committed Dec 12, 2022
1 parent c1354f6 commit d948532
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion page.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$context = Timber::get_context();
$post = new Post(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$page_meta_data = get_post_meta( $post->ID );
reset( $page_meta_data );
$page_meta_data = array_map( fn( $v ) => reset( $v ), $page_meta_data );

// Ensure redirect is only performed if we're not already on a tag URL. Because tag.php includes this file.
if ( ! is_tag() && RedirectRedirectPages::is_active() ) {
Expand Down
4 changes: 2 additions & 2 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
// Articles block parameters to populate the articles block
// p4_take_action_page parameter to populate the take action boxout block
// Author override parameter. If this is set then the author profile section will not be displayed.
$page_meta_data = get_post_meta( $post->ID );
reset( $page_meta_data );
$page_meta_data = get_post_meta( $post->ID );
$page_meta_data = array_map( fn( $v ) => reset( $v ), $page_meta_data );
$page_terms_data = get_the_terms( $post, 'p4-page-type' );
$page_terms_data = is_array( $page_terms_data ) ? reset( $page_terms_data ) : null;
$context['background_image'] = $page_meta_data['p4_background_image_override'] ?? '';
Expand Down

0 comments on commit d948532

Please sign in to comment.