This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Astra_Update_Footer_Builder::normalize_component_id( string $component_id )

Normalize component ID to match Astra’s expected format for footer components.


Description


Parameters

$component_id

(string) (Required) Component ID to normalize.


Return

(string) Normalized component ID.


Source

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

	private function normalize_component_id( $component_id ) {
		$component_id = sanitize_text_field( $component_id );
		$component_id = strtolower( trim( $component_id ) );

		$id_mapping = array(
			'widget'         => 'widget-1',
			'widget_1'       => 'widget-1',
			'widget_2'       => 'widget-2',
			'widget_3'       => 'widget-3',
			'widget_4'       => 'widget-4',
			'html'           => 'html-1',
			'html_1'         => 'html-1',
			'html_2'         => 'html-2',
			'html_3'         => 'html-3',
			'button'         => 'button-1',
			'btn'            => 'button-1',
			'button_1'       => 'button-1',
			'button_2'       => 'button-2',
			'btn-1'          => 'button-1',
			'btn-2'          => 'button-2',
			'social'         => 'social-icons-1',
			'social_icons'   => 'social-icons-1',
			'social-icons'   => 'social-icons-1',
			'social_icons_1' => 'social-icons-1',
			'social_1'       => 'social-icons-1',
			'social-1'       => 'social-icons-1',
			'social_icons_2' => 'social-icons-2',
			'social_2'       => 'social-icons-2',
			'social-2'       => 'social-icons-2',
			'footer_menu'    => 'menu',
			'footer-menu'    => 'menu',
			'nav'            => 'menu',
			'navigation'     => 'menu',
		);

		if ( isset( $id_mapping[ $component_id ] ) ) {
			return $id_mapping[ $component_id ];
		}

		return $component_id;
	}

User Contributed Notes

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