Remove Sensitive Setting

// Remove Sensitive Setting / Kiri Vadivelu / 2026 add_action( ‘admin_init’, ‘remove_sensitive_setting’ ); function remove_sensitive_setting() { global $user_ID; if ( $user_ID != 1 ) { // Primary Menus remove_menu_page( ‘options-general.php’ ); // Settings // Secondary Menus remove_submenu_page( ‘themes.php’, ‘site-editor.php’ );…Continue reading

Remove Screen Options

// Remove Screen Options / Kiri Vadivelu / 2026 function remove_screen_options() { // Check if user has ‘manage_options’ (Admin) OR ‘edit_others_posts’ (Editor) if ( current_user_can( ‘manage_options’ ) || current_user_can( ‘edit_others_posts’ ) ) { return true; // Show Screen Options }…Continue reading

Publish Future Post

// Publish Future Post / Kiri Vadivelu / 2026 function publish_future_type( $post_data ) { if ( $post_data[‘post_status’] == ‘future’ && $post_data[‘post_type’] == ‘post’ ) { $post_data[‘post_status’] = ‘publish’; } return $post_data; } add_filter(‘wp_insert_post_data’, ‘publish_future_type’); // Remove the automatic future hook…Continue reading

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

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

Extend Core CSS

/* Extend Core CSS / Kiri Vadivelu / 2026 */ /* Select text, edit as HTML and add span with class */ .visually-muted { color: #A9A9A9; // standard muted gray } .visually-color { font-weight: bold; color: green; // theme or…Continue reading