block_element && '' === $content) { $ignore_block_element = ''; } $output .= $content; } return $output; } /** * Replace matches by smiley image, lazyloaded * * @param array $matches Array of matches. * @return string */ private function translateSmiley($matches) { global $wpsmiliestrans; if (count($matches) === 0) { return ''; } $smiley = trim(reset($matches)); $img = $wpsmiliestrans[ $smiley ]; $matches = []; $ext = preg_match('/\.([^.]+)$/', $img, $matches) ? strtolower($matches[1]) : false; $image_exts = ['jpg', 'jpeg', 'jpe', 'gif', 'png']; // Don't convert smilies that aren't images - they're probably emoji. if (! in_array($ext, $image_exts, true)) { return $img; } /** * Filter the Smiley image URL before it's used in the image element. * * @since 2.9.0 * * @param string $smiley_url URL for the smiley image. * @param string $img Filename for the smiley image. * @param string $site_url Site URL, as returned by site_url(). */ $src_url = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url()); // Don't LazyLoad if process is stopped for these reasons. if (is_feed() || is_preview()) { return sprintf(' %s ', esc_url($src_url), esc_attr($smiley)); } return sprintf(' %s ', $this->getPlaceholder(), esc_url($src_url), esc_attr($smiley)); } /** * Returns the placeholder for the src attribute * * @since 1.2 * @author Remy Perona * * @param int $width Width of the placeholder image. Default 0. * @param int $height Height of the placeholder image. Default 0. * @return string */ public function getPlaceholder($width = 0, $height = 0) { $width = 0 === $width ? 0 : absint($width); $height = 0 === $height ? 0 : absint($height); $placeholder = str_replace(' ', '%20', "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $width $height'%3E%3C/svg%3E"); /** * Filter the image lazyLoad placeholder on src attribute * * @since 1.1 * * @param string $placeholder Placeholder that will be printed. * @param int $width Placeholder width. * @param int $height Placeholder height. */ return apply_filters('rocket_lazyload_placeholder', $placeholder, $width, $height); } }
Fatal error: Uncaught TypeError: Argument 3 passed to WP_Rocket\Subscriber\Optimization\Lazyload_Subscriber::__construct() must be an instance of RocketLazyload\Image, string given in /home/payon/public_html/wp-content/plugins/wp-rocket/inc/classes/subscriber/Optimization/class-lazyload-subscriber.php:75 Stack trace: #0 [internal function]: WP_Rocket\Subscriber\Optimization\Lazyload_Subscriber->__construct(Object(WP_Rocket\Admin\Options_Data), Object(RocketLazyload\Assets), 'RocketLazyload\\...', Object(RocketLazyload\Iframe)) #1 /home/payon/public_html/wp-content/plugins/wp-rocket/vendor/league/container/src/Definition/ClassDefinition.php(47): ReflectionClass->newInstanceArgs(Array) #2 /home/payon/public_html/wp-content/plugins/wp-rocket/vendor/league/container/src/Container.php(290): League\Container\Definition\ClassDefinition->build() #3 /home/payon/public_html/wp-content/plugins/wp-rocket/vendor/league/container/src/Container.php(90): League\Container\Container->getFromThisContainer('lazyload_subscr...', Array) #4 /ho in /home/payon/public_html/wp-content/plugins/wp-rocket/inc/classes/subscriber/Optimization/class-lazyload-subscriber.php on line 75