Closed gin0115 closed 3 years ago
example of the current process for none set values.
IDEALLY these should be set, but you cant be certain unless its a custom config class for the plugin or theme. The drawback to magic methods!!!!!
register_nav_menus(
[
( $this->config->additional( 'main_nav' ) ?? 'main' ) => $this->translations->global()->primary_nav_label()
]
);
It would be nice to have a default/fallback if a value is not set.
This could either be
$config->additional('key', 'The key wasnt set');
or with a custom method
$config->maybe_additional('key', 'The key wasnt set');