Astra_Builder_Helper::get_component_count()

Get count of all components.


Description


Return

(int) Number of all components.


Source

File: inc/core/builder/class-astra-builder-helper.php

	public static function get_component_count() {

		$component_keys_count = array(
			'header-button'       => 2,
			'footer-button'       => 2,
			'header-html'         => 2,
			'footer-html'         => 2,
			'header-menu'         => 2,
			'header-widget'       => 4,
			'footer-widget'       => 4,
			'header-social-icons' => 1,
			'footer-social-icons' => 1,
			'header-divider'      => 0,
			'footer-divider'      => 0,
			'removed-items'       => array(),
		);

		$component_keys_count = array_merge(
			$component_keys_count,
			apply_filters(
				'astra_builder_elements_count',
				$component_keys_count
			)
		);

		$skip_it_keys = array( 'removed-items', 'flag' );
		foreach ( $component_keys_count as $component_type => $component_count ) {
			if ( in_array( $component_type, $skip_it_keys, true ) ) {
				continue;
			}
			$component_keys_count[ $component_type ] = min( $component_count, self::$component_limit );
		}

		return $component_keys_count;
	}

Changelog

Changelog
Version Description
3.0.0 Introduced.


User Contributed Notes

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