Remove Header Scripts

remove_action(‘wp_head’, ‘rsd_link’); remove_action(‘wp_head’, ‘wp_generator’); remove_action(‘wp_head’, ‘feed_links’, 2); remove_action(‘wp_head’, ‘feed_links_extra’, 3); remove_action(‘wp_head’, ‘wlwmanifest_link’); remove_action(‘wp_head’, ‘adjacent_posts_rel_link’); remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0 ); remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10, 0); remove_action(‘wp_head’, ‘wp_oembed_add_discovery_links’, 10); remove_action(‘wp_head’, ‘rest_output_link_wp_head’, 10); remove_action(‘template_redirect’, ‘rest_output_link_header’, 11, 0); // Disable self-pingbacks function stop_self_ping( &$links )…Continue reading

Preload Featured Image

/** * Preload attachment image, defaults to post thumbnail */ function preload_post_thumbnail() { global $post; /** Prevent preloading for specific content types or post types */ if ( ! is_singular() ) { return; } /** Adjust image size based on…Continue reading

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

jQ-ACF-AF Scripts and Styles Dequeue

function shoutout_remove_default_styles() { // Remove default Advanced Forms styles wp_dequeue_style( ‘af-form-style’ ); // Remove default ACF styles wp_dequeue_style( ‘acf-input’ ); wp_dequeue_style( ‘acf-pro-input’ ); // Remove default ACFE styles wp_dequeue_style( ‘acf-extended’ ); wp_dequeue_style( ‘acf-extended-input’ ); wp_dequeue_style( ‘acf-extended-pro-input’ ); } add_action( ‘af/form/enqueue/key=form_64d4c0621a9c5’,…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

MFP > Dequeue ACF

acf_update_setting(‘enqueue_select2’, false); acf_update_setting(‘enqueue_datepicker’, false); acf_update_setting(‘enqueue_datetimepicker’, false); acf_update_setting(‘enqueue_google_maps’, false); add_action(‘wp_enqueue_scripts’, ‘deregister_acf_styles_95433467545’ ); function deregister_acf_styles_95433467545(){ wp_deregister_style( ‘acf’ ); wp_deregister_style( ‘acf-field-group’ ); wp_deregister_style( ‘acf-global’ ); wp_deregister_style( ‘acf-input’ ); wp_deregister_style( ‘acf-extended-input’ ); wp_deregister_style( ‘acf-datepicker’ ); wp_deregister_style( ‘acfe-input’ ); wp_deregister_style( ‘wp-block-library’ ); wp_deregister_style( ‘wp-color-picker’ );…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

Add Readonly And Disabled to ACF

add_action(‘acf/render_field_settings/type=relationship’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=url’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=number’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=select’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=taxonomy’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=text’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=email’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=textarea’, ‘add_readonly_and_disabled_to_field’); add_action(‘acf/render_field_settings/type=date_time_picker’, ‘add_readonly_and_disabled_to_field’); function add_readonly_and_disabled_to_field($field) { acf_render_field_setting($field, array( ‘label’ => __(‘Read Only?’, ‘acf’), ‘instructions’ => ”, ‘type’ => ‘radio’, ‘name’ => ‘readonly’, ‘choices’ => array(…Continue reading

Disable Gutenberg Style

/* DISABLE GUTENBERG STYLE IN HEADER| WordPress 5.9 */ function wps_deregister_styles() { // wp_dequeue_style( ‘global-styles’ ); wp_dequeue_style( ‘classic-theme-styles’ ); } add_action( ‘wp_enqueue_scripts’, ‘wps_deregister_styles’, 100 );Continue reading