Completely Disable Comments (copy) (copy) (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

RewardsWP — My Account Rewards Tab

/** * Plugin Name: RewardsWP — My Account Rewards Tab * Description: Adds a “My Rewards” tab to WooCommerce My Account that opens the rewards widget. * Version: 1.0.0 * Author: AffiliateWP */ if ( ! defined( ‘ABSPATH’ ) )…Continue reading

Next Mnday

/** * NIRMAKO Dynamic Event Schema (JSON-LD) – FULL * Covers: startDate, endDate, location, image, description, * organizer(+url), performer, eventStatus, offers(url/validFrom/price) */ function nirmako_next_monday_datetime($hour = 10, $minute = 0, $tz = ‘Asia/Jerusalem’) { $dt = new DateTime(‘now’, new DateTimeZone($tz)); $dt->setTime($hour,…Continue reading

Remove the coupon section for orders that did not use any coupon.

add_action( ‘woocommerce_email_before_order_table’, ‘conditionally_remove_coupon_section_from_email’, 5, 4 ); function conditionally_remove_coupon_section_from_email( $order, $sent_to_admin, $plain_text, $email ) { if ( ! $order instanceof WC_Order ) { return; } // Get applied coupons $coupons = $order->get_coupon_codes(); // If NO coupons were used, remove the coupon…Continue reading

HTML Sitemap Archive Pages

/** * Enhances AIOSEO HTML Sitemap: * – Links CPT headings to their archive URLs (including Blog) * – Moves the “Posts” section right after “Pages” * – Preserves all AIOSEO settings, filters, and structure * * Fixed bugs: *…Continue reading