get_term_link()
will return a WP_Error
object on error.
You can’t print
an object or array or you will get messages similar to what you are getting. Use var_dump()
instead or print_r()
and you should see what is occuring. Your error even tells you that WP_Error
is the object involved.
You are getting errors when the term you are looking for is not found.
And yes, you should hide your error messages on a production site. They can be revealing. Write to a log if you must have errors on the production site.
Related Posts:
- PHP Warning: Attempt to read property “term_id” on bool
- javascript variable to wordpress php variable
- Trying to display terms from custom taxonomy within function
- How to add elements to an empty array in PHP?
- Show all terms of a custom taxonomy?
- Should I use spl_autoload_register() in my plugin?
- WP-CLI – Selecting PHP version
- error_log() output for print_r() appearing on page
- When to use Exceptions vs Error Objects vs just plain false/null
- Where to get information about array fields in $_REQUEST?
- Hide php Notices in Dashboard
- PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- Pass a PHP variable to another file
- WSOD but WP_DEBUG not giving any errors
- How to store the_title() into a variable to reutrn the value, not just echo it
- Variables declared in header not available in other includes
- How do I make my function add variables/values to the $post object?
- wp_set_object_terms and arrays
- WordPress “Link has expired” error on updating posts
- How to find objects by terms
- Display certain amount of posts on taxonomy archive page
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- get_the_content if it contains multiple lines it results in SyntaxError
- Get used terms by an author as array of strings
- category not display in word press grammatically
- How to get the term before the last from a custom taxonomy?
- List all categories but exclude current post category on single post page
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- How to resolve error “Cookies are blocked due to unexpected output.”?
- where to include a php file
- error_log is not working as expected in functions.php file
- Enable errors PHP WordPress 5.2
- How do I know what variables are passed in a filter/action and what their meaning is?
- “Can’t use function return value in write context” error
- How do I get taxonomy terms by ID in a specific order
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- WP_Query use for a filter with multiple Taxonomies and Terms
- Error when requesting password reset email – wp authentication
- “Notice: Undefined variable: content” is showing [closed]
- Append a term to WooCommerce product existing product category terms
- Problems with function on function.php
- After upgrading to PHP 7.0 my contact form outputs error
- When would you use $_post instead of $post?
- Does WordPress have a built in reference to the PHP version its running under? [closed]
- Check if term object is in array
- How to change / delete product short description in Woocommerce
- Can WordPress email the admin about PHP errors, while hiding them from the site?
- Get taxonomy terms only of the WP_Query current posts
- get_the_terms – only top level
- Change description on specific WooCommerce product status change
- White Screen of Death – wp-admin
- Ajax return code 400
- Locating Global Variables
- Pass PHP variable to JavaScript without inline JS
- Count the number of times the search form template gets included on a page
- get_terms orderby numeric
- Putting PHP variables into javascript [duplicate]
- Variable global scope [closed]
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Query all posts of a custom taxonomy term
- Using a variable in is_page(array())
- WordPress 5 WP REST routes – No errors
- Static variable and add_rewrite_rule?
- Warning: Invalid argument supplied for foreach() in portfolio-list.php [closed]
- get_term_link() returns incorrect url
- How to put a variable in a instance in the widget
- How to find error in my code when the error message is pointing to WP core file?
- Call global variable array() in woocommerce child/template
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- get a simple array of all of the term names that exist in all taxonomies
- How can I Add a variable PHP in the Menu Nav
- Pass variable from one function to another
- Get value from shortcode to do something
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Mute Debug Messages from Plugins
- WordPress Script stops suddenly
- A non-numeric value encountered in /wp-includes/functions.php on line 68
- How to get original custom taxonomy slug after the slug has been rewritten?
- Error on wp_default_style After upgrade to php 7
- PHP, Creating a dynamic variable
- How to modify a global variable in a function and use it on another function?
- Get term siblings of current child taxonomy
- How to get post’s current parent term ID?
- Insert term and child term from frontend
- Getting error when using wp_insert_post()
- Error: options page not found
- Headers already sent in Pluggable.php / homepage and wp-login error
- Which is the correct way to conditionally enqueue a CSS file?
- “Undefined index” error when saving empty array with checkboxes
- Variable not staying set
- List taxonomy term slugs within shortcode (do_shortcode)
- Include Parent Term in wp_list_categories
- How can I access string value in an array?
- Copy taxonomy terms from one post to another programmatically
- WordPress function and string as variable?
- Limit Taxonomy Output in Conditional Statement
- Create a WordPress shortcode using PHP [duplicate]
- How to pass a PHP $_GET variable and fetch/output it?