Skip to content

Create an array for themes post meta #331

@lpointet

Description

@lpointet

When using get_post_meta with the $single parameter set to true, the returned value will be either the meta value (could be anything like a string, array or object for instance), or an empty string if the meta key is not found for the given post.

In this file (https://github.com/uncatcrea/wp-appkit/blob/master/wp-appkit/lib/themes/themes-storage.php#L92), we only check that the value is empty and assume it's already an array. This fails and triggers a Warning: Illegal string offset 'current_theme' + Cannot assign an empty string to a string offset.

We should then create the array before assigning the value.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions