JetFormBuilder – Enable Guest Post Upload

add_action( ‘jet-form-builder/media-field/before-upload’, /** * @var Jet_Form_BuilderRequestFieldsMedia_Field_Parser $parser */ function ( $parser ) { $class_name = $parser->get_context()->get_class_name(); // We need to add ‘allow-insert-attachments’ to the Advanced -> CSS Class Name option if ( ! $class_name || false === strpos( $class_name, ‘allow-insert-attachments’…Continue reading

Auto convert photos to WEBP (jpg, png)

/** * Konwertuj przesłane obrazy na format WebP * * Ten fragment kodu automatycznie konwertuje przesłane obrazy (JPEG, PNG, GIF) * do formatu WebP w WordPress. Idealny do umieszczenia w pliku functions.php motywu * lub do korzystania z wtyczek takich…Continue reading

Add Auto Sizes to Lazy Loaded images

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if ( ! isset( $attr[‘loading’] ) || ‘lazy’ !== $attr[‘loading’] || ! isset( $attr[‘sizes’] ) ) { return $attr; } // Skip if attribute was already added. if ( false !== strpos( $attr[‘sizes’], ‘auto,’…Continue reading