updated functions with removal of new header scripts, some file clean up,

more requried.
This commit is contained in:
Jacob Haddon 2022-07-02 08:35:09 -04:00
parent 0d83ea38a6
commit 933cf3376b

View File

@ -13,29 +13,51 @@ add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_style' );
function register_my_menus() { function register_my_menus() {
register_nav_menus( register_nav_menus(
array( array(
'header-menu' => __( 'Header Menu' ), 'header-menu' => __( 'Header Menu' ),
'extra-menu' => __( 'Extra Menu' ) 'extra-menu' => __( 'Extra Menu' )
) )
); );
} } // register_my_menus
add_action( 'init', 'register_my_menus' ); add_action( 'init', 'register_my_menus' );
add_action( 'wp_enqueue_scripts', 'remove_actions_parent_theme'); // remove unused word press features from header
function remove_actions_parent_theme() { function remove_actions_parent_theme() {
remove_action('wp_head', 'rsd_link'); // remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator'); // remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'feed_links', 2); // remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link'); // remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link'); // remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links_extra', 3); // remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' ); wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'wc-block-style' ); wp_dequeue_style( 'wc-block-style' );
} # remove_actions_parent_theme wp_dequeue_style( 'global-styles' );
remove_action( 'wp_head', '_wp_render_title_tag', 1);
// remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );
remove_action( 'wp_head', 'wp_resource_hints', 2);
remove_action( 'wp_head', 'feed_links', 2);
remove_action( 'wp_head', 'feed_links_extra', 3);
remove_action( 'wp_head', 'rsd_link');
remove_action( 'wp_head', 'wlwmanifest_link');
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action( 'wp_head', 'locale_stylesheet');
remove_action( 'wp_head', 'noindex', 1);
remove_action( 'wp_head', 'print_emoji_detection_script', 7);
//remove_action( 'wp_head', 'wp_print_styles', 8 );
remove_action( 'wp_head', 'wp_print_head_scripts', 9);
remove_action( 'wp_head', 'wp_generator');
remove_action( 'wp_head', 'rel_canonical');
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action( 'wp_head', 'wp_custom_css_cb', 101);
remove_action( 'wp_head', 'wp_site_icon', 99);
} // remove_actions_parent_theme
add_action( 'wp_enqueue_scripts', 'remove_actions_parent_theme');
function disable_emojis() { function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
@ -47,7 +69,7 @@ function disable_emojis() {
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 ); add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
} } // disable_emojis
add_action( 'init', 'disable_emojis' ); add_action( 'init', 'disable_emojis' );
?> ?>