Skip to main content

Utils

PropertyValue
descriptionCurrent utility-wrapper settings and loading behavior shipped by MAC Core.
tagsdoc, mac-core, setting, utils
rating

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 keyDefaultBehavior
utils_enabledfalseMaster switch for all public utility wrappers.
count_array_items_enabledfalseLoads mac_count_array_items().
format_datetime_enabledfalseLoads mac_format_datetime().
format_price_enabledfalseLoads mac_format_price().
post_type_label_enabledfalseLoads mac_get_post_type_label().
taxonomy_label_enabledfalseLoads mac_get_taxonomy_label().
post_terms_enabledfalseLoads mac_get_post_terms().
plugin_status_enabledfalseLoads mac_get_plugin_status().
theme_status_enabledfalseLoads mac_get_theme_status().

Loading Rules

The loading rules are intentionally simple:

  • if utils_enabled is false, no public util wrappers are loaded
  • if utils_enabled is true, 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.