Payments_Tab::get_sections()

Gets an array of all the sections, based on the active Gateways.


Return

(array[])


Top ↑

Source

File: src/Tickets/Commerce/Payments_Tab.php

	public function get_sections(): array {
		$sections = [
			[
				'slug'    => '',
				'classes' => [],
				'url'     => $this->get_url(),
				'text'    => __( 'Tickets Commerce', 'event-tickets' ),
			],
		];

		$gateways = tribe( Manager::class )->get_gateways();
		$gateways = array_filter( $gateways, static function ( $gateway ) {
			return $gateway::should_show();
		} );

		foreach ( $gateways as $gateway_key => $gateway ) {
			$sections[] = [
				'classes' => [],
				'slug'    => $gateway_key,
				'url'     => $gateway::get_settings_url(),
				'text'    => $gateway::get_label(),
			];
		}

		/**
		 * Filters the sections available on the Payment Tab.
		 *
		 * @since 5.3.0
		 *
		 * @param array[] $sections Current sections.
		 */
		return (array) apply_filters( 'tec_tickets_commerce_payments_tab_sections', $sections );
	}

Top ↑

Changelog

Changelog
Version Description
5.3.0 Introduced.