Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check return value of get_post_meta #1167

Merged
merged 8 commits into from
Jul 29, 2024
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@
*/
function prepare_meta( $post_id ) {
update_postmeta_cache( array( $post_id ) );
$meta = get_post_meta( $post_id );
$meta = get_post_meta( $post_id );

if ( false === $meta ) {
return array();
}

$meta = is_array( $meta ) ? $meta : array();

Check warning on line 443 in includes/utils.php

View workflow job for this annotation

GitHub Actions / phpcs

Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space
$prepared_meta = array();
$excluded_meta = excluded_meta();
faisal-alvi marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
Loading