Skip to content

Commit

Permalink
Adds a check for any registered post_meta keys
Browse files Browse the repository at this point in the history
Once the query has been run to fetch any post_meta keys from the table, this checks if that array contains values.
If it does not, it fetchs any registered post meta keys, and uses that array instead.
  • Loading branch information
jonathanbossenger committed Dec 8, 2024
1 parent 1b1e35d commit b74a7ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,11 @@ function meta_form( $post = null ) {
);
}

if ( !$keys ){

Check failure on line 734 in src/wp-admin/includes/template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 space after "!"; 0 found

Check failure on line 734 in src/wp-admin/includes/template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 space after closing parenthesis; found 0

Check failure on line 734 in src/wp-admin/includes/template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Space between opening control structure and closing parenthesis is required
$registered_meta = get_registered_meta_keys( 'post', $post->post_type );
$keys = array_keys( $registered_meta );
}

if ( $keys ) {
natcasesort( $keys );
}
Expand Down

0 comments on commit b74a7ab

Please sign in to comment.