get_the_terms()
will return a boolean
false
under some circumstances:
A post with no terms assigned gives a false result, not an empty
array.https://codex.wordpress.org/Function_Reference/get_the_terms#Returns
It sounds like that is what is happening. You need to check that $post_link =
to ensure that it is the type
you expect before trying to use it.
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Illegal string offset in PHP function
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Warning: Illegal string offset ‘post’ and ‘page’
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 7146491840906359738 bytes)
- Customize default settings on new sites on multisite
- How do I get the author’s page url from their ID?
- Calculate percentage of post by category
- Remove class that has been added by parent theme
- How to check from which page the user is coming to the current page?
- Design view breaking on Pages
- Execute only on a certain page
- 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
- Wrap each shortcode in array to div
- Change links automatically to affiliate links
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Add before_content and after_content to register_sidebar
- How to access function from outside of a class within this class in WP plugin?
- Placing raw HTML inside a WordPress shortcode
- Word Count Function Preventing Permalink Editing
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- Replace word in “the_content” only for index.php
- Changing custom logo link
- Add a variable in functions.php and call it in single.php
- How does WordPress insert Paragraphs in posts
- Linking text within textarea of custom meta box
- what is the best practice to add new field to an api route
- Auto-update products after they were published – Woocommerce
- Title Case WordPress Menu Items
- php function to display commenter username or login
- How to change menu order item
- responsive.css in the WordPress should be prioritized
- Alter required message using comment form api
- How to get Post Type from the functions.php file
- How to display login form anywhere, when user isn’t logged in, without redirecting?
- Edit the_category (); for a hierarchical display
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- Multiple meta_key in one global $wpdb;
- Using data sent via AJAX in multiple functions on a WP plugin
- Utilize Function in Child Theme / Template File
- HTML Special Characters in URL string [closed]
- Create page template via functions.php?
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- How to have different site identity logos on each page on Astra Theme [closed]
- CSS change in woo commerce Place Order Text [closed]
- Overide Variable in Child Theme
- child parent styles enqueue order
- Add URL parameter to all internal links using a specific theme
- Warning: call_user_func() expects parameter 1 to be a valid callback, function
- Change MySQL PDO connection to a WPDB connection
- Randomize Color Scheme Selection in Theme
- Cannot modify header information – server cache
- Hide a div when a custom field is empty
- AJAX function not working [closed]
- Modify WooCommerce used to get all orders in dashboard
- Can’t log in to WordPress wp-admin after adding code to functions.php
- How to change basename url for wp-admin?
- display condition based on post term and status
- Only the first image uploads
- Search by date in WordPress
- Hide a div if the fiels is empty
- Illegal string offset checkbox
- removing the standard dashboard widgets in WP so I Can replace with custom
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- wpdb->query returns different value to phpMyAdmin
- Trying to add some custom text into WordPress Post title via function.php
- How to change order inside foreach using wp_enqueue_script?
- Change header on one page in WordPress
- I got big white screen when i attach main style sheet of Html in functions.php
- Using Javascript On Page – Header and Footer Now Missing
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- Add Product Permalink in woocommerce admin order page
- Unzip_file causing Media file upload error
- Allow Comments by Default for Multiple Post Types
- Cleaner ‘for each’ loop for registering scripts in functions.php
- How do I make comment-reply-button with that takes to comment reply form on click
- How to get User Avatar Image with link to Author and User name in Html Title tag?
- How to generate customized filtered output for the gallery
- How to get all users by user_login as a json_encode array?
- Escaping a Single Quote in str_replace for Nav Function
- Allow BBPress participant role to trash topics
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- WordPress rating by views [closed]
- Get author meta of all writers
- Trying to see if page is category or single and displaying title with appropriate heading tag
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Hide the content before the more tag in the “single page”
- Replace TinyMCE with Custom Built Editor
- Particular meta tag – viewport – insertion when dealing with plugin
- how to loop through blog posts in php
- WP Fatal error: Call to undefined function get_template_directory_uri()
- Remove default Image Sizes
- A better way to write this php function
- WooCommerce: write featured image dimensions to custom fields in product’
- Generate and upload screenshot as featured image for user-submitted post
- a problem in class in class-wp-hook.php
- transition_post_status hook, works – but not if the post is new
- change title of page dynamically