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)


Description


Parameters

$carry

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

$value

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


Return

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


Source

File: partials/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

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

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