1

I receive the error on taxonomy page in wp-admin.Before this error, I had problem that couldnt add the taxonomy to menu because of my taxonomy code.I fixed the code then the current error became.So, How to fix it? Thanks

Notice: Trying to get property 'term_id' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 420

Notice: Trying to get property 'name' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 421

Notice: Trying to get property 'slug' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 424

Notice: Trying to get property 'parent' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 425
turkey

Notice: Trying to get property 'query_var' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-includes/taxonomy.php on line 4218


    Notice: Trying to get property 'term_id' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 420

    Notice: Trying to get property 'name' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 421

    Notice: Trying to get property 'slug' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 424

    Notice: Trying to get property 'parent' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-admin/includes/class-wp-terms-list-table.php on line 425
    turkey

    Notice: Trying to get property 'query_var' of non-object in /home/deniztas/oneclick.deniz-tasarim.site/wp-includes/taxonomy.php on line 4218

Thanks to @Tom J Nowell or Captain one eye as popular name in this community, I fixed it.The answer so its the changing in code:

I've identified two issues, the first, this:

            'rewrite' => true,
            'rewrite' => array( 'slug' => 'districts' ),
Can just be this:

            'rewrite' => array( 'slug' => 'districts' ),
And the second, the reason you get invalid menu items, is because districts is being used as the rewrite slug, but, the internal namevof

the taxonomy is Districts.

Replacing Districts with districts as the internal name fixed the issue for me locally:

register_taxonomy( 'districts', array('post'), array(
It's a general rule of thumb to keep internal names of things lower case, you can always use the labels for what the user sees
2
  • This is probably related to terms in the database having District rather than district, you might need to recreate and reassign those terms, then delete the originals. Also my eyes work fine, I just pulled a funny face for my avatar – Tom J Nowell Mar 26 '20 at 17:24
  • @TomJNowell yes, I deleted some infos from wpgy_terms and it works now.Also I am happy for your eye's health – Faruk rıza Mar 26 '20 at 18:40
0

I deleted problematic entries from wpgy_terms on database then it works now.If you are new at database, I suggest that backup your database before do something on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.