/** * Remove custom trial for existing members (when existing member changes levels/renews) * * title: Remove custom trial for existing memebrs. * layout: snippet * collection: checkout * category: membership-levels, trial * * You can add this recipe to…Continue reading
/** * Remove subscription delay for current or past members. This will remove all subscription delays from checkout for any level if the user is an active member or had a prior level (and is renewing). * * title: Subscription…Continue reading
add_filter( ‘admin_title’, function ( $admin_title, $title ) { return str_replace( ” — WordPress”, ”, $admin_title ); }, 10, 2 );Continue reading
add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading
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_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
function truncate_html($html, $maxLength) { // Return early if the initial string is shorter than the maxLength if (strlen($html) loadHTML(mb_convert_encoding($html, ‘HTML-ENTITIES’, ‘UTF-8’), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); libxml_clear_errors(); // Use an XPath query to select all text nodes $xpath = new DOMXPath($dom); $textNodes…Continue reading
/** * Plugin Name: WPForms Custom Templates * Description: This plugin loads custom form templates. * Version: 1.0.0 */ /** * Load the templates. */ function wpf_load_custom_templates() { // Template code here } add_action( ‘wpforms_loaded’, ‘wpf_load_custom_templates’ );Continue reading
// Add Custom Template File include_once( get_stylesheet_directory() . ‘/wpforms-custom-templates.php’ );Continue reading