Add Divi Button Styling to GForms Buttons

add_filter( ‘gform_submit_button’, ‘add_divi_button_css_class’, 10, 2 ); add_filter( ‘gform_next_button’, ‘add_divi_button_css_class’, 10, 2 ); add_filter( ‘gform_previous_button’, ‘add_divi_button_css_class’, 10, 2 ); function add_divi_button_css_class( $button, $form ) { $fragment = WP_HTML_Processor::create_fragment( $button ); $fragment->next_token(); $fragment->add_class( ‘et_pb_button’ ); return $fragment->get_updated_html(); }Continue reading

Add Auto Sizes to Lazy Loaded images (copy)

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

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

Disable WordPress 6.5 Font Library

add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $editor_settings[‘fontLibraryEnabled’] = false; return $editor_settings; } ); // Disable the REST API for the font library. add_filter( ‘register_post_type_args’, function( $arg, $post_type ) { if ( ‘wp_font_family’ === $post_type || ‘wp_font_face’ === $post_type ) {…Continue reading