/* 
Theme Name: WebOnMind.com - Hello Elementor Child 2.0
Theme URI: https://websiteonmind.com
Description: WebOnMind.com - Hello Elementor Child, is a child theme of Hello Elementor, created by WebOnMind
Author: WebOnMind.com
Author URI: https://websiteonmind.com
Template: hello-elementor
Version: 2.0.1
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: hello elementor child, elementor blank child theme 
Text Domain: hello-elementor
*/

/*
    Add your custom styles here
*/


/**
 * Lock user creation
 */

/* Disable registration */
add_filter('option_users_can_register', '__return_zero');


/* Block user creation before insert */
add_filter('wp_pre_insert_user_data', function ($data) {

    if (!empty($data['ID'])) {
        return $data; // allow updates
    }

    return new WP_Error(
        'user_creation_disabled',
        'User creation is disabled.'
    );

}, 1);


/* Registration fallback */
add_filter('registration_errors', function () {

    return new WP_Error(
        'registration_disabled',
        'User registration is disabled.'
    );

});