/** * VVWC Helper Functions */ // Elementor safety post injection (used during cron) function vvwc_inject_dummy_post_context() { if ( defined( ‘DOING_CRON’ ) && DOING_CRON ) { global $post; if ( ! isset( $post ) || ! $post instanceof WP_Post )…Continue reading
// Remove the default add to cart button remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 ); // Add custom add to cart form for both simple and variable products add_action( ‘woocommerce_after_shop_loop_item’, ‘custom_add_to_cart_form_on_shop_page’, 10 ); function custom_add_to_cart_form_on_shop_page() { global $product; if ( $product->is_type( ‘simple’…Continue reading
/* Plugin Name: Daily Cleanup with Report Description: Deletes standard blog posts, categories, and tags daily, stores summary data for digest reporting, and avoids interfering with WPCode or other plugin taxonomies. Version: 1.9 */ function delete_all_posts_categories_tags_with_report() { global $wpdb; //…Continue reading
// Snippet by MI team – start. add_action(‘woocommerce_after_single_product’, function() { if (class_exists(‘MonsterInsights_eCommerce_WooCommerce_Integration’)) { $mi_ec_woo = MonsterInsights_eCommerce_WooCommerce_Integration::get_instance(); if (method_exists($mi_ec_woo, ‘product_detail’)) { $mi_ec_woo->product_detail(); } } }); // Snippet by MI team – end.Continue reading
/* Plugin Name: VVWC Daily Digest Composer Description: Composes and sends a daily email summary after cleanup and purge routines. Uses external helper for Elementor-safe context injection. Version: 2.3 */ function send_daily_vvwc_digest_email() { // 🔒 Suppress warnings and inject dummy…Continue reading
// Register Custom Post Type function create_changelog_cpt() { $labels = array( ‘name’ => _x( ‘Changelogs’, ‘Post Type General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Changelog’, ‘Post Type Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Changelogs’, ‘text_domain’ ), ‘name_admin_bar’ => __(…Continue reading
const IC_REGEXP_KATAKANA = “/\A[ア-ンガ-ボァ-ョヮッーヴ]+\z/”; const IC_REGEXP_POST_CODE_JP = “/\A\d{3}-?\d{4}\z/”; const IC_REGEXP_PHONE = “/\A\+?[1-9]\d{1,14}\z/”; add_filter(‘gform_field_validation’, ‘icFormValidation’, 10, 4); function icFormValidation($result, $value, $form, $field) { // カタカナのみの入力 if(preg_match(‘/\bkatakana\b/’, $field->cssClass) && !empty($value) && !preg_match(IC_REGEXP_KATAKANA, $value)) { $result[‘is_valid’] = false; $result[‘message’] = implode(‘ ‘, array_filter([$result[‘message’],…Continue reading
/* Plugin Name: MA Custom Fonts Description: Load custom fonts and inject to Gutenberg, Bricks, Oxygen Author: Matthias Altmann Project: Code Snippet MA Custom Fonts Version: 3.4.3 Plugin URI: https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ Description: en: https://www.altmann.de/en/blog-en/code-snippet-custom-fonts/ de: https://www.altmann.de/blog/code-snippet-eigene-schriftarten/ Copyright: © 2020-2025, Matthias Altmann…Continue reading
// Disable XML-RPC add_filter( ‘xmlrpc_enabled’, ‘__return_false’ ); // Block access to xmlrpc.php via .htaccess equivalent (Apache fallback) add_action( ‘init’, function () { if (strpos($_SERVER[‘REQUEST_URI’], ‘xmlrpc.php’) !== false) { wp_die( ‘Access denied.’ ); } }); // Remove pingback header add_filter( ‘wp_headers’,…Continue reading