2020-03-19 19:10:38 -04:00
|
|
|
<?php
|
2024-02-18 15:05:34 -05:00
|
|
|
// MFWPT - functions.php
|
2018-11-13 21:43:08 -05:00
|
|
|
|
|
|
|
|
2024-02-18 15:05:34 -05:00
|
|
|
// to do: clean this up
|
2019-11-12 19:01:18 -05:00
|
|
|
|
2018-11-16 09:39:34 -05:00
|
|
|
function mytheme_enqueue_style() {
|
2020-11-20 13:22:33 -05:00
|
|
|
wp_enqueue_style( 'style', get_stylesheet_uri() );
|
2018-11-16 09:39:34 -05:00
|
|
|
}
|
|
|
|
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_style' );
|
2018-11-13 21:43:08 -05:00
|
|
|
|
2020-03-19 19:10:38 -04:00
|
|
|
//set up the menus
|
2019-11-12 19:01:18 -05:00
|
|
|
|
2018-11-16 12:42:23 -05:00
|
|
|
function register_my_menus() {
|
|
|
|
register_nav_menus(
|
2022-07-02 08:35:09 -04:00
|
|
|
array(
|
|
|
|
'header-menu' => __( 'Header Menu' ),
|
|
|
|
'extra-menu' => __( 'Extra Menu' )
|
|
|
|
)
|
|
|
|
);
|
|
|
|
} // register_my_menus
|
2020-11-20 13:22:33 -05:00
|
|
|
add_action( 'init', 'register_my_menus' );
|
2022-07-02 08:35:09 -04:00
|
|
|
|
|
|
|
// remove unused word press features from header
|
|
|
|
|
2024-02-18 15:05:34 -05:00
|
|
|
function remove_actions_from_theme() {
|
|
|
|
// this removes a lot of the extras added in to <HEAD>
|
|
|
|
// it also probably breaks a lot of things
|
|
|
|
|
2022-07-02 08:35:09 -04:00
|
|
|
// remove_action('wp_head', 'rsd_link');
|
|
|
|
// remove_action('wp_head', 'wp_generator');
|
|
|
|
// remove_action('wp_head', 'feed_links', 2);
|
|
|
|
// remove_action('wp_head', 'index_rel_link');
|
|
|
|
// remove_action('wp_head', 'wlwmanifest_link');
|
|
|
|
// remove_action('wp_head', 'feed_links_extra', 3);
|
|
|
|
// remove_action('wp_head', 'start_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);
|
2020-11-20 13:22:33 -05:00
|
|
|
wp_dequeue_style( 'wp-block-library' );
|
|
|
|
wp_dequeue_style( 'wp-block-library-theme' );
|
|
|
|
wp_dequeue_style( 'wc-block-style' );
|
2022-07-02 08:35:09 -04:00
|
|
|
wp_dequeue_style( 'global-styles' );
|
2024-02-17 16:26:18 -05:00
|
|
|
wp_dequeue_style( 'classic-theme-styles' );
|
2024-02-18 15:05:34 -05:00
|
|
|
wp_dequeue_style('core-block-supports');
|
2022-07-02 08:35:09 -04:00
|
|
|
|
|
|
|
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);
|
2024-02-18 15:05:34 -05:00
|
|
|
remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
|
|
|
|
remove_action( 'wp_footer', 'wp_enqueue_global_styles', 1 );
|
|
|
|
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
|
2022-07-02 08:35:09 -04:00
|
|
|
} // remove_actions_parent_theme
|
2024-02-18 15:05:34 -05:00
|
|
|
add_action( 'wp_enqueue_scripts', 'remove_actions_from_theme');
|
2020-11-20 13:22:33 -05:00
|
|
|
|
|
|
|
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', 'disable_emojis_tinymce' );
|
|
|
|
add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
|
2022-07-02 08:35:09 -04:00
|
|
|
} // disable_emojis
|
2020-11-20 13:22:33 -05:00
|
|
|
add_action( 'init', 'disable_emojis' );
|
2018-11-16 12:42:23 -05:00
|
|
|
|
2024-02-18 15:05:34 -05:00
|
|
|
add_action('wp_footer', function () {
|
|
|
|
wp_dequeue_style('core-block-supports');
|
|
|
|
});
|
|
|
|
|
2020-03-19 19:10:38 -04:00
|
|
|
?>
|