Sunday, January 15, 2023
HomeWordPress Developmentwordpress.org - Deprecated: stripos(): Error in Wordpress After Updating to php 8.1

wordpress.org – Deprecated: stripos(): Error in WordPress After Updating to php 8.1


Displaying this error msg after upgrading to php 8.1 in wordpress

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of sort string is deprecated in /public_html/wp-includes/capabilities.wp-styles.php on line 90

Right here is the perform which i discovered within the capabilities.wp-styles.php

perform wp_add_inline_style( $deal with, $knowledge ) {
    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $deal with );

    if ( false !== stripos( $knowledge, '</model>' ) ) {
        _doing_it_wrong(
            __FUNCTION__,
            sprintf(
                /* translators: 1: <model>, 2: wp_add_inline_style() */
                __( 'Don't go %1$s tags to %2$s.' ),
                '<code>&lt;model&gt;</code>',
                '<code>wp_add_inline_style()</code>'
            ),
            '3.7.0'
        );
        $knowledge = trim( preg_replace( '#<model[^>]*>(.*)</model>#is', '$1', $knowledge ) );
    }

    return wp_styles()->add_inline_style( $deal with, $knowledge );
}

Right here is the 90 quantity line inside this code which causes the error,

if ( false !== stripos( $knowledge, '</model>' ) ) {

I upgraded to php 8.1 after which i received this error message, i need to remedy this downside.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments