Astra_Social_Component_Configs::register_configuration( Array $configurations, string $builder_type = 'header', string $section = 'section-hb-social-icons-' )

Register Builder Customizer Configurations.


Description


Parameters

$configurations

(Array) (Required) Configurations.

$builder_type

(string) (Optional) Builder Type.

Default value: 'header'

$section

(string) (Optional) Section slug.

Default value: 'section-hb-social-icons-'


Return

(Array) Astra Customizer Configurations with updated configurations.


Source

File: classes/builder/type/base/configurations/class-astra-social-component-configs.php

	public static function register_configuration( $configurations, $builder_type = 'header', $section = 'section-hb-social-icons-' ) {

		$social_configs = array();

		$class_obj              = Astra_Addon_Builder_Header::get_instance();
		$number_of_social_icons = astra_addon_builder_helper()->num_of_header_social_icons;

		if ( 'footer' === $builder_type ) {
			$class_obj              = Astra_Addon_Builder_Footer::get_instance();
			$number_of_social_icons = astra_addon_builder_helper()->num_of_footer_social_icons;
		}

		for ( $index = 1; $index <= $number_of_social_icons; $index++ ) {

			$_section = $section . $index;

			$_configs = array(

				array(
					'name'       => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-stack]',
					'default'    => astra_get_option( $builder_type . '-social-' . $index . '-stack' ),
					'section'    => $_section,
					'type'       => 'control',
					'control'    => 'ast-selector',
					'title'      => __( 'Stack On', 'astra-addon' ),
					'priority'   => 3,
					'choices'    => array(
						'desktop' => __( 'Desktop', 'astra-addon' ),
						'tablet'  => __( 'Tablet', 'astra-addon' ),
						'mobile'  => __( 'Mobile', 'astra-addon' ),
						'none'    => __( 'None', 'astra-addon' ),
					),
					'transport'  => 'postMessage',
					'context'    => astra_addon_builder_helper()->general_tab,
					'renderAs'   => 'text',
					'responsive' => false,
				),
			);

			$social_configs[] = $_configs;
		}

		$social_configs = call_user_func_array( 'array_merge', $social_configs + array( array() ) );
		$configurations = array_merge( $configurations, $social_configs );

		return $configurations;
	}

Changelog

Changelog
Version Description
3.0.0 Introduced.


User Contributed Notes

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