Background of the issue:
I am trying to use a Menu item based language switcher.
I am also using LearnDash LMS, which runs has_shortcode() on menu item descriptions.
Because WPML's WPML_LS_Menu_Item has the $description set to null, it causes a deprecation warning.
Symptoms:
WPML_LS_Menu_Item throwing - Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated.
Questions:
Is it possible to apply this patch to WPML to improve the compatibility with LearnDash? Setting a better default will not cause the deprecation warning.
if ( isset( $lang['css_classes'] ) ) {
$this->classes = $lang['css_classes'];
The topic ‘[Closed] WPML_LS_Menu_Item throwing – Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of…’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.