WC_Shortcode_Products::set_ids_query_args( array $query_args )

Set ids query args.


Description Description


Parameters Parameters

$query_args

(Required) Query args.


Top ↑

Source Source

File: includes/shortcodes/class-wc-shortcode-products.php

	protected function set_ids_query_args( &$query_args ) {
		if ( ! empty( $this->attributes['ids'] ) ) {
			$ids = array_map( 'trim', explode( ',', $this->attributes['ids'] ) );

			if ( 1 === count( $ids ) ) {
				$query_args['p'] = $ids[0];
			} else {
				$query_args['post__in'] = $ids;
			}
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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