]+>)~i', array( $this, 'tag_script' ), $buffer ); if ( ! empty( $this->preload_url ) ) { $preload_html = ''; $buffer = preg_replace( '~
]*)*>~Ui', '\\0' . $preload_html, $buffer, 1 ); add_filter( 'w3tc_lazyload_on_initialized_javascript', array( $this, 'w3tc_lazyload_on_initialized_javascript' ) ); } $data['buffer'] = $buffer; $data['modified'] |= ! empty( $this->preload_url ); return $data; } /** * Processes a script tag to identify and handle specific Google Maps scripts. * * Examines the script tag to check if it matches the Google Maps Easy plugin's * frontend script. If a match is found, it updates `$preload_url` and removes * the tag from the buffer. * * @param array $m { * Matches from the regular expression applied to the buffer. * * @type string $0 The full matched script tag. * } * * @return string The modified or original script tag. */ public function tag_script( $m ) { $script_tag = $m[0]; if ( ! preg_match( '~