WC Vendors – Show the “AI” overlay on the product image

// Add an “AI used” checkbox to the vendor’s own product edit form, after Tax Class (General tab) add_action( ‘wcv_product_options_tax’, function( $post_id ) { \WC_Vendors\Classes\Front\WCV_Form_Helper::input( array( ‘id’ => ‘_wcv_ai_generated’, ‘post_id’ => $post_id, ‘type’ => ‘checkbox’, ‘label’ => __( ‘This product…Continue reading

List All URLs

// List All URLs / Kiri Vadivelu / 2026 add_action(‘admin_menu’, ‘add_url_list_page’); function add_url_list_page() { add_management_page(‘All URLs’, ‘All URLs’, ‘manage_options’, ‘all-urls’, ‘display_all_urls’); } function display_all_urls() { $args = array( ‘post_type’ => array(‘post’, ‘page’), ‘post_status’ => ‘publish’, ‘numberposts’ => -1 ); $posts…Continue reading

Custom Role Redirect

// Custom Role Redirect / Kiri Vadivelu / 2026 function custom_role_dashboard() { // Replace ‘contractor’ with your actual custom role slug $restricted_role = ‘contractor’; if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) { $current_user = wp_get_current_user(); // Check if…Continue reading

Restrict Role Access

// Restrict Role Access / Kiri Vadivelu / 2026 function restrict_role_access() { // Check if user is trying to access admin area if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) { $user = wp_get_current_user(); // Check for Subscriber or…Continue reading

Disable All Search

// Disable All Search / Kiri Vadivelu / 2026 function disable_search_query( $query, $error = true ) { if ( is_search() && !is_admin() ) { $query->is_search = false; $query->query_vars[‘s’] = false; $query->query[‘s’] = false; if ( $error ) { $query->is_404 =…Continue reading

No Index Category

// No Index Category / Kiri Vadivelu / 2026 add_filter(‘wp_robots’, ‘no_index_category’); function no_index_category(array $robots) { // Check if the current post has ‘members’ category if (is_single() && has_category(‘members’)) { $robots[‘noindex’] = true; } return $robots; }Continue reading

No Index Page

// No Index Page / Kiri Vadivelu / 2026 add_filter( ‘wp_robots’, ‘no_index_page’ ); function no_index_page( $robots ) { if ( is_page() ) { $robots[‘noindex’] = true; } return $robots; }Continue reading

Open external links in new tab

document.addEventListener(“DOMContentLoaded”, function() { var links = document.querySelectorAll(“a[href]”); links.forEach(function(link) { if (link.hostname !== window.location.hostname) { link.setAttribute(“target”, “_blank”); link.setAttribute(“rel”, “noopener noreferrer”); } }); });Continue reading