Add version # to wp_register_style function

I think the issue here is how to read the documentation. The bold code at the top shows how the function is declared by WordPress, not how to use it.

Let’s break it down:

wp_register_style( 
    string $handle, 
    string|bool $src, 
    string[] $deps = array(), 
    string|bool|null $ver = false, 
    string $media="all" 
)

Every possible variable has it’s type in front. If more than one type is accepted, they are listed with a | between them. string[] means an array of strings. You do not have to use the parameter names when you use the function.

So if you want to use such a function, you can just pass the required values in the same order as in the declaration, and with the same type of course:

wp_register_style( 
    'darkmode', 
    get_template_directory_uri() '/darkmode.css', 
    [], 
    '3.2' // the version! 
);

Parameters with default values, like here $media="all", can be omitted completely.