WC Vendors – Automate PDF Invoice for vendor orders

add_action( ‘woocommerce_order_status_processing’, function( $order_id ) { if ( ‘yes’ !== get_option( ‘wcvendors_vendor_invoice_enabled’, ‘no’ ) ) { return; } $order = wc_get_order( $order_id ); if ( ! $order ) { return; } // Skip per-vendor child orders — only process the…Continue reading

WP HTML Minify

// WP HTML Minify / Kiri Vadivelu / 2026 add_action(‘template_redirect’, ‘wp_html_minify_start’); function wp_html_minify_start() { // Only minify for front-end HTML pages if (is_user_logged_in() || !is_singular() && !is_home() && !is_front_page()) return; ob_start(‘wp_html_minify_finish’); } function wp_html_minify_finish($html) { $original = $html; // Remove…Continue reading

Image Type Convert

// Image Type Convert / Kiri Vadivelu / 2026 add_filter( ‘wp_handle_upload’, ‘image_type_convert’ ); function image_type_convert( $upload ) { // Only process images if ( ! isset( $upload[‘type’] ) || ! in_array( $upload[‘type’], [ ‘image/jpeg’, ‘image/png’, ‘image/jpg’ ], true ) )…Continue reading

Image Quality Scale

// Image Quality Scale / Kiri Vadivelu / 2026 function image_quality_scale( $quality, $mime_type ) { if ( ‘image/webp’ === $mime_type ) { return 70; // Webp default 86 } return $quality; } add_filter( ‘wp_editor_set_quality’, ‘image_quality_scale’, 10, 2 );Continue reading

Zefiros Stock Sync

/** * Keep WooCommerce stock identical across the language versions of a product. * * Translations are matched by SKU: , -FR, -ES, -DE, -IT. * This works for simple products, variable products (parent level) and variations. * Only items…Continue reading

Move AI Content & Meta Assistant

/** * Popcorn Jedi: Move AI Content & Meta Assistant * below the Classic Editor + add collapse toggle. */ function pj_move_wacdmg_below_editor() { $screen = get_current_screen(); if ( !$screen || !in_array($screen->base, array(‘post’, ‘post-new’), true) ) { return; } ?>Continue reading

SVG upload for WP Admin only

/** * Enable SVG uploads for Administrators only */ function enable_svg_uploads_for_admins($mime_types) { if (current_user_can(‘manage_options’)) { $mime_types[‘svg’] = ‘image/svg+xml’; $mime_types[‘svgz’] = ‘image/svg+xml’; } return $mime_types; } add_filter(‘upload_mimes’, ‘enable_svg_uploads_for_admins’); /** * Bypass secondary file-type check for SVG uploads by admins */ function…Continue reading

Schema Single Post

// Schema Single Post / Kiri Vadivelu / 2026 add_action(‘wp_head’, ‘schema_single_post’); function schema_single_post() { if ( ! is_single() ) return; $schema = [ ‘@context’ => ‘https://schema.org’, ‘@type’ => ‘Article’, ‘headline’ => get_the_title(), ‘author’ => [‘@type’ => ‘Person’, ‘name’ => get_the_author()],…Continue reading

Open Graph Meta

// Open Graph Meta / Kiri Vadivelu / 2026 function open_graph_meta() { if (is_singular()) { global $post; $title = get_the_title(); $description = has_excerpt() ? get_the_excerpt() : wp_trim_words($post->post_content, 30); $url = get_permalink(); $image = get_the_post_thumbnail_url($post->ID, ‘large’); $site_name = get_bloginfo(‘name’); echo ‘‘…Continue reading