Template administration Error after WP 4.8 update

This is a generic PHP question, but simple to answer. The problem is most likely caused by PHP 7. Simply change the line: $callback[0]->$callback[1](); to $callback[0]->{$callback[1]}(); This is because $callback[0]->$callback[1](); means $callback[0]->{$callback[1]}(); in PHP5, while it means ($callback[0]->$callback)[1](); in PHP7. Take a look into this page to know the details about the change.

Cannot use object of type WP_Error

What’s $genres? I don’t see it defined anywhere. And wp_insert_term() may return an error, so make sure to check if it is an error. So instead of simply doing return wp_insert_term($name,$tax)[“term_id”], you could do something like this: $data = wp_insert_term( $name, $tax ); if ( ! is_wp_error( $data ) ) { return $data[‘term_id’]; }

Checking return with WP Error

Not entirely sure what you are asking, but if I understand correctly you want to perform some testing on the return value in order to avoid iterating a WP_Error object and perhaps handle errors in some way. According to the documentation get_terms() will return an array of term objects or false if no objects were … Read more