Connections::active()

Summary

No summary available.

Return

(WP_Term[])


Source

File: src/BigCommerce/Taxonomies/Channel/Connections.php

	public function active() {
		if ( ! Channel::multichannel_enabled() ) {
			try {
				return [ $this->primary() ];
			} catch ( Channel_Not_Found_Exception $e ) {
				return [];
			}
		}

		$args = [
			'taxonomy'   => Channel::NAME,
			'meta_query' => [
				[
					'key'     => Channel::STATUS,
					'value'   => [ Channel::STATUS_PRIMARY, Channel::STATUS_CONNECTED ],
					'compare' => 'IN',
				],
			],
			'hide_empty' => false,
			'orderby'    => 'name',
		];

		$terms = get_terms( $args );

		if ( ! is_array( $terms ) ) {
			return [];
		}

		return $terms;
	}


User Contributed Notes

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