Kevin Davis
Member since September 2023
Completely Disable Comments
add_action('admin_init', function () { // Redirect any user trying to access comments page global $pagenow; if…
Allow SVG Files Upload
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types.…
Explicit Fixed Width and Height
add_filter( 'the_content', 'add_image_dimensions' ); function add_image_dimensions( $content ) { preg_match_all( '/]+>/i', $content, $images); if (count($images) <…
Disable Emojis
/** * Disable the emojis in WordPress. */ add_action( 'init', function () { remove_action( 'wp_head', 'print_emoji_detection_script',…
Current Year
function current_year_shortcode() { return date('Y'); } add_shortcode('year', 'current_year_shortcode');
Remove Unused JS
/** * We will Dequeue the jQuery UI script as example. * * Hooked to the…
Remove WordPress Version Number
add_filter('the_generator', '__return_empty_string');
Disable Gutenberg Editor (use Classic Editor)
add_filter('gutenberg_can_edit_post', '__return_false', 5); add_filter('use_block_editor_for_post', '__return_false', 5);
Remove Gutenberg CSS
//Remove Gutenberg Block Library CSS from loading on the frontend function smartwp_remove_wp_block_library_css(){ wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style(…
Ensure Webfont is Loaded
add_filter( 'elementor_pro/custom_fonts/font_display', function( $current_value, $font_family, $data ) { return 'swap'; }, 10, 3 );
Remove Google Fonts
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );