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_Migrate_Header_Components::normalize_component_id( string $component_id )
Normalize component ID to match Astra’s expected format.
Description
Parameters
- $component_id
-
(string) (Required) Component ID to normalize.
Return
(string) Normalized component ID.
Source
File: inc/abilities/customizer/header/class-astra-migrate-header-components.php
private function normalize_component_id( $component_id ) {
$component_id = sanitize_text_field( $component_id );
$id_mapping = array(
// Menu variations.
'menu_primary' => 'menu-1',
'primary_menu' => 'menu-1',
'primary-menu' => 'menu-1',
'menu_1' => 'menu-1',
'menu_secondary' => 'menu-2',
'secondary_menu' => 'menu-2',
'secondary-menu' => 'menu-2',
'menu_2' => 'menu-2',
// Social icons variations.
'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',
// Button variations.
'button_1' => 'button-1',
'button_2' => 'button-2',
'button_3' => 'button-3',
// HTML variations.
'html_1' => 'html-1',
'html_2' => 'html-2',
'html_3' => 'html-3',
// Widget variations.
'widget_1' => 'widget-1',
'widget_2' => 'widget-2',
'widget_3' => 'widget-3',
// Mobile variations.
'mobile_menu' => 'mobile-menu',
'mobile_trigger' => 'mobile-trigger',
// WooCommerce variations.
'woo_cart' => 'woo-cart',
'woocommerce_cart' => 'woo-cart',
// EDD variations.
'edd_cart' => 'edd-cart',
// Other variations.
'language_switcher' => 'language-switcher',
);
if ( isset( $id_mapping[ $component_id ] ) ) {
return $id_mapping[ $component_id ];
}
return $component_id;
}
Expand full source code Collapse full source code View on Trac