Stop Lazy Load
add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );Continue reading
/** * We will Dequeue the jQuery UI script as example. * * Hooked to the wp_print_scripts action, with a late priority (99), * so that it is after the script was enqueued. */ function wp_remove_scripts() { // check if…Continue reading
//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( ‘wp-block-library-theme’ ); } add_action( ‘wp_enqueue_scripts’, ‘smartwp_remove_wp_block_library_css’ );Continue reading
function current_year_shortcode() { return date(‘Y’); } add_shortcode(‘year’, ‘current_year_shortcode’);Continue reading
add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’, 5);Continue reading
/** * Disable the emojis in WordPress. */ add_action( ‘init’, function () { remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); remove_filter( ‘wp_mail’,…Continue reading
add_filter(‘the_generator’, ‘__return_empty_string’);Continue reading
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
if (!function_exists(‘rk_keep_me_logged_in’)) { function rk_keep_me_logged_in($expirein) { return 31556926; // 1 year in seconds } } add_filter(‘auth_cookie_expiration’,’rk_keep_me_logged_in’);Continue reading
// Add custom Bulk Action to the Pages view function custom_add_bulk_action() { global $post_type; if ($post_type == ‘page’) { ?>Continue reading