'how target two facets name str_replace?

How to say price and surface should change their button text 'go' to 'search'

add_filter( 'facetwp_facet_html', function( $output, $params ) {
        if ( 'price','surface' == $params['facet']['name'] ) {
            $output = str_replace( 'Go', 'Search', $output );
        }
        return $output;
    }, 10, 2 );

if ( 'price','surface' == does not seem to work.. I think it is not like that it should be done?

enter image description here

php


Solution 1:[1]

Use in_array instead of comma separated values:

if( in_array($params['facet']['name'], ['price','surface']) {
    ...
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Manuel Guzman