dimensions = $dimensions; } /** * Return an array of events that this subscriber wants to listen to. * * @return array */ public static function get_subscribed_events() { return [ 'rocket_buffer' => [ 'specify_image_dimensions', 17 ], ]; } /** * Update images that have no width/height with real dimentions. * * @param string $buffer Page HTML content. * * @return string Page HTML content after update. */ public function specify_image_dimensions( $buffer ) { if ( rocket_bypass() ) { return $buffer; } return $this->dimensions->specify_image_dimensions( $buffer ); } }