Skip Navigation

[Closed] get_the_terms() returns WP_Error object

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 10 months ago.

Assisted by: Waqar.

Author
Posts
#2370949
taxonomy.jpg
edit post 7844.jpg
add new taxonomy for post type.jpg

The problem started yesterday, until now everything worked fine.

I have a custom post type and I assigned a custom taxonomy to it.

I cannot get the terms assigned to that custom post using get_the_terms (post_id, taxonomy).

Following the screenshots you will see that everything is set up.

I have hardcoded a call : var_dump(get_the_terms(7844, 'nomos-synergati')); and it returns

object(WP_Error)#17061 (3) {
["errors"]=>
array(1) {
["invalid_taxonomy"]=>
array(1) {
[0]=>
string(37) "Μη έγκυρη ταξινομία."
}
}
["error_data"]=>
array(0) {
}
["additional_data":protected]=>
array(0) {
}
}

#2371505

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website with a similar code, but couldn't reproduce this error. This suggests that something specific to your website is involved.

Can you please share temporary admin login details and the link to the page where you've used the "get_the_terms" function? I'll also need your permission to download a clone/snapshot of the website if it needs to be investigated on a different server.

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

regards,
Waqar

The topic ‘[Closed] get_the_terms() returns WP_Error object’ is closed to new replies.