Last Login Column

// Please note: This snippet will only show the last login date & time AFTER the snippet is activated. // The snippet has to be active to track the last login date & time. // Add a column to the…Continue reading

Disable WordPress 6.5 Font Library

add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $editor_settings[‘fontLibraryEnabled’] = false; return $editor_settings; } ); // Disable the REST API for the font library. add_filter( ‘register_post_type_args’, function( $arg, $post_type ) { if ( ‘wp_font_family’ === $post_type || ‘wp_font_face’ === $post_type ) {…Continue reading

Override Block Editor Palette Colors

add_filter( ‘wp_theme_json_data_theme’, function ( $theme_json ) { $new_data = array( ‘settings’ => array( ‘color’ => array( ‘palette’ => array( // Replace with your desired colors. array( ‘slug’ => ‘white’, ‘color’ => ‘#ffffff’, ‘name’ => ‘White’, ), array( ‘slug’ => ‘black’,…Continue reading

Reorder Admin Menu Items

add_filter( ‘custom_menu_order’, ‘__return_true’ ); // This will move the WPCode menu under the Dashboard menu item. // Uncomment and add more items as needed. add_filter( ‘menu_order’, function () { return array( ‘index.php’, ‘wpcode’, // ‘edit.php’, // Posts // ‘upload.php’, //…Continue reading

Disable Specific Blocks

add_filter( ‘allowed_block_types_all’, function ( $allowed_block_types, $block_editor_context ) { // List here the blocks you want to disallow. https://developer.wordpress.org/block-editor/reference-guides/core-blocks/ $disallowed_blocks = array( ‘core/navigation’, ‘core/query’, ); if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) { $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); $allowed_block_types…Continue reading

Maintenance Mode

add_action( ‘init’, function() { if ( ! current_user_can( ‘manage_options’ ) && ! is_admin() && ! is_login() ) { wp_die( ‘This website is currently undergoing scheduled maintenance. Please try again later.’ ); } } );Continue reading