-
Notifications
You must be signed in to change notification settings - Fork 1
Description
@hellofromtonya In the 'Reusable Meta Box Lab', Episode 15 ('Loading The Configuration Into the Store') between +11:25 - 11:40, you add return _the_store( $store_key, $config ); to the function 'loadConfigFromFilesystem' and add _the_store( $store_key, $config ); to the function 'loadConfig'. Then you inspect the return from 'loadConfigFromFilesystem' using Kint.
In Episode 23 of the same lab ('Fix the Default Merge'), in '/src/metadata/module.php' you build a function 'init_custom_fields_configuration' to merge the runtime and default configurations to remove the 'meta_key' array key in the 'custom_fields' configuration. At the end of 'init_custom_fields_configuration', you load the altered configuration back into the store by declaring 'configStore\loadConfig( $store_key, $config)'.
When 'configStore\loadConfig( $store_key, $config)' is inspected using Kint, it returns NULL. But if the API function 'loadConfig' is modified to return '_the_store' (rather than returning no value), then Kint returns the configuration from '_the_store' when 'init_custom_fields_configuration' runs 'configStore\loadConfig( $store_key, $config)'.
This is a small issue, and of little consequence in this particular lab. But if the plugin is extended and 'loadConfig' is used in other situations, on inspection one would find that the function does not return a value, when if fact it does contain data.