Deprecated Warning for trim() Function in Theme

Dear Support Team,

I hope this message finds you well.

I've encountered an issue that I need help with.

Recently, I have been seeing warnings on this site related to the use of the trim() function in the theme-head.php file. The warnings are as follows:

**************

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/oshia/public_html/wp-content/themes/betheme/functions/theme-head.php on line 1392

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/oshia/public_html/wp-content/themes/betheme/functions/theme-head.php on line 1392

class="home page-template-default page page-id-2433 logged-in admin-bar no-customize-support theme-betheme woocommerce-no-js color-custom content-brightness-light input-brightness-light style-simple button-stroke layout-full-width no-content-padding header-stack header-center header-fw sticky-header sticky-white ab-show subheader-title-left footer-copy-center mobile-tb-left mobile-side-slide mobile-mini-mr-ll mobile-icon-user-ss mobile-icon-wishlist-ss mobile-icon-cart-tb mobile-icon-search-tb mobile-icon-wpml-hide mobile-icon-action-hide be-page-2433 be-reg-271 product-gallery-zoom mfn-variable-swatches mfn-ajax-add-to-cart wpb-js-composer js-comp-ver-6.13.0 vc_responsive">

**************

I have identified the parts of the theme's code that are using trim(). However, I am unsure how to modify them in a way that would be safe and future-proof.

Could you please provide some assistance with this? I am looking for a solution that will either prevent null values from being passed to trim(), or ensure that the code will function correctly with future versions of PHP.

Thank you for your attention to this matter. I look forward to your response.

Best regards,

Carlos


Comments

Sign In or Register to comment.