diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index b7c303ae0..95df7d6d9 100644
|
|
|
function bp_activity_personal_data_exporter( $email_address, $page ) { |
| 4492 | 4492 | * 'sitewide', 'personal', 'friends', 'mygroups', 'mentions', 'favorites'. |
| 4493 | 4493 | */ |
| 4494 | 4494 | function bp_activity_is_feed_enable( $feed_id = '' ) { |
| 4495 | | if ( bp_current_user_can( 'bp_view', array( 'bp_component' => 'activity' ) ) ) { |
| 4496 | | // @TODO: Should we map the feeds to a component, like |
| 4497 | | // $component = 'activity'; |
| 4498 | | // switch ( $feed_id ) { |
| 4499 | | // case 'mygroups': |
| 4500 | | // $component = 'groups'; |
| 4501 | | // break; |
| 4502 | | // case 'personal': |
| 4503 | | // case 'friends': |
| 4504 | | // case 'mentions': |
| 4505 | | // case 'favorites': |
| 4506 | | // default: |
| 4507 | | // $component = 'members'; |
| 4508 | | // break; |
| 4509 | | // } |
| 4510 | | // $retval = bp_current_user_can( 'bp_view', array( 'bp_component' => $component ) ); |
| 4511 | | $retval = true; |
| 4512 | | } else { |
| 4513 | | $retval = false; |
| 4514 | | } |
| | 4495 | $retval = (bool) bp_current_user_can( 'bp_view', array( 'bp_component' => 'activity' ) ); |
| 4515 | 4496 | |
| 4516 | 4497 | /** |
| 4517 | 4498 | * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early. |
diff --git src/bp-core/admin/bp-core-admin-settings.php src/bp-core/admin/bp-core-admin-settings.php
index dd3727ac9..70ee5d8ae 100644
|
|
|
function bp_admin_setting_callback_account_deletion() { |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | | * Enable private site functionality. |
| | 51 | * Choose whether the community is visible to anyone or only to members. |
| 52 | 52 | * |
| 53 | 53 | * @since 12.0.0 |
| 54 | | * |
| 55 | 54 | */ |
| 56 | 55 | function bp_admin_setting_callback_community_visibility() { |
| 57 | 56 | $visibility = bp_get_community_visibility( 'all' ); |
diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 2ca510bda..8ceb5eb1f 100644
|
|
|
function bp_get_component_navigations( $component = '' ) { |
| 4984 | 4984 | * @return arrary|string $retval The calculated visbility settings for the site. |
| 4985 | 4985 | */ |
| 4986 | 4986 | function bp_get_community_visibility( $component = 'global' ) { |
| 4987 | | $retval = 'anyone'; |
| 4988 | | $saved_value = (array) get_option( '_bp_community_visibility', array() ); |
| | 4987 | $retval = 'anyone'; |
| | 4988 | if ( 'rewrites' !== bp_core_get_query_parser() ) { |
| | 4989 | return $retval; |
| | 4990 | } |
| | 4991 | |
| | 4992 | $saved_value = (array) bp_get_option( '_bp_community_visibility', array() ); |
| 4989 | 4993 | |
| 4990 | 4994 | // If the global value has not been set, we assume that the site is open. |
| 4991 | 4995 | if ( ! isset( $saved_value['global'] ) ) { |
diff --git src/bp-core/bp-core-options.php src/bp-core/bp-core-options.php
index c845baa9f..c0ec714dd 100644
|
|
|
function bp_get_default_options() { |
| 74 | 74 | // Email unsubscribe salt. |
| 75 | 75 | 'bp-emails-unsubscribe-salt' => '', |
| 76 | 76 | |
| | 77 | // Community visibility. |
| | 78 | '_bp_community_visibility' => array( 'global' => 'anyone' ), |
| | 79 | |
| 77 | 80 | /* Groups ************************************************************/ |
| 78 | 81 | |
| 79 | 82 | // @todo Move this into the groups component |
diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php
index 03d012ab1..72244867a 100644
|
|
|
function bp_update_to_12_0() { |
| 860 | 860 | } |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | | /* Widgets **************************************************/ |
| 864 | | $widget_options = array( |
| 865 | | 'widget_bp_core_login_widget', |
| 866 | | 'widget_bp_core_members_widget', |
| 867 | | 'widget_bp_core_whos_online_widget', |
| 868 | | 'widget_bp_core_recently_active_widget', |
| 869 | | 'widget_bp_groups_widget', |
| 870 | | 'widget_bp_messages_sitewide_notices_widget', |
| 871 | | ); |
| 872 | | |
| 873 | | foreach ( $widget_options as $widget_option ) { |
| 874 | | bp_delete_option( $widget_option ); |
| 875 | | } |
| 876 | | |
| 877 | 863 | // Finally make sure to rebuilt permalinks at next page load. |
| 878 | 864 | bp_delete_rewrite_rules(); |
| 879 | 865 | } |
| | 866 | |
| | 867 | // Widgets. |
| | 868 | $widget_options = array( |
| | 869 | 'widget_bp_core_login_widget', |
| | 870 | 'widget_bp_core_members_widget', |
| | 871 | 'widget_bp_core_whos_online_widget', |
| | 872 | 'widget_bp_core_recently_active_widget', |
| | 873 | 'widget_bp_groups_widget', |
| | 874 | 'widget_bp_messages_sitewide_notices_widget', |
| | 875 | ); |
| | 876 | |
| | 877 | foreach ( $widget_options as $widget_option ) { |
| | 878 | bp_delete_option( $widget_option ); |
| | 879 | } |
| | 880 | |
| | 881 | // Community visibility. |
| | 882 | bp_update_option( '_bp_community_visibility', array( 'global' => 'anyone' ) ); |
| 880 | 883 | } |
| 881 | 884 | |
| 882 | 885 | /** |
diff --git src/bp-core/classes/class-bp-admin.php src/bp-core/classes/class-bp-admin.php
index ebb273415..2e8dd61f5 100644
|
|
|
class BP_Admin { |
| 477 | 477 | register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' ); |
| 478 | 478 | |
| 479 | 479 | // Community Visibility |
| 480 | | add_settings_field( '_bp_community_visibility', __( 'Community Visibility', 'buddypress' ), 'bp_admin_setting_callback_community_visibility', 'buddypress', 'bp_main' ); |
| 481 | | register_setting( 'buddypress', '_bp_community_visibility', 'bp_admin_sanitize_callback_community_visibility' ); |
| | 480 | if ( 'rewrites' === bp_core_get_query_parser() ) { |
| | 481 | add_settings_field( '_bp_community_visibility', __( 'Community Visibility', 'buddypress' ), 'bp_admin_setting_callback_community_visibility', 'buddypress', 'bp_main' ); |
| | 482 | register_setting( 'buddypress', '_bp_community_visibility', 'bp_admin_sanitize_callback_community_visibility' ); |
| | 483 | } |
| 482 | 484 | |
| 483 | 485 | // Template pack picker. |
| 484 | 486 | add_settings_field( '_bp_theme_package_id', __( 'Template Pack', 'buddypress' ), 'bp_admin_setting_callback_theme_package_id', 'buddypress', 'bp_main', array( 'label_for' => '_bp_theme_package_id' ) ); |
diff --git src/bp-core/classes/class-bp-component.php src/bp-core/classes/class-bp-component.php
index 585e7b076..f73b5b17d 100644
|
|
|
class BP_Component { |
| 1325 | 1325 | $query->post_count = 1; |
| 1326 | 1326 | $query->is_home = false; |
| 1327 | 1327 | $query->is_front_page = false; |
| 1328 | | $query->is_page = false; |
| 1329 | | $query->is_single = true; |
| | 1328 | $query->is_page = true; |
| 1330 | 1329 | $query->is_archive = false; |
| 1331 | 1330 | $query->is_tax = false; |
| 1332 | 1331 | |