Skip to content

Commit

Permalink
Added space as expected after parenthesis
Browse files Browse the repository at this point in the history
Expected 1 space after open parenthesis as per the PHPCS standard.
  • Loading branch information
AakifKadiwala committed Jan 3, 2025
1 parent e078dcb commit ca1dd5d
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -8483,34 +8483,33 @@ function wp_create_initial_post_meta() {
*/

function get_page_by_template( $template, $field = 'ID' ) {
$query = new WP_Query(
array(
'post_type' => 'page',
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => $template,
'compare' => '==',
),
),
'fields' => 'ids',
)
);

if ( $query->have_posts() ) {
$template_page_ids = $query->posts;
wp_reset_postdata();

if ( 'ID' === $field ) {
return $template_page_ids;
} elseif ( 'title' === $field ) {
return array_combine( $template_page_ids, array_map( 'get_the_title', $template_page_ids ) );
} elseif ( 'permalink' === $field ) {
return array_combine( $template_page_ids, array_map( 'get_permalink', $template_page_ids ) );
}
}

wp_reset_postdata();
return null;
}
$query = new WP_Query(
array(
'post_type' => 'page',
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => $template,
'compare' => '==',
),
),
'fields' => 'ids',
)
);

if ( $query->have_posts() ) {

Check failure on line 8500 in src/wp-includes/post.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Whitespace found at end of line
$template_page_ids = $query->posts;
wp_reset_postdata();

Check failure on line 8503 in src/wp-includes/post.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Whitespace found at end of line
if ( 'ID' === $field ) {

Check failure on line 8504 in src/wp-includes/post.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Whitespace found at end of line
return $template_page_ids;
} elseif ( 'title' === $field ) {

Check failure on line 8506 in src/wp-includes/post.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Whitespace found at end of line
return array_combine( $template_page_ids, array_map( 'get_the_title', $template_page_ids ) );
} elseif ( 'permalink' === $field ) {

Check failure on line 8508 in src/wp-includes/post.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Whitespace found at end of line
return array_combine( $template_page_ids, array_map( 'get_permalink', $template_page_ids ) );
}
}

wp_reset_postdata();
return null;
}

0 comments on commit ca1dd5d

Please sign in to comment.