[Warning] PHP warning when no fields are defined for a post
-
Hey,
First of all great plugin, thank you!
One thing i noticed while using the plugin which you may want to fix:
array_merge_recursive in acft\includes\functions.php on line 97 produces a warning as its arguments may not be arrays if no fields are defined for a specific post or no option fields are present. An easy fix would be to exchange lines 91 and 92
$all_post_fields = get_fields($post->ID, false); $all_option_fields = get_fields('option', false);
with
$all_post_fields = get_fields($post->ID, false) ?: array(); $all_option_fields = get_fields('option', false) ?: array();
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Warning] PHP warning when no fields are defined for a post’ is closed to new replies.