Hi,
That warning is triggered by a snippet returning an empty string to the generate_header_entry_meta_items filter. That filter expects an array of meta items. When it receives '', GeneratePress loops over it with foreach(), which produces the warning on every page load.
If you have a snippet like this:
add_filter( 'generate_header_entry_meta_items', function() {
return '';
} );
change it to return an empty array:
add_filter( 'generate_header_entry_meta_items', function() {
return array();
} );
That will stop the warnings while still removing the header meta.
Do you have any custom PHP targeting the entry meta, in Code Snippets, your child theme’s functions.php, or a plugin? If you can paste anything hooking generate_header_entry_meta_items, I’ll confirm the exact fix.
Thread Starter
bhkh
(@bhkh)
Oh, yeah. I have
// removes meta from under the title
add_filter( 'generate_header_entry_meta_items', function() {
return '';
} );
So I will replace '' with array() and see if it stops.
Thanks!