Undefined array key “public”
-
I’m getting the following in my system log when I edit my content control settings.
PHP Warning: Undefined array key "public" in .../wp-content/plugins/content-control/classes/Controllers/RestAPI.php on line 88'
I think the problem originates from a plugin I have recently installed which registers a taxonomy without specifying a value for “public” in the $args. Checking the WordPress code I can see that the defaults are not set in WP_Taxonomy::set_props until after the register_taxonomy_args filter call. Therefore, RestAPI::modify_type_force_show_in_rest should not assume that $args[‘public’] exists. Specifically, the if statement at line 88 should include an isset condition first (as it already does for the “show_in_rest” value of $args in the previous if).
- You must be logged in to reply to this topic.