Astra_Get_Header_Builder::configure()
Configure the ability.
Description
Return
(void)
Source
File: inc/abilities/customizer/header/class-astra-get-header-builder.php
public function configure() {
$this->id = 'astra/get-header-builder';
$this->label = __( 'Get Astra Header Builder Settings', 'astra' );
$this->description = __( 'Retrieves the current Astra theme header builder configuration including desktop and mobile layouts with components like buttons, HTML blocks, menus, widgets, social icons, and search positioned in above header, primary header, and below header sections.', 'astra' );
$this->category = 'astra';
$this->meta = array(
'tool_type' => 'read',
'constraints' => array(
'usage_hints' => array(
'return_structure' => 'Returns desktop, mobile, mobile_popup, and available_components. Desktop/mobile contain nested objects: section > zone > array of component IDs. Example: desktop.primary.primary_left = ["logo"], desktop.primary.primary_right = ["menu-1", "search"]. Use this structure to understand current layout before making changes with update-header-builder.',
'available_components' => 'CRITICAL: This map contains exact component IDs you MUST use. Keys are component IDs (use these in updates), values are display names (for reference only). Example: "social-icons-1" is the ID (use this), "Social Icons 1" is the name (display only). NEVER use display names or shortened versions - always use exact ID keys. Common mistake: using "social-1" instead of "social-icons-1".',
'desktop_layout' => 'Desktop structure: { popup: { popup_content: [] }, above: { above_left: [], above_left_center: [], above_center: [], above_right_center: [], above_right: [] }, primary: { primary_left: [], primary_left_center: [], primary_center: [], primary_right_center: [], primary_right: [] }, below: { below_left: [], below_left_center: [], below_center: [], below_right_center: [], below_right: [] } }. Each array contains component IDs currently placed in that zone.',
'mobile_layout' => 'Mobile structure: { popup: { popup_content: [] }, above: { above_left: [], above_center: [], above_right: [] }, primary: { primary_left: [], primary_center: [], primary_right: [] }, below: { below_left: [], below_center: [], below_right: [] } }. Mobile zones are independent of desktop - a component in desktop primary_right does NOT automatically appear in mobile.',
'finding_components' => 'To find where a component is currently located: Search through desktop and mobile zone arrays. Example: If menu-1 is in desktop.primary.primary_right, that array will contain "menu-1". To move it, you must remove it from desktop.primary.primary_right (set to []) and add to new zone. Always check current location before moving.',
'zone_naming' => 'Zone names follow pattern: section_position. Sections: above, primary, below, popup. Desktop positions: left, left_center, center, right_center, right. Mobile positions: left, center, right. Popup position: popup_content. Examples: above_left, primary_center, below_right_center, popup_content. Use underscore, not hyphen.',
'interpreting_results' => 'When you get results: 1) Check available_components for exact IDs, 2) Examine desktop layout to see current desktop placement, 3) Examine mobile layout to see current mobile placement (may differ from desktop), 4) Check popup_content in mobile for drawer menu items, 5) Use this info to determine what zones to update for desired changes.',
'common_patterns' => 'Standard desktop: logo in primary_left, menu-1 in primary_right. Standard mobile: logo in primary_left, mobile-trigger in primary_right, mobile-menu in popup.popup_content. Multi-component zones: primary_right often has ["menu-1", "search", "button-1"]. Empty zones have []. Popup on desktop typically has ["mobile-menu"] for responsive behavior.',
'mobile_popup_note' => 'The mobile_popup return value is DEPRECATED but still returned for compatibility. The actual mobile popup content is in mobile.popup.popup_content. When updating, use mobile.popup structure, NOT separate mobile_popup parameter. Both return the same data, but updates should target mobile.popup.',
'usage_workflow' => 'Typical workflow: 1) Call this tool to get current state, 2) Note exact component IDs from available_components, 3) Find current placement of components you want to move, 4) Plan changes (what zones to empty, what zones to populate), 5) Call update-header-builder with changes. For moving: specify old zone as [] and new zone with component ID.',
),
),
);
}
Expand full source code Collapse full source code View on Trac