Astra_Update_Footer_Builder::configure()

Configure the ability.


Description


Source

File: inc/abilities/customizer/footer/class-astra-update-footer-builder.php

	public function configure() {
		$this->id          = 'astra/update-footer-builder';
		$this->category    = 'astra';
		$this->label       = __( 'Update Astra Footer Builder Settings', 'astra' );
		$this->description = __( 'Updates the Astra theme footer builder configuration for desktop and mobile layouts. Allows positioning components like buttons, HTML blocks, widgets, social icons, footer menu, and copyright in above footer, primary footer, and below footer sections with column-based placements. Also configures column counts and layout widths for each footer section.', 'astra' );

		$this->meta = array(
			'tool_type'   => 'write',
			'constraints' => array(
				'dependencies' => array(
					array(
						'tool'             => 'astra/get-footer-builder',
						'description_hint' => 'Get current footer layout and available_components before updating',
					),
				),
				'usage_hints'  => array(
					'SMART_MERGE_WORKFLOW' => 'Uses SMART MERGING that auto-detects operation type. Call astra/get-footer-builder FIRST to see current layout. ADD operations (new components) append to existing. REMOVE operations (subset of current) keep only specified. CLEAR operations (empty array) remove all. NO need to manually reconstruct arrays for simple add/remove.',
					'component_ids'        => 'EXACT footer component IDs (case-sensitive, use exactly as shown): copyright, menu, widget-1, widget-2, widget-3, widget-4, social-icons-1 (NOT social-1!), social-icons-2, html-1, html-2, html-3, button-1, button-2. NEVER use shortened versions - use exact IDs from available_components.',
					'desktop_structure'    => 'Desktop has 3 sections: above (top), primary (main), below (bottom). Each section has 5 columns numbered 1-5. Column names: above_1, above_2, above_3, above_4, above_5, primary_1, primary_2, primary_3, primary_4, primary_5, below_1, below_2, below_3, below_4, below_5. The number of active columns is controlled by section_footer_columns parameters.',
					'mobile_structure'     => 'Mobile has 3 sections: above, primary, below. Each section has 2 columns. Column names: above_1, above_2, primary_1, primary_2, below_1, below_2. Mobile layout is INDEPENDENT from desktop - components must be explicitly placed for mobile.',
					'column_visibility'    => 'Active columns determined by: above_footer_columns (1-5), primary_footer_columns (1-5), below_footer_columns (1-5). Example: If primary_footer_columns=3, only primary_1, primary_2, primary_3 display on desktop. primary_4 and primary_5 are hidden. Set column count based on how many components you want to display horizontally.',
					'adding_components'    => 'To ADD a component: Just send the new component(s), they will be APPENDED to existing. Example: To add menu to below_1 (currently has ["copyright"]): {"desktop": {"below": {"below_1": ["menu"]}}} → Result: ["copyright", "menu"]. NO need to include existing components. Smart merge detects new items and appends them.',
					'removing_components'  => 'To REMOVE a specific component: Call get-footer-builder first, then send column with ONLY the components to KEEP (exclude ones to remove). Example: To remove widget-2 from primary_1 (currently has ["widget-1", "widget-2", "widget-3"]): {"desktop": {"primary": {"primary_1": ["widget-1", "widget-3"]}}}. Smart merge detects subset and removes missing items. To clear entire column: send empty array [].',
					'moving_components'    => 'To MOVE a component: Specify BOTH source and destination. Example: To move copyright from primary_1 to below_1 (primary_1 currently has ["copyright", "menu"]): {"desktop": {"primary": {"primary_1": ["menu"]}, "below": {"below_1": ["copyright"]}}}. Source gets remaining items (remove operation), destination gets new item (add operation).',
					'multiple_operations'  => 'Multiple operations in one update: Combine all changes. Example: Add menu to below_1 AND add widget-1 to primary_2: {"desktop": {"below": {"below_1": ["menu"]}, "primary": {"primary_2": ["widget-1"]}}}. Each will append to existing contents. To add to one column and remove from another: combine appropriately.',
					'column_arrays'        => 'Each column value is an ARRAY of component IDs. Single: ["copyright"]. Multiple: ["copyright", "menu"]. Empty: []. Smart merge behavior: NEW items (not in current) → APPEND. SUBSET of current → REMOVE (keep only specified). SAME → no change. Empty → CLEAR. Components stack vertically in column.',
					'layout_widths'        => 'Control section width: above_footer_layout, primary_footer_layout, below_footer_layout. Values: "full" (edge-to-edge) or "content" (boxed). Example: Full-width footer: set all to "full". Boxed footer: set all to "content". Mix: primary="full", below="content".',
					'common_mistakes'      => 'AVOID: 1) Using "social-1" instead of "social-icons-1" (wrong ID), 2) Sending duplicate items when adding (smart merge handles this), 3) Using column names incorrectly (e.g., "primary-1" instead of "primary_1"), 4) Not checking current layout before removing (might remove wrong items).',
					'typical_layouts'      => 'Common footer layouts: 1) 1-column: Copyright centered in below_1 (set below_footer_columns=1), 2) 3-column: Copyright in primary_1, Menu in primary_2, Social in primary_3 (set primary_footer_columns=3), 3) 4-column: Widget-1/2/3/4 in primary_1/2/3/4 (set primary_footer_columns=4), 4) Multi-row: Widgets in above (4-5 columns), Copyright in below (1 column).',
					'responsive_design'    => 'Desktop and mobile are INDEPENDENT. A component in desktop primary_1 does NOT automatically appear in mobile. Must explicitly configure both. Typical: Desktop 4-column footer, mobile 2-column footer. Configure both desktop and mobile layouts in same update or separately.',
				),
			),
		);
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.