All features
Cherry Blossom feature
Theme options: Page General
Handles the General options page registration, field translation, native
Handles the General options page registration, field translation, native
Site Icon synchronization, and company shortcode management.
Capabilities and extension points
Handles the General options page registration, field translation, native
Site Icon synchronization, and company shortcode management.
- see Options_Page
Registers hooks for the General options page.
Synchronizes the Theme Options favicon to WordPress's native Site Icon.
- param mixed $value Favicon field value.
- param string $post_id ACF post ID.
- param array $field ACF field definition.
- return mixed Unmodified field value.
Registers option sub-pages for the General section.
Translates ACF field labels for the General options group.
- param array $field ACF field configuration array.
- return array Field configuration with translated label.
Registers the Google Fonts catalogue as an ACF choices preset.
- param \Cherry\Blossom\Plugins\Advanced_Custom_Fields\Presets $presets Preset registry.
Resolves an ACF image value to its attachment ID.
- param mixed $image Attachment ID, ACF image array (ID or id), or attachment URL.
- return int Attachment ID, or zero.
Gets a configured fallback image attachment ID.
- param string $type hero, posts, or youtube.
- return int Attachment ID, or zero.
Filters a configured fallback image attachment ID.
- param int $image_id Attachment ID.
- param string $type Fallback type.
Returns an explicit image when supplied, otherwise a configured fallback.
- param string $type Fallback type.
- param mixed $image_id Explicit image value.
- return int Attachment ID, or zero.
Gets Google Fonts choices with an offline-safe curated fallback.
- return array Font family labels keyed by saved choice value.
Filters the fonts available in Theme Options.
- param array $fonts Font choices.
Gets the family name for a saved Google Fonts choice.
- param string $value Saved choice.
- return string Syntactically safe family name, or an empty string.
Gets validated visual values with SCSS defaults as fallbacks.
- return array { Validated CSS values for compiler consumers.
- type string $color_primary Hex color; defaults to #492034.
- type string $color_secondary Hex color; defaults to #1d484a.
- type string $color_body Hex color; defaults to #000000.
- type string $font_heading CSS font stack with a fallback family.
- type string $font_body CSS font stack with a fallback family. }
Gets additional colours keyed by collision-safe Sass map names.
- return array Valid hexadecimal colors keyed by unique sanitized labels.
Gets validated login-screen settings.
- return array { Presentation values consumed by the login compiler and renderer.
- type string $type default, cherry, hsv or custom.
- type string $logo_url Image URL, or an empty string.
- type string $logo_position CSS background position.
- type string $background_url Image URL, or an empty string.
- type string $background_position CSS background position.
- type string $background_size contain, cover or 100% 100%.
- type string $color_call_to_action Validated hexadecimal color.
- type string $color_call_to_action_text Contrasting black or white.
- type string $color_background Validated hexadecimal color. }
Selects black or white text with the stronger WCAG contrast.
- param string $color Valid hexadecimal background colour.
- return string Contrasting hexadecimal text colour.
Gets the maintained Google Fonts fallback catalogue.
- return array Curated font choices.
Gets and caches the Google Fonts API catalogue.
- param string $api_key Google Fonts API key.
- return array API font choices.
Gets an attachment URL from an ACF image value.
- param mixed $image Attachment ID, ACF image array (ID or id), or attachment URL.
- return string Image URL.
Gets a CSS position, including legacy top/bottom horizontal values.
- param array $settings Image settings.
- return string CSS position.
Returns layout definitions for company flexible content.
- return array Keyed by layout name; each entry has 'prefix' and 'shortcode' template.
Assigns shortcode IDs to new company flexible content rows on save.
Runs after ACF saves post data (priority 99). Scans all existing rows to find the highest number used per layout type, then assigns fresh IDs to empty, invalid, or duplicate shortcode IDs.
- param mixed $post_id ACF post ID.
Registers the General options page script via the enqueue filter.
- param array $enqueues Enqueue data array from get_core_enqueues().
- return array Modified enqueue data array.
Gets localization data for the General options page script.
- return array { Values exposed as blossom_options_general for the ACF page controller.
- type string $shortcode_id_warning Escaped warning text.
- type array $layouts Layout keys mapped to prefix and shortcode.
- type array $shortcodes Next counter per layout. }
Source reference
This editable reference page is based on the PHP documentation in options/class-page-general.php.