Changeset 13886
- Timestamp:
- 06/01/2024 07:41:30 PM (3 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-optouts.php
r13818 r13886 20 20 * @since 8.0.0 21 21 * 22 * @global $bp_optouts_list_table 22 * @global $bp_optouts_list_table BP_Optouts_List_Table List table instance for nonmember opt-outs admin page. 23 23 */ 24 24 function bp_core_optouts_admin_load() { … … 26 26 27 27 // Build redirection URL. 28 $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] ); 29 $doaction = bp_admin_list_table_current_bulk_action(); 28 $redirect_to = remove_query_arg( 29 array( 30 'action', 31 'error', 32 'updated', 33 'activated', 34 'notactivated', 35 'deleted', 36 'notdeleted', 37 'resent', 38 'notresent', 39 'do_delete', 40 'do_resend', 41 'do_activate', 42 '_wpnonce', 43 'signup_ids', 44 ), 45 $_SERVER['REQUEST_URI'] 46 ); 47 48 $doaction = bp_admin_list_table_current_bulk_action(); 30 49 31 50 /** … … 46 65 * @param array $value Array of allowed actions to use. 47 66 */ 48 $allowed_actions = apply_filters( 'bp_optouts_admin_allowed_actions', array( 'do_delete', 49 50 if ( ! in_array( $doaction, $allowed_actions ) || ( -1== $doaction ) ) {51 52 require_once ( ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php' );67 $allowed_actions = apply_filters( 'bp_optouts_admin_allowed_actions', array( 'do_delete', 'do_resend' ) ); 68 69 if ( ! in_array( $doaction, $allowed_actions, true ) || ( -1 === $doaction ) ) { 70 71 require_once ABSPATH . 'wp-admin/includes/class-wp-users-list-table.php'; 53 72 $bp_optouts_list_table = new BP_Optouts_List_Table(); 54 73 … … 101 120 102 121 } else { 103 if ( empty( $_REQUEST['optout_ids' 122 if ( empty( $_REQUEST['optout_ids'] ) ) { 104 123 return; 105 124 } 106 $optout_ids = wp_parse_id_list( $_REQUEST['optout_ids' 125 $optout_ids = wp_parse_id_list( $_REQUEST['optout_ids'] ); 107 126 108 127 // Handle optout deletion. 109 if ( 'do_delete' == $doaction ) {128 if ( 'do_delete' === $doaction ) { 110 129 111 130 // Nonce check. … … 115 134 foreach ( $optout_ids as $optout_id ) { 116 135 if ( bp_delete_optout_by_id( $optout_id ) ) { 117 $success++;136 ++$success; 118 137 } 119 138 } … … 134 153 bp_core_redirect( $redirect_to ); 135 154 136 // Plugins can update other stuff from here.155 // Plugins can update other stuff from here. 137 156 } else { 138 157 … … 153 172 } 154 173 } 155 add_action( "load-tools_page_bp-optouts", 'bp_core_optouts_admin_load' );174 add_action( 'load-tools_page_bp-optouts', 'bp_core_optouts_admin_load' ); 156 175 157 176 /** … … 171 190 $notice = array( 172 191 'class' => 'updated', 173 'message' => '' 192 'message' => '', 174 193 ); 175 194 … … 177 196 $deleted = absint( $_REQUEST['deleted'] ); 178 197 $notice['message'] .= sprintf( 198 /* translators: %s: number of deleted optouts */ 179 199 _nx( 180 /* translators: %s: number of deleted optouts */181 '%s opt-out successfully deleted!', '%s opt-outs successfully deleted!',200 '%s opt-out successfully deleted!', 201 '%s opt-outs successfully deleted!', 182 202 $deleted, 183 203 'nonmembers opt-out deleted', … … 191 211 $notdeleted = absint( $_REQUEST['notdeleted'] ); 192 212 $notice['message'] .= sprintf( 213 /* translators: %s: number of optouts that failed to be deleted */ 193 214 _nx( 194 /* translators: %s: number of optouts that failed to be deleted */195 '%s opt-out was not deleted.', '%s opt-outs were not deleted.',215 '%s opt-out was not deleted.', 216 '%s opt-outs were not deleted.', 196 217 $notdeleted, 197 218 'nonmembers opt-out not deleted', … … 241 262 <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible"> 242 263 243 <?php else : ?>264 <?php else : ?> 244 265 245 266 <div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible"> … … 250 271 </div> 251 272 252 <?php endif; 273 <?php 274 endif; 253 275 254 276 // Show the proper screen. 255 277 switch ( $doaction ) { 256 case 'delete' 278 case 'delete': 257 279 bp_core_optouts_admin_manage( $doaction ); 258 280 break; … … 270 292 * 271 293 * @global $plugin_page 272 * @global $bp_optouts_list_table 294 * @global $bp_optouts_list_table BP_Optouts_List_Table List table instance for nonmember opt-outs admin page. 273 295 */ 274 296 function bp_core_optouts_admin_index() { … … 312 334 'action2', 313 335 '_wpnonce', 314 'optout_ids' 336 'optout_ids', 315 337 ), 316 338 $_SERVER['REQUEST_URI'] … … 341 363 <?php $bp_optouts_list_table->views(); ?> 342 364 343 <form id="bp-optouts-search-form" action="<?php echo esc_url( $search_form_url ) ;?>">365 <form id="bp-optouts-search-form" action="<?php echo esc_url( $search_form_url ); ?>"> 344 366 <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" /> 345 367 <?php $bp_optouts_list_table->search_box( esc_html__( 'Search for a specific email address', 'buddypress' ), 'bp-optouts' ); ?> 346 368 </form> 347 369 348 <form id="bp-optouts-form" action="<?php echo esc_url( $form_url ); ?>" method="post">370 <form id="bp-optouts-form" action="<?php echo esc_url( $form_url ); ?>" method="post"> 349 371 <?php $bp_optouts_list_table->display(); ?> 350 372 </form> 351 373 </div> 352 <?php374 <?php 353 375 } 354 376 … … 381 403 382 404 // Query for matching optouts, and filter out bad IDs. 383 $args = array(384 'id' 405 $args = array( 406 'id' => $ids, 385 407 ); 386 408 $optouts = bp_get_optouts( $args ); … … 389 411 // Check optout IDs and set up strings. 390 412 switch ( $action ) { 391 case 'delete' 413 case 'delete': 392 414 if ( 0 === count( $optouts ) ) { 393 415 $helper_text = __( 'No opt-out requests were found.', 'buddypress' ); … … 404 426 $action_args = array( 405 427 'action' => 'do_' . $action, 406 'optout_ids' => implode( ',', $optout_ids ) 428 'optout_ids' => implode( ',', $optout_ids ), 407 429 ); 408 430 … … 430 452 431 453 <ol class="bp-optouts-list"> 432 <?php foreach ( $optouts as $optout ) : 454 <?php foreach ( $optouts as $optout ) : ?> 433 455 434 456 <li> 435 <strong><?php echo esc_html( $optout->email_address ) ?></strong>457 <strong><?php echo esc_html( $optout->email_address ); ?></strong> 436 458 <p class="description"> 437 459 <?php 438 460 $last_modified = mysql2date( 'Y/m/d g:i:s a', $optout->date_modified ); 439 461 /* translators: %s: modification date */ 440 printf( esc_html__( 'Date modified: %s', 'buddypress' ), esc_html( $last_modified ) );462 printf( esc_html__( 'Date modified: %s', 'buddypress' ), esc_html( $last_modified ) ); 441 463 ?> 442 464 </p> … … 448 470 <?php if ( 'delete' === $action && count( $optouts ) ) : ?> 449 471 450 <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>451 452 <?php endif 472 <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ); ?></strong></p> 473 474 <?php endif; ?> 453 475 454 476 <?php if ( count( $optouts ) ) : ?> … … 458 480 <?php endif; ?> 459 481 460 <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>482 <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a> 461 483 </div> 462 484 -
trunk/src/bp-core/admin/bp-core-admin-rewrites.php
r13877 r13886 45 45 } 46 46 47 $directory_pages = (array) bp_core_get_directory_pages(); 47 $dir_pages_object = bp_core_get_directory_pages(); 48 $directory_pages = (array) $dir_pages_object; 48 49 $current_page_slugs = wp_list_pluck( $directory_pages, 'slug', 'id' ); 49 50 $current_page_titles = wp_list_pluck( $directory_pages, 'title', 'id' ); … … 80 81 81 82 if ( isset( $posted_data['_bp_component_slugs'] ) && is_array( $posted_data['_bp_component_slugs'] ) ) { 82 $postarr['meta_input']['_bp_component_slugs'] = array_map( 'sanitize_title', $posted_data['_bp_component_slugs'] );83 $postarr['meta_input']['_bp_component_slugs'] = array_map( 'sanitize_title', (array) $posted_data['_bp_component_slugs'] ); 83 84 } 84 85 … … 87 88 $current_group_create_custom_slug = ''; 88 89 89 if ( isset( $dir ectory_pages->groups->custom_slugs['bp_group_create'] ) ) {90 $current_group_create_custom_slug = $dir ectory_pages->groups->custom_slugs['bp_group_create'];90 if ( isset( $dir_pages_object->groups->custom_slugs['bp_group_create'] ) ) { 91 $current_group_create_custom_slug = $dir_pages_object->groups->custom_slugs['bp_group_create']; 91 92 } 92 93 … … 261 262 'slug' => 'group', 262 263 'rewrite_id' => $edit_subnav['rewrite_id'] . '_group', 263 ) 264 ), 264 265 ) 265 266 ); … … 268 269 269 270 $members_sub_navigation[ $navs['main_nav']['slug'] ] = array( 270 'name' 271 'name' => $navs['main_nav']['name'], 271 272 'sub_nav' => $navs['sub_nav'], 272 273 ); 273 274 } 274 ?>275 ?> 275 276 <tr> 276 277 <th scope="row"> … … 286 287 </th> 287 288 <td> 288 <input type="text" class="code" name="<?php printf( 'components[%1$d][_bp_component_slugs][%2$s]', absint( $directory_data->id ), esc_attr( $navs['main_nav']['rewrite_id'] ) ); ?>" id="<?php echo esc_attr( sprintf( '%s-slug', sanitize_key( $navs['main_nav']['rewrite_id'] ) ) ); ?>" value="<?php echo esc_attr( bp_rewrites_get_slug( $component_id, $navs['main_nav']['rewrite_id'], 289 <input type="text" class="code" name="<?php printf( 'components[%1$d][_bp_component_slugs][%2$s]', absint( $directory_data->id ), esc_attr( $navs['main_nav']['rewrite_id'] ) ); ?>" id="<?php echo esc_attr( sprintf( '%s-slug', sanitize_key( $navs['main_nav']['rewrite_id'] ) ) ); ?>" value="<?php echo esc_attr( bp_rewrites_get_slug( $component_id, $navs['main_nav']['rewrite_id'], $navs['main_nav']['slug'] ) ); ?>"> 289 290 </td> 290 291 </tr> -
trunk/src/bp-core/admin/bp-core-admin-schema.php
r13497 r13886 22 22 */ 23 23 function bp_core_install( $active_components = false ) { 24 25 24 bp_pre_schema_upgrade(); 26 25 … … 45 44 46 45 // Notifications. 47 if ( ! empty( $active_components['notifications'] ) ) {46 if ( ! empty( $active_components['notifications'] ) ) { 48 47 bp_core_install_notifications(); 49 48 } 50 49 51 50 // Friend Connections. 52 if ( ! empty( $active_components['friends'] ) ) {51 if ( ! empty( $active_components['friends'] ) ) { 53 52 bp_core_install_friends(); 54 53 } 55 54 56 55 // Extensible Groups. 57 if ( ! empty( $active_components['groups'] ) ) {56 if ( ! empty( $active_components['groups'] ) ) { 58 57 bp_core_install_groups(); 59 58 } 60 59 61 60 // Private Messaging. 62 if ( ! empty( $active_components['messages'] ) ) {61 if ( ! empty( $active_components['messages'] ) ) { 63 62 bp_core_install_private_messaging(); 64 63 } 65 64 66 65 // Extended Profiles. 67 if ( ! empty( $active_components['xprofile'] ) ) {66 if ( ! empty( $active_components['xprofile'] ) ) { 68 67 bp_core_install_extended_profiles(); 69 68 } 70 69 71 70 // Blog tracking. 72 if ( ! empty( $active_components['blogs'] ) ) {71 if ( ! empty( $active_components['blogs'] ) ) { 73 72 bp_core_install_blog_tracking(); 74 73 } … … 79 78 * 80 79 * @since 1.0.0 81 *82 80 */ 83 81 function bp_core_install_notifications() { … … 120 118 * 121 119 * @since 1.0.0 122 *123 120 */ 124 121 function bp_core_install_activity_streams() { … … 170 167 * 171 168 * @since 1.0.0 172 *173 169 */ 174 170 function bp_core_install_friends() { … … 195 191 * 196 192 * @since 1.0.0 197 *198 193 */ 199 194 function bp_core_install_groups() { … … 254 249 * 255 250 * @since 1.0.0 256 *257 251 */ 258 252 function bp_core_install_private_messaging() { … … 312 306 * @since 1.0.0 313 307 * 308 * @global wpdb $wpdb WordPress database object. 314 309 */ 315 310 function bp_core_install_extended_profiles() { … … 404 399 * 405 400 * @since 1.0.0 406 *407 401 */ 408 402 function bp_core_install_blog_tracking() { … … 444 438 445 439 // Signups is not there and we need it so let's create it. 446 require_once ( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );447 require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );440 require_once buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php'; 441 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; 448 442 449 443 // Never use bp_core_get_table_prefix() for any global users tables. … … 459 453 // Filter out all the queries except wp_signups. 460 454 foreach ( $create_queries as $key => $query ) { 461 if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) {455 if ( preg_match( '|CREATE TABLE ([^ ]*)|', $query, $matches ) ) { 462 456 if ( trim( $matches[1], '`' ) !== $wpdb->signups ) { 463 457 unset( $create_queries[ $key ] ); … … 540 534 foreach ( $tt_ids as $tt_id ) { 541 535 $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() ); 542 wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array( 543 'description' => $descriptions[ $id ], 544 ) ); 536 wp_update_term( 537 (int) $term->term_id, 538 bp_get_email_tax_type(), 539 array( 540 'description' => $descriptions[ $id ], 541 ) 542 ); 545 543 } 546 544 } … … 569 567 $charset_collate = $GLOBALS['wpdb']->get_charset_collate(); 570 568 $bp_prefix = bp_core_get_table_prefix(); 571 $sql[] = "CREATE TABLE {$bp_prefix}bp_invitations (569 $sql[] = "CREATE TABLE {$bp_prefix}bp_invitations ( 572 570 id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 573 571 user_id bigint(20) NOT NULL, … … 616 614 $optouts_class = new BP_Optout(); 617 615 $table_name = $optouts_class->get_table_name(); 618 $sql = "CREATE TABLE {$table_name} (616 $sql = "CREATE TABLE {$table_name} ( 619 617 id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, 620 618 email_address_hash varchar(255) NOT NULL, -
trunk/src/bp-core/admin/bp-core-admin-settings.php
r13878 r13886 14 14 * Main settings section description for the settings page. 15 15 * 16 * @since 1.6.0 17 */ 18 function bp_admin_setting_callback_main_section() { } 16 * @internal This function is used as a callback for the 'bp_main_section' settings section. 17 * 18 * @since 1.6.0 19 */ 20 function bp_admin_setting_callback_main_section() {} 19 21 20 22 /** … … 22 24 * 23 25 * @since 1.6.0 24 *25 26 */ 26 27 function bp_admin_setting_callback_admin_bar() { 27 ?>28 29 <input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( ! bp_hide_loggedout_adminbar( false ) ); ?> />28 ?> 29 30 <input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( ! bp_hide_loggedout_adminbar( false ) ); ?> /> 30 31 <label for="hide-loggedout-adminbar"><?php esc_html_e( 'Show the Toolbar for logged out users', 'buddypress' ); ?></label> 31 32 32 <?php33 <?php 33 34 } 34 35 … … 40 41 function bp_admin_setting_callback_community_visibility() { 41 42 $visibility = bp_get_community_visibility( 'all' ); 42 ?>43 ?> 43 44 <select name="_bp_community_visibility[global]" id="_bp_community_visibility-global" aria-describedby="_bp_community_visibility_description" autocomplete="off"> 44 45 <option value="anyone" <?php echo selected( $visibility['global'], 'anyone' ); ?>><?php esc_html_e( 'Anyone', 'buddypress' ); ?></option> … … 47 48 48 49 <p id="_bp_community_visibility_description" class="description"><?php esc_html_e( 'Choose "Anyone" to allow any visitor access to your community area. Choose "Members Only" to restrict access to your community area to logged-in members only.', 'buddypress' ); ?></p> 49 <?php50 <?php 50 51 } 51 52 … … 56 57 * 57 58 * @param mixed $saved_value The value passed to the save function. 59 * @return array 58 60 */ 59 61 function bp_admin_sanitize_callback_community_visibility( $saved_value ) { … … 91 93 */ 92 94 function bp_admin_setting_callback_theme_package_id() { 93 $options = ''; 95 $options = ''; 96 $package_id = bp_get_theme_package_id(); 94 97 95 98 /* … … 104 107 '<option value="%1$s" %2$s>%3$s</option>', 105 108 esc_attr( $id ), 106 selected( $theme->id, bp_get_theme_package_id(), false ),109 selected( $theme->id, $package_id, false ), 107 110 esc_html( $theme->name ) 108 111 ); … … 110 113 111 114 // phpcs:disable WordPress.Security.EscapeOutput 112 if ( $options ) : ?> 115 if ( $options ) : 116 ?> 113 117 <select name="_bp_theme_package_id" id="_bp_theme_package_id" aria-describedby="_bp_theme_package_description"><?php echo $options; ?></select> 114 118 <p id="_bp_theme_package_description" class="description"><?php esc_html_e( 'The selected Template Pack will serve all BuddyPress templates.', 'buddypress' ); ?></p> … … 117 121 <p><?php esc_html_e( 'No template packages available.', 'buddypress' ); ?></p> 118 122 119 <?php endif; 123 <?php 124 endif; 120 125 // phpcs:enable 121 126 } … … 126 131 * Groups settings section description for the settings page. 127 132 * 128 * @since 1.6.0 129 */ 130 function bp_admin_setting_callback_activity_section() { } 133 * @internal This function is used as a callback for the 'bp_activity_section' settings section. 134 * 135 * @since 1.6.0 136 */ 137 function bp_admin_setting_callback_activity_section() {} 131 138 132 139 /** … … 134 141 * 135 142 * @since 1.6.0 136 *137 143 */ 138 144 function bp_admin_setting_callback_activity_akismet() { 139 ?> 140 145 ?> 141 146 <input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> /> 142 147 <label for="_bp_enable_akismet"><?php esc_html_e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label> 143 144 <?php 148 <?php 145 149 } 146 150 … … 152 156 function bp_admin_setting_callback_blogforum_comments() { 153 157 $support = post_type_supports( 'post', 'buddypress-activity' ); 154 ?>158 ?> 155 159 156 160 <input id="bp-disable-blogforum-comments" name="bp-disable-blogforum-comments" type="checkbox" value="1" <?php checked( ! bp_disable_blogforum_comments( false ) ); ?> <?php disabled( ! $support ); ?> /> … … 160 164 <?php endif; ?> 161 165 162 <?php166 <?php 163 167 } 164 168 … … 169 173 */ 170 174 function bp_admin_setting_callback_heartbeat() { 171 ?> 172 175 ?> 173 176 <input id="_bp_enable_heartbeat_refresh" name="_bp_enable_heartbeat_refresh" type="checkbox" value="1" <?php checked( bp_is_activity_heartbeat_active( true ) ); ?> /> 174 177 <label for="_bp_enable_heartbeat_refresh"><?php esc_html_e( 'Automatically check for new items while viewing the activity stream', 'buddypress' ); ?></label> 175 176 <?php 178 <?php 177 179 } 178 180 … … 187 189 * 188 190 * @param bool $value Whether or not to sanitize. 189 * @return bool191 * @return int 190 192 */ 191 193 function bp_admin_sanitize_callback_blogforum_comments( $value = false ) { … … 198 200 * Profile settings section description for the settings page. 199 201 * 200 * @since 1.6.0 201 */ 202 function bp_admin_setting_callback_members_section() { } 202 * @internal This function is used as a callback for the 'bp_members_section' settings section. 203 * 204 * @since 1.6.0 205 */ 206 function bp_admin_setting_callback_members_section() {} 203 207 204 208 /** … … 209 213 */ 210 214 function bp_admin_setting_callback_avatar_uploads() { 211 ?>215 ?> 212 216 <input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_avatar_uploads( false ) ); ?> /> 213 217 <label for="bp-disable-avatar-uploads"><?php esc_html_e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label> 214 <?php218 <?php 215 219 } 216 220 … … 222 226 */ 223 227 function bp_admin_setting_callback_cover_image_uploads() { 224 ?>228 ?> 225 229 <input id="bp-disable-cover-image-uploads" name="bp-disable-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_cover_image_uploads() ); ?> /> 226 230 <label for="bp-disable-cover-image-uploads"><?php esc_html_e( 'Allow registered members to upload cover images', 'buddypress' ); ?></label> 227 <?php231 <?php 228 232 } 229 233 … … 234 238 */ 235 239 function bp_admin_setting_callback_members_invitations() { 236 ?>240 ?> 237 241 <input id="bp-enable-members-invitations" name="bp-enable-members-invitations" type="checkbox" value="1" <?php checked( bp_get_members_invitations_allowed() ); ?> /> 238 242 <label for="bp-enable-members-invitations"><?php esc_html_e( 'Allow registered members to invite people to join this network', 'buddypress' ); ?></label> … … 255 259 */ 256 260 function bp_admin_setting_callback_membership_requests() { 257 ?>261 ?> 258 262 <input id="bp-enable-membership-requests" name="bp-enable-membership-requests" type="checkbox" value="1" <?php checked( bp_get_membership_requests_required( 'raw' ) ); ?> <?php disabled( bp_get_signup_allowed() ); ?> /> 259 263 <label for="bp-enable-membership-requests"><?php esc_html_e( 'Allow visitors to request site membership. If enabled, an administrator must approve each new site membership request.', 'buddypress' ); ?></label> … … 262 266 <p class="description"><?php esc_html_e( 'With a WP multisite setup, to require membership requests for new signups, choose one of the following two options from the Network Settings > Registration Settings pane:', 'buddypress' ); ?><p> 263 267 <ul> 264 <li><p class="description"><?php esc_html_e( 'To allow the submission of membership requests but not allow site creation requests, select "Registration is disabled".', 'buddypress' ) ?></p></li>265 <li><p class="description"><?php esc_html_e( 'To allow the submission of membership requests and to allow new sites to be created by your users, choose "Logged in users may register new sites".', 'buddypress' ) ?></p></li>268 <li><p class="description"><?php esc_html_e( 'To allow the submission of membership requests but not allow site creation requests, select "Registration is disabled".', 'buddypress' ); ?></p></li> 269 <li><p class="description"><?php esc_html_e( 'To allow the submission of membership requests and to allow new sites to be created by your users, choose "Logged in users may register new sites".', 'buddypress' ); ?></p></li> 266 270 </ul> 267 271 <p class="description"><?php esc_html_e( 'The other two options, "User accounts may be registered" and "Both sites and user accounts can be registered," are open in nature and membership requests will not be enabled if one of those options is selected.', 'buddypress' ); ?><p> … … 284 288 * Profile settings section description for the settings page. 285 289 * 286 * @since 1.6.0 287 */ 288 function bp_admin_setting_callback_xprofile_section() { } 290 * @internal This function is used as a callback for the 'bp_xprofile_section' settings section. 291 * 292 * @since 1.6.0 293 */ 294 function bp_admin_setting_callback_xprofile_section() {} 289 295 290 296 /** … … 292 298 * 293 299 * @since 1.6.0 294 *295 300 */ 296 301 function bp_admin_setting_callback_profile_sync() { 297 ?> 298 299 <input id="bp-disable-profile-sync" name="bp-disable-profile-sync" type="checkbox" value="1" <?php checked( !bp_disable_profile_sync( false ) ); ?> /> 302 ?> 303 <input id="bp-disable-profile-sync" name="bp-disable-profile-sync" type="checkbox" value="1" <?php checked( ! bp_disable_profile_sync( false ) ); ?> /> 300 304 <label for="bp-disable-profile-sync"><?php esc_html_e( 'Enable BuddyPress to WordPress profile syncing', 'buddypress' ); ?></label> 301 302 <?php 305 <?php 303 306 } 304 307 … … 308 311 * Groups settings section description for the settings page. 309 312 * 310 * @since 1.6.0 311 */ 312 function bp_admin_setting_callback_groups_section() { } 313 * @internal This function is used as a callback for the 'bp_groups_section' settings section. 314 * 315 * @since 1.6.0 316 */ 317 function bp_admin_setting_callback_groups_section() {} 313 318 314 319 /** … … 316 321 * 317 322 * @since 1.6.0 318 *319 323 */ 320 324 function bp_admin_setting_callback_group_creation() { 321 ?> 322 323 <input id="bp_restrict_group_creation" name="bp_restrict_group_creation" type="checkbox" aria-describedby="bp_group_creation_description" value="1" <?php checked( !bp_restrict_group_creation( false ) ); ?> /> 325 ?> 326 <input id="bp_restrict_group_creation" name="bp_restrict_group_creation" type="checkbox" aria-describedby="bp_group_creation_description" value="1" <?php checked( ! bp_restrict_group_creation( false ) ); ?> /> 324 327 <label for="bp_restrict_group_creation"><?php esc_html_e( 'Enable group creation for all users', 'buddypress' ); ?></label> 325 328 <p class="description" id="bp_group_creation_description"><?php esc_html_e( 'Administrators can always create groups, regardless of this setting.', 'buddypress' ); ?></p> 326 327 <?php 329 <?php 328 330 } 329 331 … … 334 336 */ 335 337 function bp_admin_setting_callback_group_avatar_uploads() { 336 ?>338 ?> 337 339 <input id="bp-disable-group-avatar-uploads" name="bp-disable-group-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_avatar_uploads() ); ?> /> 338 340 <label for="bp-disable-group-avatar-uploads"><?php esc_html_e( 'Allow customizable avatars for groups', 'buddypress' ); ?></label> 339 <?php341 <?php 340 342 } 341 343 … … 346 348 */ 347 349 function bp_admin_setting_callback_group_cover_image_uploads() { 348 ?>350 ?> 349 351 <input id="bp-disable-group-cover-image-uploads" name="bp-disable-group-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_cover_image_uploads() ); ?> /> 350 352 <label for="bp-disable-group-cover-image-uploads"><?php esc_html_e( 'Allow customizable cover images for groups', 'buddypress' ); ?></label> 351 <?php353 <?php 352 354 } 353 355 … … 358 360 */ 359 361 function bp_admin_setting_callback_group_activity_deletions() { 360 ?>362 ?> 361 363 <input id="bp-disable-group-activity-deletions" name="bp-disable-group-activity-deletions" type="checkbox" value="1" <?php checked( ! bp_disable_group_activity_deletions() ); ?> /> 362 364 <label for="bp-disable-group-activity-deletions"><?php esc_html_e( "Allow group administrators and moderators to delete activity items from their group's activity stream", 'buddypress' ); ?></label> 363 <?php365 <?php 364 366 } 365 367 … … 369 371 * Account settings section description for the settings page. 370 372 * 373 * @internal This function is used as a callback for the 'bp_account_section' settings section. 374 * 371 375 * @since 12.0.0 372 376 */ 373 function bp_admin_setting_callback_settings_section() { 377 function bp_admin_setting_callback_settings_section() {} 374 378 375 379 /** … … 379 383 */ 380 384 function bp_admin_setting_callback_account_deletion() { 381 ?> 382 385 ?> 383 386 <input id="bp-disable-account-deletion" name="bp-disable-account-deletion" type="checkbox" value="1" <?php checked( ! bp_disable_account_deletion( false ) ); ?> /> 384 387 <label for="bp-disable-account-deletion"><?php esc_html_e( 'Allow registered members to delete their own accounts', 'buddypress' ); ?></label> 385 386 <?php 388 <?php 387 389 } 388 390 … … 393 395 * 394 396 * @since 1.6.0 395 *396 397 */ 397 398 function bp_core_admin_settings() { … … 403 404 404 405 <div class="buddypress-body"> 405 <form action="<?php echo esc_url( $form_action ) ?>" method="post">406 <form action="<?php echo esc_url( $form_action ); ?>" method="post"> 406 407 407 408 <?php settings_fields( 'buddypress' ); ?> … … 415 416 </div> 416 417 417 <?php418 <?php 418 419 } 419 420 … … 426 427 global $wp_settings_fields; 427 428 428 if ( isset( $_GET['page'] ) && 'bp-settings' == $_GET['page'] && !empty( $_POST['submit'] ) ) {429 if ( isset( $_GET['page'] ) && 'bp-settings' === $_GET['page'] && ! empty( $_POST['submit'] ) ) { 429 430 check_admin_referer( 'buddypress-options' ); 430 431 … … 434 435 foreach ( (array) $wp_settings_fields['buddypress'] as $section => $settings ) { 435 436 foreach ( $settings as $setting_name => $setting ) { 436 $value = isset( $_POST[ $setting_name] ) ? $_POST[$setting_name] : '';437 $value = isset( $_POST[ $setting_name ] ) ? $_POST[ $setting_name ] : ''; 437 438 438 439 bp_update_option( $setting_name, $value ); … … 459 460 // Ie, the Profile Syncing option reads "Enable Sync", so when it's checked, 460 461 // the corresponding option should be unset. 461 $value = isset( $_POST[ $legacy_option] ) ? '' : 1;462 $value = isset( $_POST[ $legacy_option ] ) ? '' : 1; 462 463 bp_update_option( $legacy_option, $value ); 463 464 } 464 465 465 bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_get_admin_url( 'admin.php' ) ) ); 466 bp_core_redirect( 467 add_query_arg( 468 array( 469 'page' => 'bp-settings', 470 'updated' => 'true', 471 ), 472 bp_get_admin_url( 'admin.php' ) 473 ) 474 ); 466 475 } 467 476 } … … 473 482 * @since 1.6.0 474 483 * 475 * @param string $option Form option to echo.476 * @param string $default Form option default.477 * @param bool $slug Form option slug.478 */ 479 function bp_form_option( $option, $default = '', $slug = false ) {484 * @param string $option Form option to echo. 485 * @param string $default_option Form option default. 486 * @param bool $slug Form option slug. 487 */ 488 function bp_form_option( $option, $default_option = '', $slug = false ) { 480 489 // phpcs:ignore WordPress.Security.EscapeOutput 481 echo bp_get_form_option( $option, $default, $slug ); 482 } 483 484 /** 485 * Return settings API option 486 * 487 * @since 1.6.0 488 * 489 * 490 * @param string $option Form option to return. 491 * @param string $default Form option default. 492 * @param bool $slug Form option slug. 490 echo bp_get_form_option( $option, $default_option, $slug ); 491 } 492 493 /** 494 * Return settings API option. 495 * 496 * @since 1.6.0 497 * 498 * @param string $option Form option to return. 499 * @param string $default_option Optional. Form option default. Default is empty string. 500 * @param bool $slug Optional. Form option slug. Default is false. 493 501 * @return string 494 502 */ 495 function bp_get_form_option( $option, $default = '', $slug = false ) {503 function bp_get_form_option( $option, $default_option = '', $slug = false ) { 496 504 497 505 // Get the option and sanitize it. 498 $value = bp_get_option( $option, $default );506 $value = bp_get_option( $option, $default_option ); 499 507 500 508 // Slug? 501 509 if ( true === $slug ) { 502 503 510 /** 504 511 * Filters the slug value in the form field. … … 507 514 * 508 515 * @param string $value Value being returned for the requested option. 516 * @param string $option Option whose value is being requested. 509 517 */ 510 $value = esc_attr( apply_filters( 'editable_slug', $value ) ); 511 } else { // Not a slug. 512 $value = esc_attr( $value ); 518 $value = apply_filters( 'editable_slug', $value, $option ); 513 519 } 514 520 515 521 // Fallback to default. 516 522 if ( empty( $value ) ) { 517 $value = $default ;523 $value = $default_option; 518 524 } 525 526 $value = esc_attr( $value ); 519 527 520 528 /** -
trunk/src/bp-core/admin/bp-core-admin-slugs.php
r13818 r13886 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not use page association anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); 14 _deprecated_file( 15 basename( __FILE__ ), 16 '12.0.0', 17 '', 18 esc_html__( 'BuddyPress does not use page association anymore, you can restore it using the BP Classic plugin', 'buddypress' ) 19 ); -
trunk/src/bp-core/admin/bp-core-admin-tools.php
r13878 r13886 264 264 * @since 2.0.0 265 265 * 266 * @global wpdb $wpdb WordPress database object. 267 * 266 268 * @return array 267 269 */ … … 270 272 271 273 if ( ! bp_is_active( 'friends' ) ) { 272 return ;274 return array( 2, __( 'Friends component is not active.', 'buddypress' ) ); 273 275 } 274 276 … … 290 292 if ( $total_users > 0 ) { 291 293 $per_query = 500; 292 $offset = 0;294 $offset = 0; 293 295 while ( $offset < $total_users ) { 294 296 // Only bother updating counts for users who actually have friendships. … … 323 325 * @since 2.0.0 324 326 * 327 * @global wpdb $wpdb WordPress database object. 328 * 325 329 * @return array 326 330 */ … … 329 333 330 334 if ( ! bp_is_active( 'groups' ) ) { 331 return ;335 return array( 2, __( 'Groups component is not active.', 'buddypress' ) ); 332 336 } 333 337 … … 348 352 if ( $total_users > 0 ) { 349 353 $per_query = 500; 350 $offset = 0;354 $offset = 0; 351 355 while ( $offset < $total_users ) { 352 356 // But only bother to update counts for users that have groups. … … 379 383 380 384 // Default to failure text. 381 $result = __( 'Failed!','buddypress' );385 $result = __( 'Failed!', 'buddypress' ); 382 386 383 387 // Default to unrepaired. 384 $repair 388 $repair = false; 385 389 386 390 // Run function if blogs component is active. … … 412 416 if ( ! is_multisite() ) { 413 417 return array( 0, sprintf( $statement, __( 'Failed!', 'buddypress' ) ) ); 414 418 } 415 419 416 420 // Run function if blogs component is active. … … 459 463 * 460 464 * @since 2.0.0 465 * 466 * @return array 461 467 */ 462 468 function bp_admin_repair_count_members() { … … 474 480 * @since 6.0.0 475 481 * 482 * @global wpdb $wpdb WordPress database object. 483 * 476 484 * @return array 477 485 */ … … 479 487 global $wpdb; 480 488 481 require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );482 require_once ( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );489 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; 490 require_once buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php'; 483 491 484 492 /* translators: %s: the result of the action performed by the repair tool */ … … 490 498 // Check for existence of invitations table. 491 499 $table_name = BP_Invitation_Manager::get_table_name(); 492 $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );493 if ( ! $wpdb->get_var( $query ) == $table_name ) {500 $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ); 501 if ( ! $wpdb->get_var( $query ) === $table_name ) { 494 502 // Early return if table creation failed. 495 503 return array( 2, sprintf( $statement, $result ) ); … … 512 520 if ( empty( $records ) ) { 513 521 $migrate_result = __( 'Migrated invitations!', 'buddypress' ); 514 return array( 0, sprintf( $statement . ' ' . $migrate_statement 522 return array( 0, sprintf( $statement . ' ' . $migrate_statement, $result, $migrate_result ) ); 515 523 } else { 516 return array( 2, sprintf( $statement . ' ' . $migrate_statement 524 return array( 2, sprintf( $statement . ' ' . $migrate_statement, $result, $migrate_result ) ); 517 525 } 518 526 } … … 527 535 * @since 2.0.0 528 536 * 529 * @param string $message Feedback message.530 * @param string|bool $ class Unused.537 * @param string $message Feedback message. 538 * @param string|bool $html_class Unused. Defaults to false. 531 539 * @return false|Closure 532 540 */ 533 function bp_admin_tools_feedback( $message, $class = false ) { 541 function bp_admin_tools_feedback( $message, $html_class = false ) { 542 $class = $html_class; 534 543 if ( is_string( $message ) ) { 535 544 $message = '<p>' . $message . '</p>'; 536 $class = $class ? $class : 'updated';545 $class = $class ? $class : 'updated'; 537 546 } elseif ( is_wp_error( $message ) ) { 538 547 $errors = $message->get_error_messages(); … … 566 575 'li' => true, 567 576 'div' => array( 568 'id' => true,577 'id' => true, 569 578 'class' => true, 570 579 ), … … 592 601 ?> 593 602 <div class="wrap"> 594 <h1 class="wp-heading-inline"><?php esc_html_e( 'Tools', 'buddypress' ) ?></h1>603 <h1 class="wp-heading-inline"><?php esc_html_e( 'Tools', 'buddypress' ); ?></h1> 595 604 <hr class="wp-header-end"> 596 605 … … 602 611 * @since 2.0.0 603 612 */ 604 do_action( 'bp_network_tool_box' ); ?> 613 do_action( 'bp_network_tool_box' ); 614 ?> 605 615 606 616 </div> … … 615 625 function bp_core_admin_available_tools_intro() { 616 626 $query_arg = array( 617 'page' => 'bp-tools' 627 'page' => 'bp-tools', 618 628 ); 619 629 620 $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' 630 $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php'; 621 631 $url = add_query_arg( $query_arg, bp_get_admin_url( $page ) ); 622 632 ?> 623 633 <div class="card tool-box bp-tools"> 624 <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>634 <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ); ?></h2> 625 635 626 636 <dl> 627 <dt><?php esc_html_e( 'Repair Tools', 'buddypress' ) ?></dt>637 <dt><?php esc_html_e( 'Repair Tools', 'buddypress' ); ?></dt> 628 638 <dd> 629 639 <?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?> … … 637 647 </dd> 638 648 639 <dt><?php esc_html_e( 'Manage Invitations', 'buddypress' ) ?></dt>649 <dt><?php esc_html_e( 'Manage Invitations', 'buddypress' ); ?></dt> 640 650 <dd> 641 651 <?php esc_html_e( 'When enabled, BuddyPress allows your users to invite nonmembers to join your site.', 'buddypress' ); ?> … … 650 660 </dd> 651 661 652 <dt><?php esc_html_e( 'Manage Opt-outs', 'buddypress' ) ?></dt>662 <dt><?php esc_html_e( 'Manage Opt-outs', 'buddypress' ); ?></dt> 653 663 <dd> 654 664 <?php esc_html_e( 'BuddyPress stores opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to opt-out from future communication.', 'buddypress' ); ?> … … 685 695 } 686 696 687 $emails = get_posts( array( 688 'fields' => 'ids', 689 'post_status' => 'publish', 690 'post_type' => bp_get_email_post_type(), 691 'posts_per_page' => 200, 692 'suppress_filters' => false, 693 ) ); 697 $emails = get_posts( 698 array( 699 'fields' => 'ids', 700 'post_status' => 'publish', 701 'post_type' => bp_get_email_post_type(), 702 'posts_per_page' => 200, 703 'suppress_filters' => false, 704 ) 705 ); 694 706 695 707 if ( $emails ) { … … 699 711 } 700 712 713 $email_tax_type = bp_get_email_tax_type(); 714 701 715 // Make sure we have no orphaned email type terms. 702 $email_types = get_terms( bp_get_email_tax_type(), array( 703 'fields' => 'ids', 704 'hide_empty' => false, 705 'update_term_meta_cache' => false, 706 ) ); 716 $email_types = get_terms( 717 array( 718 'taxonomy' => $email_tax_type, 719 'fields' => 'ids', 720 'hide_empty' => false, 721 'update_term_meta_cache' => false, 722 ) 723 ); 707 724 708 725 if ( $email_types ) { 709 726 foreach ( $email_types as $term_id ) { 710 wp_delete_term( (int) $term_id, bp_get_email_tax_type());711 } 712 } 713 714 require_once ( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );727 wp_delete_term( (int) $term_id, $email_tax_type ); 728 } 729 } 730 731 require_once buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php'; 715 732 bp_core_install_emails(); 716 733 … … 779 796 780 797 if ( isset( $active_components[ $component_id ] ) ) { 781 $prefix = $active_components[ $component_id ] . ': ';798 $prefix = $active_components[ $component_id ] . ': '; 782 799 } 783 800 … … 865 882 $theme_settings, 866 883 $bp_settings 867 ) 884 ), 868 885 ); 869 886 … … 872 889 'description' => __( 'These constants can alter where and how parts of BuddyPress are loaded or works.', 'buddypress' ), 873 890 'fields' => array( 874 'BP_VERSION' => array(891 'BP_VERSION' => array( 875 892 'label' => 'BP_VERSION', 876 893 'value' => BP_VERSION, 877 894 ), 878 'BP_DB_VERSION' => array(895 'BP_DB_VERSION' => array( 879 896 'label' => 'BP_DB_VERSION', 880 897 'value' => BP_DB_VERSION, 881 898 ), 882 'BP_REQUIRED_PHP_VERSION' => array(899 'BP_REQUIRED_PHP_VERSION' => array( 883 900 'label' => 'BP_REQUIRED_PHP_VERSION', 884 901 'value' => BP_REQUIRED_PHP_VERSION, 885 902 ), 886 'BP_PLUGIN_DIR' => array(903 'BP_PLUGIN_DIR' => array( 887 904 'label' => 'BP_PLUGIN_DIR', 888 905 'value' => BP_PLUGIN_DIR, 889 906 ), 890 'BP_PLUGIN_URL' => array(907 'BP_PLUGIN_URL' => array( 891 908 'label' => 'BP_PLUGIN_URL', 892 909 'value' => BP_PLUGIN_URL, 893 910 ), 894 'BP_IGNORE_DEPRECATED' => array(911 'BP_IGNORE_DEPRECATED' => array( 895 912 'label' => 'BP_IGNORE_DEPRECATED', 896 913 'value' => defined( 'BP_IGNORE_DEPRECATED' ) && BP_IGNORE_DEPRECATED ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 897 914 'debug' => defined( 'BP_IGNORE_DEPRECATED' ) ? BP_IGNORE_DEPRECATED : 'undefined', 898 915 ), 899 'BP_LOAD_DEPRECATED' => array(916 'BP_LOAD_DEPRECATED' => array( 900 917 'label' => 'BP_LOAD_DEPRECATED', 901 918 'value' => defined( 'BP_LOAD_DEPRECATED' ) && BP_LOAD_DEPRECATED ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 902 919 'debug' => defined( 'BP_LOAD_DEPRECATED' ) ? BP_LOAD_DEPRECATED : 'undefined', 903 920 ), 904 'BP_ROOT_BLOG' => array(921 'BP_ROOT_BLOG' => array( 905 922 'label' => 'BP_ROOT_BLOG', 906 923 'value' => BP_ROOT_BLOG, 907 924 ), 908 'BP_ENABLE_MULTIBLOG' => array(925 'BP_ENABLE_MULTIBLOG' => array( 909 926 'label' => 'BP_ENABLE_MULTIBLOG', 910 927 'value' => defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 911 928 'debug' => defined( 'BP_ENABLE_MULTIBLOG' ) ? BP_ENABLE_MULTIBLOG : 'undefined', 912 929 ), 913 'BP_ENABLE_ROOT_PROFILES' => array(930 'BP_ENABLE_ROOT_PROFILES' => array( 914 931 'label' => 'BP_ENABLE_ROOT_PROFILES', 915 932 'value' => defined( 'BP_ENABLE_ROOT_PROFILES' ) && BP_ENABLE_ROOT_PROFILES ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 916 933 'debug' => defined( 'BP_ENABLE_ROOT_PROFILES' ) ? BP_ENABLE_ROOT_PROFILES : 'undefined', 917 934 ), 918 'BP_DEFAULT_COMPONENT' => array(935 'BP_DEFAULT_COMPONENT' => array( 919 936 'label' => 'BP_DEFAULT_COMPONENT', 920 937 'value' => defined( 'BP_DEFAULT_COMPONENT' ) ? BP_DEFAULT_COMPONENT : __( 'Undefined', 'buddypress' ), 921 938 'debug' => defined( 'BP_DEFAULT_COMPONENT' ) ? BP_DEFAULT_COMPONENT : 'undefined', 922 939 ), 923 'BP_XPROFILE_BASE_GROUP_NAME' => array(940 'BP_XPROFILE_BASE_GROUP_NAME' => array( 924 941 'label' => 'BP_XPROFILE_BASE_GROUP_NAME', 925 942 'value' => BP_XPROFILE_BASE_GROUP_NAME, 926 943 ), 927 'BP_XPROFILE_FULLNAME_FIELD_NAME' => array(944 'BP_XPROFILE_FULLNAME_FIELD_NAME' => array( 928 945 'label' => 'BP_XPROFILE_FULLNAME_FIELD_NAME', 929 946 'value' => BP_XPROFILE_FULLNAME_FIELD_NAME, 930 947 ), 931 'BP_MESSAGES_AUTOCOMPLETE_ALL' => array(948 'BP_MESSAGES_AUTOCOMPLETE_ALL' => array( 932 949 'label' => 'BP_MESSAGES_AUTOCOMPLETE_ALL', 933 950 'value' => defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' ) && BP_MESSAGES_AUTOCOMPLETE_ALL ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 934 951 ), 935 'BP_DISABLE_AUTO_GROUP_JOIN' => array(952 'BP_DISABLE_AUTO_GROUP_JOIN' => array( 936 953 'label' => 'BP_DISABLE_AUTO_GROUP_JOIN', 937 954 'value' => defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? __( 'Disabled', 'buddypress' ) : __( 'Enabled', 'buddypress' ), 938 955 'debug' => defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) ? BP_DISABLE_AUTO_GROUP_JOIN : 'undefined', 939 956 ), 940 'BP_GROUPS_DEFAULT_EXTENSION' => array(957 'BP_GROUPS_DEFAULT_EXTENSION' => array( 941 958 'label' => 'BP_GROUPS_DEFAULT_EXTENSION', 942 959 'value' => defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : __( 'Undefined', 'buddypress' ), 943 960 'debug' => defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'undefined', 944 961 ), 945 'BP_SIGNUPS_SKIP_USER_CREATION' => array(962 'BP_SIGNUPS_SKIP_USER_CREATION' => array( 946 963 'label' => 'BP_SIGNUPS_SKIP_USER_CREATION (deprecated)', 947 964 'value' => defined( 'BP_SIGNUPS_SKIP_USER_CREATION' ) && BP_SIGNUPS_SKIP_USER_CREATION ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), … … 953 970 'debug' => defined( 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' ) ? BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH : 'undefined', 954 971 ), 955 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' => array(972 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' => array( 956 973 'label' => 'BP_EMBED_DISABLE_PRIVATE_MESSAGES', 957 974 'value' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : __( 'Undefined', 'buddypress' ), 958 975 'debug' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : 'undefined', 959 976 ), 960 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' => array(977 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' => array( 961 978 'label' => 'BP_EMBED_DISABLE_ACTIVITY_REPLIES', 962 979 'value' => defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) ? BP_EMBED_DISABLE_ACTIVITY_REPLIES : __( 'Undefined', 'buddypress' ), … … 968 985 'debug' => defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ? BP_ENABLE_USERNAME_COMPATIBILITY_MODE : 'undefined', 969 986 ), 970 'BP_AVATAR_DEFAULT_THUMB' => array(987 'BP_AVATAR_DEFAULT_THUMB' => array( 971 988 'label' => 'BP_AVATAR_DEFAULT_THUMB', 972 989 'value' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : __( 'Undefined', 'buddypress' ), 973 990 'debug' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : 'undefined', 974 991 ), 975 'BP_AVATAR_DEFAULT' => array(992 'BP_AVATAR_DEFAULT' => array( 976 993 'label' => 'BP_AVATAR_DEFAULT', 977 994 'value' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : __( 'Undefined', 'buddypress' ), 978 995 'debug' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : 'undefined', 979 996 ), 980 'BP_AVATAR_URL' => array(997 'BP_AVATAR_URL' => array( 981 998 'label' => 'BP_AVATAR_URL', 982 999 'value' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : __( 'Undefined', 'buddypress' ), 983 1000 'debug' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : 'undefined', 984 1001 ), 985 'BP_AVATAR_UPLOAD_PATH' => array(1002 'BP_AVATAR_UPLOAD_PATH' => array( 986 1003 'label' => 'BP_AVATAR_UPLOAD_PATH', 987 1004 'value' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : __( 'Undefined', 'buddypress' ), 988 1005 'debug' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : 'undefined', 989 1006 ), 990 'BP_SHOW_AVATARS' => array(1007 'BP_SHOW_AVATARS' => array( 991 1008 'label' => 'BP_SHOW_AVATARS', 992 1009 'value' => defined( 'BP_SHOW_AVATARS' ) && BP_SHOW_AVATARS ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ), 993 1010 'debug' => defined( 'BP_SHOW_AVATARS' ) ? BP_SHOW_AVATARS : 'undefined', 994 1011 ), 995 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' => array( 996 'label' => 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 997 'value' => BP_AVATAR_ORIGINAL_MAX_FILESIZE, 998 ), 999 'BP_AVATAR_ORIGINAL_MAX_WIDTH' => array( 1012 'BP_AVATAR_ORIGINAL_MAX_WIDTH' => array( 1000 1013 'label' => 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 1001 1014 'value' => BP_AVATAR_ORIGINAL_MAX_WIDTH, 1002 1015 ), 1003 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' => array(1016 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' => array( 1004 1017 'label' => 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 1005 1018 'value' => size_format( BP_AVATAR_ORIGINAL_MAX_FILESIZE ), 1006 1019 'debug' => BP_AVATAR_ORIGINAL_MAX_FILESIZE, 1007 1020 ), 1008 'BP_AVATAR_FULL_HEIGHT' => array(1021 'BP_AVATAR_FULL_HEIGHT' => array( 1009 1022 'label' => 'BP_AVATAR_FULL_HEIGHT', 1010 1023 'value' => BP_AVATAR_FULL_HEIGHT, 1011 1024 ), 1012 'BP_AVATAR_FULL_WIDTH' => array(1025 'BP_AVATAR_FULL_WIDTH' => array( 1013 1026 'label' => 'BP_AVATAR_FULL_WIDTH', 1014 1027 'value' => BP_AVATAR_FULL_WIDTH, 1015 1028 ), 1016 'BP_AVATAR_THUMB_HEIGHT' => array(1029 'BP_AVATAR_THUMB_HEIGHT' => array( 1017 1030 'label' => 'BP_AVATAR_THUMB_HEIGHT', 1018 1031 'value' => BP_AVATAR_THUMB_HEIGHT, 1019 1032 ), 1020 'BP_AVATAR_THUMB_WIDTH' => array(1033 'BP_AVATAR_THUMB_WIDTH' => array( 1021 1034 'label' => 'BP_AVATAR_THUMB_WIDTH', 1022 1035 'value' => BP_AVATAR_THUMB_WIDTH, 1023 1036 ), 1024 'BP_USE_WP_ADMIN_BAR' => array(1037 'BP_USE_WP_ADMIN_BAR' => array( 1025 1038 'label' => 'BP_USE_WP_ADMIN_BAR (deprecated)', 1026 1039 'value' => defined( 'BP_USE_WP_ADMIN_BAR' ) ? BP_USE_WP_ADMIN_BAR : __( 'Undefined', 'buddypress' ), 1027 1040 'debug' => defined( 'BP_USE_WP_ADMIN_BAR' ) ? BP_USE_WP_ADMIN_BAR : 'undefined', 1028 1041 ), 1029 'BP_FRIENDS_DB_VERSION' => array(1042 'BP_FRIENDS_DB_VERSION' => array( 1030 1043 'label' => 'BP_FRIENDS_DB_VERSION (deprecated)', 1031 1044 'value' => defined( 'BP_FRIENDS_DB_VERSION' ) ? BP_FRIENDS_DB_VERSION : __( 'Undefined', 'buddypress' ), 1032 1045 'debug' => defined( 'BP_FRIENDS_DB_VERSION' ) ? BP_FRIENDS_DB_VERSION : 'undefined', 1033 1046 ), 1034 'BP_FORUMS_PARENT_FORUM_ID' => array(1047 'BP_FORUMS_PARENT_FORUM_ID' => array( 1035 1048 'label' => 'BP_FORUMS_PARENT_FORUM_ID (deprecated)', 1036 1049 'value' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : __( 'Undefined', 'buddypress' ), 1037 1050 'debug' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : 'undefined', 1038 1051 ), 1039 'BP_MEMBERS_SLUG' => array(1052 'BP_MEMBERS_SLUG' => array( 1040 1053 'label' => 'BP_MEMBERS_SLUG (deprecated)', 1041 1054 'value' => defined( 'BP_MEMBERS_SLUG' ) ? BP_MEMBERS_SLUG : __( 'Undefined', 'buddypress' ), 1042 1055 'debug' => defined( 'BP_MEMBERS_SLUG' ) ? BP_MEMBERS_SLUG : 'undefined', 1043 1056 ), 1044 'BP_GROUPS_SLUG' => array(1057 'BP_GROUPS_SLUG' => array( 1045 1058 'label' => 'BP_GROUPS_SLUG (deprecated)', 1046 1059 'value' => defined( 'BP_GROUPS_SLUG' ) ? BP_GROUPS_SLUG : __( 'Undefined', 'buddypress' ), 1047 1060 'debug' => defined( 'BP_GROUPS_SLUG' ) ? BP_GROUPS_SLUG : 'undefined', 1048 1061 ), 1049 'BP_MESSAGES_SLUG' => array(1062 'BP_MESSAGES_SLUG' => array( 1050 1063 'label' => 'BP_MESSAGES_SLUG (deprecated)', 1051 1064 'value' => defined( 'BP_MESSAGES_SLUG' ) ? BP_MESSAGES_SLUG : __( 'Undefined', 'buddypress' ), 1052 1065 'debug' => defined( 'BP_MESSAGES_SLUG' ) ? BP_MESSAGES_SLUG : 'undefined', 1053 1066 ), 1054 'BP_NOTIFICATIONS_SLUG' => array(1067 'BP_NOTIFICATIONS_SLUG' => array( 1055 1068 'label' => 'BP_NOTIFICATIONS_SLUG (deprecated)', 1056 1069 'value' => defined( 'BP_NOTIFICATIONS_SLUG' ) ? BP_NOTIFICATIONS_SLUG : __( 'Undefined', 'buddypress' ), 1057 1070 'debug' => defined( 'BP_NOTIFICATIONS_SLUG' ) ? BP_NOTIFICATIONS_SLUG : 'undefined', 1058 1071 ), 1059 'BP_BLOGS_SLUG' => array(1072 'BP_BLOGS_SLUG' => array( 1060 1073 'label' => 'BP_BLOGS_SLUG (deprecated)', 1061 1074 'value' => defined( 'BP_BLOGS_SLUG' ) ? BP_BLOGS_SLUG : __( 'Undefined', 'buddypress' ), 1062 1075 'debug' => defined( 'BP_BLOGS_SLUG' ) ? BP_BLOGS_SLUG : 'undefined', 1063 1076 ), 1064 'BP_FRIENDS_SLUG' => array(1077 'BP_FRIENDS_SLUG' => array( 1065 1078 'label' => 'BP_FRIENDS_SLUG (deprecated)', 1066 1079 'value' => defined( 'BP_FRIENDS_SLUG' ) ? BP_FRIENDS_SLUG : __( 'Undefined', 'buddypress' ), 1067 1080 'debug' => defined( 'BP_FRIENDS_SLUG' ) ? BP_FRIENDS_SLUG : 'undefined', 1068 1081 ), 1069 'BP_ACTIVITY_SLUG' => array(1082 'BP_ACTIVITY_SLUG' => array( 1070 1083 'label' => 'BP_ACTIVITY_SLUG (deprecated)', 1071 1084 'value' => defined( 'BP_ACTIVITY_SLUG' ) ? BP_ACTIVITY_SLUG : __( 'Undefined', 'buddypress' ), 1072 1085 'debug' => defined( 'BP_ACTIVITY_SLUG' ) ? BP_ACTIVITY_SLUG : 'undefined', 1073 1086 ), 1074 'BP_SETTINGS_SLUG' => array(1087 'BP_SETTINGS_SLUG' => array( 1075 1088 'label' => 'BP_SETTINGS_SLUG (deprecated)', 1076 1089 'value' => defined( 'BP_SETTINGS_SLUG' ) ? BP_SETTINGS_SLUG : __( 'Undefined', 'buddypress' ), 1077 1090 'debug' => defined( 'BP_SETTINGS_SLUG' ) ? BP_SETTINGS_SLUG : 'undefined', 1078 1091 ), 1079 'BP_XPROFILE_SLUG' => array(1092 'BP_XPROFILE_SLUG' => array( 1080 1093 'label' => 'BP_XPROFILE_SLUG (deprecated)', 1081 1094 'value' => defined( 'BP_XPROFILE_SLUG' ) ? BP_XPROFILE_SLUG : __( 'Undefined', 'buddypress' ), 1082 1095 'debug' => defined( 'BP_XPROFILE_SLUG' ) ? BP_XPROFILE_SLUG : 'undefined', 1083 1096 ), 1084 'BP_FORUMS_SLUG' => array(1097 'BP_FORUMS_SLUG' => array( 1085 1098 'label' => 'BP_FORUMS_SLUG (deprecated)', 1086 1099 'value' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : __( 'Undefined', 'buddypress' ), 1087 1100 'debug' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : 'undefined', 1088 1101 ), 1089 'BP_SEARCH_SLUG' => array(1102 'BP_SEARCH_SLUG' => array( 1090 1103 'label' => 'BP_SEARCH_SLUG (deprecated)', 1091 1104 'value' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : __( 'Undefined', 'buddypress' ), 1092 1105 'debug' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : 'undefined', 1093 1106 ), 1094 ) 1107 ), 1095 1108 ); 1096 1109 -
trunk/src/bp-core/bp-core-options.php
r13870 r13886 726 726 * @since 1.7.0 727 727 * 728 * @param string $ defaultOptional. Fallback value if not found in the database.729 * Default: 'legacy'.728 * @param string $package_id Optional. Fallback value if not found in the database. 729 * Default: 'legacy'. 730 730 * @return string ID of the theme package. 731 731 */ 732 function bp_get_theme_package_id( $ default= 'legacy' ) {732 function bp_get_theme_package_id( $package_id = 'legacy' ) { 733 733 734 734 /** … … 737 737 * @since 1.7.0 738 738 * 739 * @param string $ valueThe current theme package ID.740 */ 741 return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $ default) );742 } 739 * @param string $package_id The current theme package ID. 740 */ 741 return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $package_id ) ); 742 }
Note: See TracChangeset
for help on using the changeset viewer.