Skip to main content

Utils

PropertyValue
descriptionReusable helper surface shipped by MAC Core.
tagsindex, doc, mac-core, utility
rating

Overview

The Utils layer is the reusable helper surface of MAC Core.

These utilities exist for behavior that is:

  • shared across multiple builds
  • simple enough to expose to builders
  • worth testing and documenting once

Project-specific output rules should still live in a child theme or site plugin unless they clearly belong in shared MAC Core.

Current Utility Groups

GroupPrimary APIs
Datetime formattingmac_format_datetime()
Post type labelsmac_get_post_type_label(), mac_get_post_type_singular(), mac_get_post_type_plural()
Taxonomy labelsmac_get_taxonomy_label(), mac_get_taxonomy_singular(), mac_get_taxonomy_plural()
Post termsmac_get_post_terms(), mac_get_post_terms_html(), mac_get_post_terms_plain()
Array countingmac_count_array_items()
Plugin statusMacCore\Utils\GetPluginStatus::*
Theme statusMacCore\Utils\GetThemeStatus::*

Wrapper Conventions

Most builder-friendly helpers expose global mac_* wrapper functions.

Exception:

  • plugin status helpers are class-based
  • theme status helpers are class-based

Those two utility families currently do not expose global wrapper functions.

Pages in This Section