A_Z_Listing::index_reduce( array $carry, array $value )

Reducer used by get_the_item_indices() to filter the indices for each post to unique array_values (see: https://secure.php.net/array_reduce)




(array) (Required) Holds the return value of the previous iteration.


(array) (Required) Holds the value of the current iteration.


(array) The previous iteration return value with the current iteration added after running through array_unique()


File: classes/class-a-z-listing.php

	public function index_reduce( $carry, $value ) {
		$v = array_unique( $value );
		if ( ! empty( $v ) ) {
			$carry[] = $v;
		return $carry;

User Contributed Notes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.