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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.