Changeset 3852 for branches/plugin/bbp-includes/bbp-forum-functions.php
- Timestamp:
- 04/17/2012 05:37:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-functions.php
r3840 r3852 803 803 if ( in_array( $forum_id, $private ) ) { 804 804 805 $offset = array_search( $forum_id, (array)$private );805 $offset = array_search( $forum_id, $private ); 806 806 807 807 // Splice around it … … 809 809 810 810 // Update private forums minus this one 811 update_option( '_bbp_private_forums', array_unique( array_ values( $private) ) );811 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) ) ) ); 812 812 } 813 813 … … 818 818 if ( in_array( $forum_id, $hidden ) ) { 819 819 820 $offset = array_search( $forum_id, (array)$hidden );820 $offset = array_search( $forum_id, $hidden ); 821 821 822 822 // Splice around it … … 824 824 825 825 // Update hidden forums minus this one 826 update_option( '_bbp_hidden_forums', array_unique( array_ values( $hidden) ) );826 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) ) ) ); 827 827 } 828 828 … … 859 859 if ( bbp_get_private_status_id() != $current_visibility ) { 860 860 861 // Remove from _bbp_hidden_forums site option 862 if ( bbp_get_hidden_status_id() == $current_visibility ) { 863 864 // Get hidden forums 865 $hidden = bbp_get_hidden_forum_ids(); 866 867 // Find this forum in the array 868 if ( in_array( $forum_id, $hidden ) ) { 869 870 $offset = array_search( $forum_id, (array) $hidden ); 871 872 // Splice around it 873 array_splice( $hidden, $offset, 1 ); 874 875 // Update hidden forums minus this one 876 update_option( '_bbp_hidden_forums', array_unique( array_values( $hidden ) ) ); 877 } 861 // Get hidden forums 862 $hidden = bbp_get_hidden_forum_ids(); 863 864 // Find this forum in the array 865 if ( in_array( $forum_id, $hidden ) ) { 866 867 $offset = array_search( $forum_id, $hidden ); 868 869 // Splice around it 870 array_splice( $hidden, $offset, 1 ); 871 872 // Update hidden forums minus this one 873 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) ) ) ); 878 874 } 879 875 … … 881 877 $private = bbp_get_private_forum_ids(); 882 878 $private[] = $forum_id; 883 update_option( '_bbp_private_forums', array_unique( array_ values( $private) ) );879 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) ) ) ); 884 880 885 881 // Update forums visibility setting … … 912 908 if ( bbp_get_hidden_status_id() != $current_visibility ) { 913 909 914 // Remove from _bbp_private_forums site option 915 if ( bbp_get_private_status_id() == $current_visibility ) { 916 917 // Get private forums 918 $private = bbp_get_private_forum_ids(); 919 920 // Find this forum in the array 921 if ( in_array( $forum_id, $private ) ) { 922 923 $offset = array_search( $forum_id, (array) $private ); 924 925 // Splice around it 926 array_splice( $private, $offset, 1 ); 927 928 // Update private forums minus this one 929 update_option( '_bbp_private_forums', array_unique( array_values( $private ) ) ); 930 } 910 // Get private forums 911 $private = bbp_get_private_forum_ids(); 912 913 // Find this forum in the array 914 if ( in_array( $forum_id, $private ) ) { 915 916 $offset = array_search( $forum_id, $private ); 917 918 // Splice around it 919 array_splice( $private, $offset, 1 ); 920 921 // Update private forums minus this one 922 update_option( '_bbp_private_forums', array_unique( array_filter( array_values( $private ) ) ) ); 931 923 } 932 924 … … 934 926 $hidden = bbp_get_hidden_forum_ids(); 935 927 $hidden[] = $forum_id; 936 update_option( '_bbp_hidden_forums', array_unique( array_ values( $hidden) ) );928 update_option( '_bbp_hidden_forums', array_unique( array_filter( array_values( $hidden ) ) ) ); 937 929 938 930 // Update forums visibility setting
Note: See TracChangeset
for help on using the changeset viewer.