Featured Image Fetch / Load ( post_thumbnail_html )

/*Adjust Featured Image load parameters*/ function featured_image_load($html) { if ( ( !is_single() && !is_page() ) ) { return $html; } $remove = ‘alt’; $add = ‘data-spai-eager=”1″ data-skip-lazy=”1″ loading=”eager” fetchpriority=”high” alt’; $html = str_replace($remove, $add, $html); return $html; } add_filter( ‘post_thumbnail_html’,…Continue reading

Content Non-Attachment Non-Featured Image Load Attributes ( wp_content_img_tag )

add_filter( ‘wp_content_img_tag’, ‘non_featured_image_load’, 10, 3 ); function non_featured_image_load( $img_html, $context, $attachment_id ) { if ( false !== strpos( $img_html, ‘fetch-high’ ) ) { $remove = ‘alt’; $add = ‘data-skip-lazy=”1″ loading=”eager” fetchpriority=”high” alt’; $img_html = str_replace($remove, $add, $img_html); //$img_html = str_replace(…Continue reading

Disable EMOJIS

/** * Disable the emoji’s */ function disable_emojis() { 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’, ‘wp_staticize_emoji_for_email’ ); add_filter( ‘tiny_mce_plugins’,…Continue reading

Disable Automatic Updates Emails

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Completely Disable Comments

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Allow SVG Files Upload

/** * 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

MFP > Email Template

/** * Plugin Name: Email Template * Description: Styles the all emails with HTML * Version: 1.2.3 * Author: Thomas Senecal * License: GPL-2.0+ * Text Domain: email-template **/ add_filter( ‘wp_mail_content_type’, ‘eliteweblabs_set_email_content_type’ ); function eliteweblabs_set_email_content_type() { return “text/html”; } add_filter(…Continue reading

Restrict Upload File Types (reference)

add_filter(‘upload_mimes’,’restrict_mime’); function restrict_mime($mimes) { //global $current_user; //get_currentuserinfo(); // change users in list //$users = array( //”ryan”, //”steven”, //”larry”, //”jerry” //); //if (!in_array($current_user->user_login, $users)) { if ( !current_user_can( ‘manage_options’ ) ) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘webp’ => ‘image/webp’,…Continue reading