true, 'strategy' => 'async', ) ); wp_add_inline_script( 'fammro-loader', 'window.FAMMRO_CONFIG = ' . wp_json_encode( array( 'backend' => Api::base(), 'installation' => $connection['installation_id'], 'apiKey' => $connection['widget_key'], 'consent' => 'required', ), JSON_HEX_TAG | JSON_HEX_AMP | JSON_UNESCAPED_SLASHES ) . ';', 'before' ); } /** * Request type and settings allow the chat window. */ public static function should_load(): bool { if ( is_admin() || is_feed() || is_embed() || wp_doing_ajax() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) { return false; } $settings = Store::settings(); if ( ! $settings['enabled'] ) { return false; } if ( ! empty( $settings['excluded'] ) && is_singular() ) { return ! in_array( (int) get_queried_object_id(), $settings['excluded'], true ); } return true; } }