', 'media="none" onload="if(media!=\'all\')media=\'all\'">', $tag); } return $tag; } add_filter('style_loader_tag', 'bny_css_async'); //Theme customizer disable some items. -------------- add_action('customize_register', 'bny_disable_customizer'); function bny_disable_customizer($wp_customize) { $wp_customize->remove_section('colors'); $wp_customize->remove_section('background_image'); $wp_customize->remove_section('header_image'); $wp_customize->remove_section('static_front_page'); } //Nav Menu custom class --------------- class bny_nav_walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth = 0, $args = array()) { $output .= ''; } } //Sidebar Widget ------------- if (!function_exists('bonyo_widgets_init')): function bonyo_widgets_init() { register_sidebar(array( 'name' => esc_html__('Sidebar', 'bonyo'), 'id' => 'sidebar-1', 'description' => esc_html__('Add widgets here.', 'bonyo'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } endif; add_action('widgets_init', 'bonyo_widgets_init'); //Search widget form --------------- function bny_search_form($form) { $form = ''; return $form; } add_filter('get_search_form', 'bny_search_form'); //Read more (excerpt) --------------- function bny_excerpt_more($excerpt) { return $excerpt. '
' . __('Read more', 'bonyo') . '
'; } add_filter('get_the_excerpt', 'bny_excerpt_more'); //Remove Action ------------- remove_action('wp_head', 'wp_generator'); //Hiding "WordPress Version" meta tag. remove_action('wp_head', 'rsd_link'); //Hiding "RSD(Really Simple Discovery)" meta tag. remove_action('wp_head', 'wlwmanifest_link'); //Hiding "Windows Live Writer link" meta tag. remove_action('wp_head', 'rest_output_link_wp_head'); //Hiding "REST API endpoint" remove_action('wp_head', 'wp_oembed_add_discovery_links'); //Hiding "oEmbed links" remove_action('wp_head', 'wp_oembed_add_host_js'); //Hiding "oEmbed JS" remove_action('wp_head', 'print_emoji_detection_script', 7); //Hiding Emoji Script remove_action('wp_print_styles', 'print_emoji_styles'); //Hiding Emoji style //Disable block editor (Gutenberg Editor) ------------ add_filter('use_block_editor_for_post', '__return_false'); //Disable rich editor ------------ //add_filter('user_can_richedit', '__return_false'); //Extra ------------- //Run css minimizing at logout function run_at_logout(){ //require_once(get_template_directory() . '/inc/extra-admin.php'); locate_template('inc/extra-admin.php', true); exec_css_minimization(); } add_action('wp_logout', 'run_at_logout'); //If you use Automattic's AMP plugin (classic mode) if (!is_admin()){ locate_template('inc/extra-amp.php', true); }