Add Radio Boxes To Donation Form

/** * Add a collection of radio selections to the donation form. * * This snippet only works in Charitable 1.5 or above. * */ function wpchar_charitable_register_new_radios_field() { if ( ! class_exists(“Charitable_Donation_Field” ) ) { return; }; /** * Define…Continue reading

Vendor Claims Management Admin Pages

/** * Snippet Name: Vendor Claims Management Admin Pages * Description: Adds an admin menu for managing vendor claims, including pending, approved, and denied claims. // Key Objectives: * 1. Add “Vendor Claims” Admin Page and Subpages: * * –…Continue reading

Remove Gutenberg Block Comments on Post Save

/** * This snippet removes Gutenberg block comments from post content when saving posts from the WordPress admin. * It targets specific post types (‘vendor’ and ‘venue’) and ensures the comments are not saved in the database. * This prevents…Continue reading

Pre-Populate Vendor/Venue Edit Profile Forms with User’s Pending Post Data

// Pre-populate edit form with data from existing post, regardless of status, with error handling add_filter(‘gform_pre_render’, ‘populate_edit_form_with_pending_post_data’); function populate_edit_form_with_pending_post_data($form) { // Get the current user ID and validate it $user_id = get_current_user_id(); if (!$user_id) { error_log(“Error: Unable to retrieve user…Continue reading

Disable default WordPress image sizes

// Disable default WordPress image sizes add_filter(‘intermediate_image_sizes’, ‘__return_empty_array’); // Disable large scaled image size add_filter(‘big_image_size_threshold’, ‘__return_false’); // Disable WooCommerce image sizes and prevent WooCommerce from regenerating sizes add_action(‘after_setup_theme’, function () { // WooCommerce image sizes remove_image_size(‘woocommerce_thumbnail’); remove_image_size(‘woocommerce_single’); remove_image_size(‘woocommerce_gallery_thumbnail’); // Clear…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