remove_query_string = $remove_query_string; } /** * Return an array of events that this subscriber wants to listen to. * * @since 3.1 * @author Remy Perona * * @return array */ public static function get_subscribed_events() { return [ 'rocket_buffer' => [ 'process', 30 ], ]; } /** * Filters the HTML to fetch static files with a query string and remove it * * @since 3.1 * @author Remy Perona * * @param string $html HTML content. * @return string */ public function process( $html ) { if ( ! $this->is_allowed() ) { return $html; } $html = $this->remove_query_string->remove_query_strings_css( $html ); $html = $this->remove_query_string->remove_query_strings_js( $html ); return $html; } /** * Checks if is allowed to remove query strings for static files. * * @since 3.1 * @author Remy Perona * * @return bool */ protected function is_allowed() { return $this->remove_query_string->is_allowed(); } }