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
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:
Share Improve this question asked Mar 26, 2020 at 17:03 Faruk rızaFaruk rıza 982 silver badges11 bronze badges 2 |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
1 Answer
Reset to default 0I 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.
District
rather thandistrict
, 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 ♦ Commented Mar 26, 2020 at 17:24