Archives: Snippets
fixed header
Empty Admin Dashboard
add_action( ‘wp_dashboard_setup’, function () { global $wp_meta_boxes; $wp_meta_boxes[‘dashboard’] = array(); remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); }, 1000 );Continue reading
Disable Plugin & Theme Editor
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading
Disable WordPress Sitemaps
add_filter(‘wp_sitemaps_enabled’, ‘__return_false’);Continue reading
Disable Site Health
// Remove Tools Submenu Item for Site Health. add_action( ‘admin_menu’, function () { remove_submenu_page( ‘tools.php’, ‘site-health.php’ ); } ); // Prevent direct access to the Site Health page. add_action( ‘current_screen’, function () { $screen = get_current_screen(); if ( ‘site-health’ ===…Continue reading
Disable Lazy Load
add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );Continue reading
Dynamic Year Copyright Shortcode
// Copy the Shortcode in the Insertion box below and paste it wherever you want the copyright symbol + year to be displayed. // This will output © 2023 or the current year automatically. echo “© ” . date( ‘Y’…Continue reading
Disable IP Geo lookup service
add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_script( ‘edd-pro-checkout’ ); }, 50 );Continue reading
Download Details Featured Image
function sd_edd_download_details_widget_thumbnail( $instance ) { $download_id = isset( $instance[‘download_id’] ) ? $instance[‘download_id’] : 0; if ( ‘current’ === $instance[‘display_type’] ) { $download_id = get_the_ID(); } if ( empty( $download_id ) || ! has_post_thumbnail( $download_id ) || ‘download’ !== get_post_type( $download_id…Continue reading