Changeset 10385
- Timestamp:
- 12/02/2015 07:49:54 PM (10 years ago)
- Location:
- branches/2.4/src
- Files:
-
- 3 edited
-
bp-core/admin/bp-core-admin-slugs.php (modified) (5 diffs)
-
bp-groups/bp-groups-actions.php (modified) (1 diff)
-
bp-groups/bp-groups-admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/src/bp-core/admin/bp-core-admin-slugs.php
r10229 r10385 40 40 41 41 /** 42 * Creates reusable markup for page setup on the Components and Pages dashboard panel.43 * 44 * @ package BuddyPress45 * @since 1.6.046 * @ todo Use settings API47 */ 48 function bp_core_admin_ slugs_options() {42 * Generate a list of directory pages, for use when building Components panel markup. 43 * 44 * @since 2.4.1 45 * 46 * @return array 47 */ 48 function bp_core_admin_get_directory_pages() { 49 49 $bp = buddypress(); 50 51 // Get the existing WP pages52 $existing_pages = bp_core_get_directory_page_ids();53 54 // Set up an array of components (along with component names) that have55 // directory pages.56 50 $directory_pages = array(); 57 51 … … 69 63 } 70 64 71 /** Directory Display *****************************************************/72 73 65 /** 74 66 * Filters the loaded components needing directory page association to a WordPress page. … … 78 70 * @param array $directory_pages Array of available components to set associations for. 79 71 */ 80 $directory_pages = apply_filters( 'bp_directory_pages', $directory_pages ); 72 return apply_filters( 'bp_directory_pages', $directory_pages ); 73 } 74 75 /** 76 * Generate a list of static pages, for use when building Components panel markup. 77 * 78 * By default, this list contains 'register' and 'activate'. 79 * 80 * @since 2.4.1 81 * 82 * @return array 83 */ 84 function bp_core_admin_get_static_pages() { 85 $static_pages = array( 86 'register' => __( 'Register', 'buddypress' ), 87 'activate' => __( 'Activate', 'buddypress' ), 88 ); 89 90 /** 91 * Filters the default static pages for BuddyPress setup. 92 * 93 * @since 1.6.0 94 * 95 * @param array $static_pages Array of static default static pages. 96 */ 97 return apply_filters( 'bp_static_pages', $static_pages ); 98 } 99 100 /** 101 * Creates reusable markup for page setup on the Components and Pages dashboard panel. 102 * 103 * @package BuddyPress 104 * @since 1.6.0 105 * @todo Use settings API 106 */ 107 function bp_core_admin_slugs_options() { 108 $bp = buddypress(); 109 110 // Get the existing WP pages 111 $existing_pages = bp_core_get_directory_page_ids(); 112 113 // Set up an array of components (along with component names) that have directory pages. 114 $directory_pages = bp_core_admin_get_directory_pages(); 115 116 /** Directory Display *****************************************************/ 81 117 82 118 if ( !empty( $directory_pages ) ) : ?> … … 141 177 /** Static Display ********************************************************/ 142 178 143 // Static pages 144 $static_pages = array( 145 'register' => __( 'Register', 'buddypress' ), 146 'activate' => __( 'Activate', 'buddypress' ), 147 ); 148 149 /** 150 * Filters the default static pages for BuddyPress setup. 151 * 152 * @since 1.6.0 153 * 154 * @param array $static_pages Array of static default static pages. 155 */ 156 $static_pages = apply_filters( 'bp_static_pages', $static_pages ); 179 $static_pages = bp_core_admin_get_static_pages(); 157 180 158 181 if ( !empty( $static_pages ) ) : ?> … … 226 249 // Then, update the directory pages 227 250 if ( isset( $_POST['bp_pages'] ) ) { 228 229 $directory_pages = array(); 230 251 $valid_pages = array_merge( bp_core_admin_get_directory_pages(), bp_core_admin_get_static_pages() ); 252 253 $new_directory_pages = array(); 231 254 foreach ( (array) $_POST['bp_pages'] as $key => $value ) { 232 if ( !empty( $value) ) {233 $ directory_pages[$key] = (int) $value;255 if ( isset( $valid_pages[ $key ] ) ) { 256 $new_directory_pages[ $key ] = (int) $value; 234 257 } 235 258 } 236 bp_core_update_directory_page_ids( $ directory_pages );259 bp_core_update_directory_page_ids( $new_directory_pages ); 237 260 } 238 261 -
branches/2.4/src/bp-groups/bp-groups-actions.php
r10276 r10385 210 210 foreach ( (array) $_POST['friends'] as $friend ) { 211 211 groups_invite_user( array( 212 'user_id' => $friend,212 'user_id' => (int) $friend, 213 213 'group_id' => $bp->groups->new_group_id, 214 214 ) ); -
branches/2.4/src/bp-groups/bp-groups-admin.php
r10262 r10385 313 313 // Process only those users who have had their roles changed 314 314 foreach ( (array) $_POST['bp-groups-role'] as $user_id => $new_role ) { 315 $user_id = (int) $user_id; 315 316 316 317 $existing_role = isset( $_POST['bp-groups-existing-role'][$user_id] ) ? $_POST['bp-groups-existing-role'][$user_id] : ''; 317 318 318 319 if ( $existing_role != $new_role ) { 320 $result = false; 319 321 320 322 switch ( $new_role ) {
Note: See TracChangeset
for help on using the changeset viewer.