Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/04/2017 09:34:59 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Tools: Introduce bbp_get_unique_array_values() helper function.

Use this when parsing private/hidden forum IDs for saving.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/functions.php

    r6445 r6481  
    123123
    124124/** Misc **********************************************************************/
     125
     126/**
     127 * Return the unique non-empty values of an array.
     128 *
     129 * @since 2.6.0 bbPress (r6481)
     130 *
     131 * @param array $array Array to get values of
     132 *
     133 * @return array
     134 */
     135function bbp_get_unique_array_values( $array = array() ) {
     136        return array_unique( array_filter( array_values( $array ) ) );
     137}
    125138
    126139/**
Note: See TracChangeset for help on using the changeset viewer.