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
- Should I use spl_autoload_register() in my plugin?
- WP-CLI – Selecting PHP version
- error_log() output for print_r() appearing on page
- Hide php Notices in Dashboard
- 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
- wp_set_object_terms and arrays
- get_the_content if it contains multiple lines it results in SyntaxError
- Get used terms by an author as array of strings
- How to get the term before the last from a custom taxonomy?
- List all categories but exclude current post category on single post page
- How to resolve error “Cookies are blocked due to unexpected output.”?
- Enable errors PHP WordPress 5.2
- 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?
- Append a term to WooCommerce product existing product category terms
- After upgrading to PHP 7.0 my contact form outputs error
- Does WordPress have a built in reference to the PHP version its running under? [closed]
- Check if term object is in array
- Get taxonomy terms only of the WP_Query current posts
- Change description on specific WooCommerce product status change
- 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
- Putting PHP variables into javascript [duplicate]
- Using a variable in is_page(array())
- 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?
- 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
- Pass variable from one function to another
- Mute Debug Messages from Plugins
- Error on wp_default_style After upgrade to php 7
- How to modify a global variable in a function and use it on another function?
- Error: options page not found
- Which is the correct way to conditionally enqueue a CSS file?
- Limit Taxonomy Output in Conditional Statement
- How to pass a PHP $_GET variable and fetch/output it?
- Preg_Match(): compilation failed unknown property name
- Get all categories post is not in
- Creating WordPress Shortcode with Variable
- How can I display a div ONLY if it is not a certain term page
- Hide image if taxonomy term is empty
- customize wordpress database error page
- persist a variable set in header.php all the way down to footer.php
- How to filter custom taxonomy term name, slug, and description?
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- How to end a while loop when used in a fetch assoc function [closed]
- After adding my website to a new server, I keep getting a unexpected end of file error, but the file is identitcal to it’s original source
- Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta)
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- How to reference PHP in Javascript
- echo var into wp_query
- Create a a form for custom taxonomy terms
- Angular not defined [closed]
- PHP displaying wrong custom taxonomy images
- Illegal string offset in PHP function in via Theme Customizer
- How do I edit the terms output args or array data?
- How to send a php var to jQuery Ajax call with two different file
- update_term_meta() only updating once on certain meta keys
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- Fatal error login WordPress [duplicate]
- I am having errors with checkout on wordpress
- Intermittent 503 Service Unavailable Error
- WordPress How do I pass a variable from one add_action to another?
- Best way to use variables in multiple functions?
- How do I fix Undefined variable using $_POST in function?
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- $_GET[‘title’] in WordPress
- Is there a way to search for a missing endif?
- style.min.css code issue
- PHP is_embed error showing up
- WordPress 3.0 PHP Error – notice WordPress_product_Type was called incorrectly
- how to display child terms with parent terms in custom taxonomy?
- Custom Taxonomy Link Text Echo Name Not Slug
- Headers Already Sent
- how to add number value in front for variable [closed]
- Pass custom value to custom taxonomy
- Too few arguments for printf() [closed]
- syntax error unexpected ‘}’ at 364 line
- Difference in Get Variable Location
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Incomplete term slugs output from a foreach loop with get_the_terms
- Data inserted in database, but ajax calls error function
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- problem with php function error
- Import and use a variable in additional settings of Contact Form 7 [closed]
- PHP warning Invalid argument supplied for foreach() on custom page template
- Not able to see the error [closed]
- WP query with variables gives no result for specific user
- Getting invalid user ID error when creating a new user with wp_insert_user
- get_the_term_list give me a whitespace
- WordPress taxonomy and terms question
- Error when loading Dashboard