Title: Undefined $term_id PHP notice
Last modified: August 30, 2016

---

# Undefined $term_id PHP notice

 *  Resolved [andrejm](https://wordpress.org/support/users/andrejm/)
 * (@andrejm)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/)
 * Hi,
 * just before outputting any ad on page, there is a PHP notice:
 * `Notice: Undefined property: stdClass::$term_id in /srv/www/xxx/htdocs/wp-content/
   plugins/advanced-ads/modules/display-by-query/display-by-query.class.php on line
   54`
 * Is this known issue? How to avoid this?
 * [https://wordpress.org/plugins/advanced-ads/](https://wordpress.org/plugins/advanced-ads/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * (@webzunft)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510762)
 * Hi andrejm,
 * thank you for your message. This is not a known issue and I am not able to reproduce
   it.
 * Which add-ons are you using and how does your ad setup look like?
 * You can also contact me directly through the Support page of the plugin (from
   within your Dashboard).
 * Thanks
    Thomas
 *  Thread Starter [andrejm](https://wordpress.org/support/users/andrejm/)
 * (@andrejm)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510764)
 * OK, I’ll try to provide more info for you to reproduce, thanks for a quick reply!
 *  Plugin Author [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * (@webzunft)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510767)
 * Since I can’t produce it you either have a complex setup that I didn’t test before
   or it is a conflict with another plugin. If possible, please try to disable other
   plugins to test this.
 * Thanks
    Thomas
 *  Thread Starter [andrejm](https://wordpress.org/support/users/andrejm/)
 * (@andrejm)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510850)
 * I tried to disable advanced ads addons until only core advanced ads plugin stayed
   active – still notice.
 * I then deactivated all other plugins – notice is there.
 * It happens both logged in/out.
 * Also, it seems to happen only on CPT archive pages.
 * $query just before the line 54 looks like this:
 *     ```
       stdClass Object
       (
           [labels] => stdClass Object
               (
                   [name] => Téma
                   [singular_name] => Téma
                   [add_new] => Pridať novýú tému
                   [add_new_item] => Pridať novýú tému
                   [edit_item] => Upraviť tému
                   [new_item] => Pridať novú tému
                   [view_item] => Zobraziť tému
                   [search_items] => Hľadať %s
                   [not_found] => Neboli nájdené žiadne témy
                   [not_found_in_trash] => V koši nie sú žiadne témy
                   [parent_item_colon] =>
                   [all_items] => Všetky Témy
                   [featured_image] => Prezentačný obrázok
                   [set_featured_image] => Nastaviť prezentačný obrázok
                   [remove_featured_image] => Odstrániť prezentačný obrázok
                   [use_featured_image] => Použiť ako prezentačný obrázok
                   [menu_name] => Témy
                   [name_admin_bar] => Téma
               )
   
           [description] =>
           [public] => 1
           [hierarchical] =>
           [exclude_from_search] =>
           [publicly_queryable] => 1
           [show_ui] => 1
           [show_in_menu] => 1
           [show_in_nav_menus] => 1
           [show_in_admin_bar] => 1
           [menu_position] =>
           [menu_icon] => dashicons-media-document
           [capability_type] => post
           [map_meta_cap] => 1
           [register_meta_box_cb] =>
           [taxonomies] => Array
               (
                   [0] => category
                   [1] => post_tag
               )
   
           [has_archive] => 1
           [rewrite] => Array
               (
                   [slug] => longread
                   [with_front] =>
                   [pages] => 1
                   [feeds] => 1
                   [ep_mask] => 1
               )
   
           [query_var] => longread
           [can_export] => 1
           [delete_with_user] =>
           [_builtin] =>
           [_edit_link] => post.php?post=%d
           [name] => longread
           [cap] => stdClass Object
               (
                   [edit_post] => edit_post
                   [read_post] => read_post
                   [delete_post] => delete_post
                   [edit_posts] => edit_posts
                   [edit_others_posts] => edit_others_posts
                   [publish_posts] => publish_posts
                   [read_private_posts] => read_private_posts
                   [read] => read
                   [delete_posts] => delete_posts
                   [delete_private_posts] => delete_private_posts
                   [delete_published_posts] => delete_published_posts
                   [delete_others_posts] => delete_others_posts
                   [edit_private_posts] => edit_private_posts
                   [edit_published_posts] => edit_published_posts
                   [create_posts] => edit_posts
               )
   
           [label] => Téma
       )
       ```
   
 * What other details would help you investigate this?
 *  Plugin Author [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * (@webzunft)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510950)
 * Ahoj andrejm,
 * thank you, this was all I needed to identify the cause.
 * The error is not critical and should not break the plugins functionality.
 * It should also only be displayed if WP_DEBUG is enabled, so you are probably 
   on a development environment.
 * I fix it with the next update of the plugin – maybe end of next week or later.
 * If you need the fix before that then please contact me directly and I will provide
   you with the untagged version.
 * Thanks again for your great help!
    Thomas
 *  Thread Starter [andrejm](https://wordpress.org/support/users/andrejm/)
 * (@andrejm)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510998)
 * Dakujem 😉
 * For the time being, I’ll just suppress the notice (you are right it only shows
   on dev environment) and wait for the update.
 * Thanks again for great support.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Undefined $term_id PHP notice’ is closed to new replies.

 * ![](https://ps.w.org/advanced-ads/assets/icon-256x256.gif?rev=2773443)
 * [Advanced Ads – Ad Manager & AdSense](https://wordpress.org/plugins/advanced-ads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-ads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-ads/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-ads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-ads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-ads/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [andrejm](https://wordpress.org/support/users/andrejm/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/undefined-term_id-php-notice/#post-6510998)
 * Status: resolved