Remove Custom Submenu

// Remove Custom Submenu / Kiri Vadivelu / 2026 add_action( ‘admin_init’, ‘remove_plugin_submenu’ ); function remove_plugin_submenu() { // Parent: options-general.php // Submenu slug: my-plugin-settings // Tools Submenus remove_submenu_page( ‘tools.php’, ‘wp-rollback’ ); // Settings Submenus remove_submenu_page( ‘options-general.php’, ‘log-emails’ ); }Continue reading

TEMP – Lumen font cleanup

/* * TEMP – Lumen font cleanup (admin-only, query-triggered) * ?lumen_font_cleanup=dry report only, changes nothing * ?lumen_font_cleanup=run&f=VALUE strip element-level font-family === VALUE (backs up first) * ?lumen_font_cleanup=restore put every backed-up meta value back * v2: also covers Bricks components and…Continue reading

Replace Missing Thumbnail

// Replace Missing Thumbnail / Kiri Vadivelu / 2026 function replace_missing_thumbnail( $html, $post_id, $post_thumbnail_id, $size, $attr ) { if ( empty( $html ) ) { // Replace with your site logo URL $logo_url = ‘https://example.com/path/to/logo.png’; $html = ‘‘; } return…Continue reading

Hide Menu Exception

// Hide Menu Exception / Kiri Vadivelu / 2026 add_action( ‘admin_menu’, ‘hide_menu_except’ ); // Visually hide but retain all functions intact function hide_menu_except() { $current_user_id = get_current_user_id(); // Only apply if the user is NOT User ID 1 if (…Continue reading

test event booking system

add_action( ’em_booking_added’, ‘childlaw_test_booking_added’, 10, 1); function childlaw_test_booking_added( $booking ) { if ( ! is_object( $booking ) ) { error_log( ‘CHILDLaw: em_booking_added fired, but booking is not an object. ‘) return; } error_log( ‘BOOKING ADDED ‘) //booking id if (isset( $booking->booking_id…Continue reading

Search Exclude Page

// Search Exclude Page / Kiri Vadivelu / 2026 add_action(‘pre_get_posts’, ‘exclude_page_search’); function exclude_page_search($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘post_type’, ‘post’); } }Continue reading

Search Exclude Tag

// Search Exclude Tag / Kiri Vadivelu / 2026 function exclude_tag_search( $query ) { if ( $query->is_search && ! is_admin() ) { $query->set( ‘tag__not_in’, array( 8, 9 ) ); // Replace with your tag IDs } return $query; } add_filter(…Continue reading

Search Exclude Category

// Search Exclude Category / Kiri Vadivelu / 2026 function exclude_categories_from_search( $query ) { if ( ! is_admin() && $query->is_search && $query->is_main_query() ) { // Replace with your negative category IDs $query->set( ‘cat’, ‘-1,-2’ ); } } add_action( ‘pre_get_posts’, ‘exclude_categories_from_search’…Continue reading

Advanced Search Filter

// Advanced Search Filter / Kiri Vadivelu / 2026 function advanced_search_filter( $query ) { // Only modify the main query on the front-end search results if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) { // Check if category_name is…Continue reading