Notice: Trying to get property of non-object in options.php
You can use isset() or property_exists() to check if the property exists. foreach ( $taxonomies_password_terms_obj as $taxonomy) { if( isset( $taxonomy->term_id ) ){ $options_password_taxonomies[$taxonomy->term_id] = $taxonomy->name; } }