Changeset 6481
- Timestamp:
- 06/04/2017 09:34:59 PM (9 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 2 edited
-
common/functions.php (modified) (1 diff)
-
forums/functions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r6445 r6481 123 123 124 124 /** 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 */ 135 function bbp_get_unique_array_values( $array = array() ) { 136 return array_unique( array_filter( array_values( $array ) ) ); 137 } 125 138 126 139 /** -
trunk/src/includes/forums/functions.php
r6480 r6481 871 871 872 872 // Update private forums minus this one 873 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) )) );873 update_option( '_bbp_private_forums', bbp_get_unique_array_values( $private ) ); 874 874 } 875 875 … … 886 886 887 887 // Update hidden forums minus this one 888 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) )) );888 update_option( '_bbp_hidden_forums', bbp_get_unique_array_values( $hidden ) ); 889 889 } 890 890 … … 932 932 933 933 // Update hidden forums minus this one 934 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) )) );934 update_option( '_bbp_hidden_forums', bbp_get_unique_array_values( $hidden ) ); 935 935 } 936 936 … … 938 938 $private = bbp_get_private_forum_ids(); 939 939 $private[] = $forum_id; 940 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) )) );940 update_option( '_bbp_private_forums', bbp_get_unique_array_values( $private ) ); 941 941 942 942 // Update forums visibility setting … … 982 982 983 983 // Update private forums minus this one 984 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) )) );984 update_option( '_bbp_private_forums', bbp_get_unique_array_values( $private ) ); 985 985 } 986 986 … … 988 988 $hidden = bbp_get_hidden_forum_ids(); 989 989 $hidden[] = $forum_id; 990 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) )) );990 update_option( '_bbp_hidden_forums', bbp_get_unique_array_values( $hidden ) ); 991 991 992 992 // Update forums visibility setting
Note: See TracChangeset
for help on using the changeset viewer.