Changes between Initial Version and Version 1 of Ticket #53807, comment 7
- Timestamp:
- 08/02/2021 01:42:47 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #53807, comment 7
initial v1 3 3 > Perhaps the function get_theme_mod() could have an option for the default value argument, which instructs get_theme_mod() to fetch its default value from its customizer setting at the time the function is run. 4 4 5 This is an interesting thought, but since Customizer settings should be created on the `customize_register` action, and `customize_register` fires only in the Customizer, it seems like the settings would not exist to be referenced for default svalues in other contexts like requests to the frontend. Additionally, it would be difficult to extend such a feature to Customizer settings created within the JavaScript API.5 This is an interesting thought, but since Customizer settings should be created on the `customize_register` action, and `customize_register` fires only in the Customizer, it seems like the settings would not exist to be referenced for default values in other contexts like requests to the frontend. Additionally, it would be difficult to extend such a feature to Customizer settings created within the JavaScript API. 6 6 7 7 As suggested in comment:1, the need here seems to be in the direction of an independent function in the theme that can supply defaults to both the Customize and settings APIs, plus any other APIs that come along later.