<?php         
if ( ! function_exists( 'b7ectg_theme_enqueue_styles' ) ) {            
    add_action( 'wp_enqueue_scripts', 'b7ectg_theme_enqueue_styles' );
    
    function b7ectg_theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
    }
}

/* Unregistered Widgets */
if ( ! function_exists( 'b7ectg_unregister_widget' ) ) {
    add_action( 'widgets_init', 'b7ectg_unregister_widget' );
    
    function b7ectg_unregister_widget() {
    
        unregister_widget( 'ElementorPro\Modules\Library\WP_Widgets\Elementor_Library' );
    }
}

function wpb_remove_version() {
return '';
}
add_filter('the_generator', 'wpb_remove_version');

function no_wordpress_errors(){
  return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );

	
remove_filter( 'comment_text', 'make_clickable', 9 );

add_filter('xmlrpc_enabled', '__return_false');

add_filter('gutenberg_can_edit_post', '__return_false', 5);
add_filter('use_block_editor_for_post', '__return_false', 5);

add_filter( 'use_widgets_block_editor', '__return_false' );

add_filter( 'sanitize_file_name', 'mb_strtolower' );

add_filter( 'block_editor_settings_all', function ( $settings ) {
     
    $settings['codeEditingEnabled'] = current_user_can( 'manage_options' );
 
    return $settings;
} );

// Disable the Plugin and Theme Editor
if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) {
    define( 'DISALLOW_FILE_EDIT', true );
}

// 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' );

add_action(
    'admin_init',
    function () {
        remove_action( 'welcome_panel', 'wp_welcome_panel' );
    }
);

