Utils
Overview
The utils settings module controls whether the public mac_* utility wrappers are loaded at runtime.
This module does not change what the underlying utility classes do. It controls the supported public wrapper surface that builders use in templates, Bricks, and lightweight site code.
Current Settings
| Setting key | Default | Behavior |
|---|---|---|
utils_enabled | false | Master switch for all public utility wrappers. |
count_array_items_enabled | false | Loads mac_count_array_items(). |
format_datetime_enabled | false | Loads mac_format_datetime(). |
format_price_enabled | false | Loads mac_format_price(). |
post_type_label_enabled | false | Loads mac_get_post_type_label(). |
taxonomy_label_enabled | false | Loads mac_get_taxonomy_label(). |
post_terms_enabled | false | Loads mac_get_post_terms(). |
plugin_status_enabled | false | Loads mac_get_plugin_status(). |
theme_status_enabled | false | Loads mac_get_theme_status(). |
Loading Rules
The loading rules are intentionally simple:
- if
utils_enabledisfalse, no public util wrappers are loaded - if
utils_enabledistrue, each util still needs its own toggle enabled - when both the master toggle and the util toggle are enabled, the wrapper is registered during plugin bootstrap
Migration Note
If a site already uses mac_* util wrappers:
- enable
Enable MAC Core utils - enable the specific util wrappers that site code actually uses
If a site does not need the wrappers yet, leave them off.
Security and Scope
The Utils module is about intentional loading and a cleaner public API surface.
It is not a hard security boundary. The underlying utility classes still exist in the plugin codebase. The settings module controls the supported wrapper functions, not total class autoloading isolation.