The cause of the inconsitent behavior on the hosts has its roots in the different PHP versions. If you check the PHP manual for the empty()
language construct, you can see in the changelog:
5.5.0 empty() now supports expressions, rather than only variables.
So it is only since PHP 5.5 that it is possible to use expressions inside of empty())
as is done in your plugin. In this case the usage of empty()
is not needed and the code should work simply without it:
'meta' => array( 'class' => get_avatar( get_current_user_id(), 28 ) ? 'with-avatar' : '', ),
Related Posts:
- A non-numeric value encountered in /wp-includes/functions.php on line 68
- Programmatically revert to backup .htaccess a possibility?
- Can’t log in to WordPress wp-admin after adding code to functions.php
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- Site title not showing. Please help me
- Functions are causing errors
- syntax error unexpected ‘}’ at 364 line
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- WP Debug enabled Undefined index error in a widget
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- How to set and use global variables? Or why not to use them at all
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- WordPress Infinite Scroll without using any plugin
- How to remove a metabox from menu editor page?
- Enqueue Javascript Correctly for 3.5
- How to add active class to custom menu using while loop and wp_list_pages
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- Add footer.php to WordPress child theme
- Create an array from an array
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Can I change a variable in a content part while calling it?
- WordPress Redirect: Default Password Reset URL [duplicate]
- Shortcode return function with link href inside PHP
- Function not working at one place
- How to remove or change the “W” icon in “My Sites”?
- How to prevent WP_Query function from returning all posts when empty?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- WordPress Script stops suddenly
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- foreach loop still echoes array
- dynamic dependent select dropdown
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- getting logged in user info (wp-load.php) from parent directory
- wp-comments-post.php file returns a blank page
- Add .htm extention to a custom taxonomy
- Custom gallery in wp3.5
- Noscript not working as it should in wordpress site
- How to use theme function in post/page?
- esc_url( ) won’t use https
- Content filter won’t work
- Where is this function’s callback getting its arguments from?
- Why does the post_type_link hook everything twice?
- Warning: in_array() null given in PHP function
- Use post ID in functions.php file adminside
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- use loop to return blog details
- How can I count ACF sub_field with a certain value
- Fetching Initials of the Commentator in the WordPress Website
- Adding function to child theme’s function.php
- Missing a text-domain esc_attr_e
- Custom posts password protect
- How to get post category list as select in front-end?
- How to use functions [closed]
- Extract and display user infromation on an automatically created page
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- How can I assign separate stylesheets to different pages?
- Function to call either single post or category
- Execute PHP code only with specific user role
- WP Container Displaying Only on First Page of Archive
- Updating Metadata with Shortcode
- can’t load .po file in functions.php
- Woocommerce – Exclude variation attribute on specific variation
- How do I add a function to parent theme
- Are there any drawbacks on opening a session_start in functions.php and header.php?
- PHP function for horizontal Woocommerce thumbnails and badges
- Add Pre-Defined Value to Click Counter in WordPress
- Show sidebar only to author of post
- How to move a post from one category to another
- Show data obtained from a function and place it in a shortocode function
- how to add custom select field to wordpress edit page
- How to override theme’s public static function inside of a trait?
- Delete empty title_tags, find a h1 heading and echo it
- HELP: cannot log into wordpress. PHP error
- PHP error on local server install
- how to use 2 index.php file One for mobile and one for desktop
- WP_Query To Display Product Of Brand On Taxonomy Page
- This occurs when I open admin or front on localhost
- ajaxurl usage for a custom function
- oembed facebook link?
- Open/closed function [closed]
- How can I export data without using any import/export plugin
- Search for images that width and height is more than 500
- add a value to an external link query in searchform
- Matching multi user
- Add disclaimer before certain posts and pages
- auto metakey value on post tile
- How do I routinely extract the thumbnail of the most recent post?
- wordpress ajax return 0
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- site_url() returns with additional backslashes
- Overwriting a Shortcode
- Search box background on a different page template
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- Troubleshooting “loopback requests that take too long”
- A next page function with shortcode?
- What is the wrong with this function to enqueue the scripts and styles to the theme? [closed]
- Warning: Attempt to read property “term_id” on int – Woocommerce
- Automatically change insurance quantity based on cart total [closed]
- How to pass value to add_filter wpcf7_form_tag from another function?
- hiddenQuestions.find is not a function