I have been trying to add a custom css file based on a condition. That's why I wanted to register that css file. But getting fatal error saying

**Fatal error: Call to undefined function register\_custom\_styles() in /home/learnenglish/public\_html/wp-content/themes/learn/functions.php on line 899**

Here is the code in the below:

```
if ( is_user_logged_in() ) {
    if (!register_custom_styles()) {
        add_action( 'wp_enqueue_scripts', 'register_custom_styles' );
        function register_plugin_styles() {
            wp_register_style( 'custom', get_stylesheet_directory_uri( '/custom.css' ) );
            wp_enqueue_style( 'custom' );
        }
    }

}

```