diff --git src/bp-activity/bp-activity-filters.php src/bp-activity/bp-activity-filters.php
index 1e57372ee..b5308821a 100644
|
|
|
add_filter( 'bp_get_activity_feed_item_description', 'force_balance_tags' ); |
| 31 | 31 | add_filter( 'bp_activity_content_before_save', 'force_balance_tags' ); |
| 32 | 32 | add_filter( 'bp_activity_action_before_save', 'force_balance_tags' ); |
| 33 | 33 | |
| 34 | | if ( function_exists( 'wp_encode_emoji' ) ) { |
| 35 | | add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' ); |
| 36 | | } |
| | 34 | add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' ); |
| 37 | 35 | |
| 38 | 36 | add_filter( 'bp_get_activity_action', 'wptexturize' ); |
| 39 | 37 | add_filter( 'bp_get_activity_content_body', 'wptexturize' ); |
diff --git src/bp-blogs/bp-blogs-functions.php src/bp-blogs/bp-blogs-functions.php
index 8b7e5f237..d66589cc9 100644
|
|
|
function bp_blogs_delete_url_blogmeta( $site_id = 0 ) { |
| 575 | 575 | bp_blogs_delete_blogmeta( (int) $site_id, 'url' ); |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | | if ( function_exists( 'wp_switch_roles_and_user' ) ) { |
| | 578 | if ( bp_is_running_wp( '4.9.0' ) ) { |
| 579 | 579 | add_action( 'clean_site_cache', 'bp_blogs_delete_url_blogmeta' ); |
| 580 | 580 | } else { |
| 581 | 581 | add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' ); |
diff --git src/bp-core/bp-core-blocks.php src/bp-core/bp-core-blocks.php
index f2f7a8c2c..62e408060 100644
|
|
|
defined( 'ABSPATH' ) || exit; |
| 19 | 19 | * False otherwise. |
| 20 | 20 | */ |
| 21 | 21 | function bp_support_blocks() { |
| 22 | | return function_exists( 'register_block_type' ) && bp_rest_api_is_available(); |
| | 22 | return bp_is_running_wp( '5.0.0' ) && bp_rest_api_is_available(); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
diff --git src/bp-core/bp-core-catchuri.php src/bp-core/bp-core-catchuri.php
index 198d42393..df857d464 100644
|
|
|
function bp_core_load_template( $templates ) { |
| 463 | 463 | * Wiping out the bp-default template allows WordPress to use their special |
| 464 | 464 | * embed template, which is what we want. |
| 465 | 465 | */ |
| 466 | | if ( function_exists( 'is_embed' ) && is_embed() ) { |
| | 466 | if ( is_embed() ) { |
| 467 | 467 | $located_template = ''; |
| 468 | 468 | } |
| 469 | 469 | |
diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 21190f48d..2b8f0b594 100644
|
|
|
function bp_db_version_raw() { |
| 70 | 70 | return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0; |
| 71 | 71 | } |
| 72 | 72 | |
| | 73 | /** |
| | 74 | * Check whether the current version of WP exceeds a given version. |
| | 75 | * |
| | 76 | * @since 7.0.0 |
| | 77 | * |
| | 78 | * @param string $version WP version, in "PHP-standardized" format. |
| | 79 | * @param string $compare Optional. Comparison operator. Default '>='. |
| | 80 | * @return bool |
| | 81 | */ |
| | 82 | function bp_is_running_wp( $version, $compare = '>=' ) { |
| | 83 | return version_compare( $GLOBALS['wp_version'], $version, $compare ); |
| | 84 | } |
| | 85 | |
| 73 | 86 | /** Functions *****************************************************************/ |
| 74 | 87 | |
| 75 | 88 | /** |
| … |
… |
function bp_register_type_meta( $type_tax, $meta_key, array $args ) { |
| 3134 | 3147 | } |
| 3135 | 3148 | |
| 3136 | 3149 | // register_term_meta() was introduced in WP 4.9.8. |
| 3137 | | if ( ! function_exists( 'register_term_meta' ) ) { |
| | 3150 | if ( ! bp_is_running_wp( '4.9.8' ) ) { |
| 3138 | 3151 | $args['object_subtype'] = $type_tax; |
| 3139 | 3152 | |
| 3140 | 3153 | return register_meta( 'term', $meta_key, $args ); |
| … |
… |
function bp_email_get_appearance_settings() { |
| 3538 | 3551 | ) |
| 3539 | 3552 | ); |
| 3540 | 3553 | |
| 3541 | | if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) { |
| | 3554 | if ( bp_is_running_wp( '4.9.6' ) ) { |
| 3542 | 3555 | $privacy_policy_url = get_privacy_policy_url(); |
| 3543 | 3556 | if ( $privacy_policy_url ) { |
| 3544 | 3557 | $footer_text[] = sprintf( |
diff --git src/bp-core/bp-core-rest-api.php src/bp-core/bp-core-rest-api.php
index 3246b10b4..40771ef34 100644
|
|
|
function bp_rest_api_is_available() { |
| 56 | 56 | * |
| 57 | 57 | * @param boolean $value True if the BP REST API is available. False otherwise. |
| 58 | 58 | */ |
| 59 | | return apply_filters( 'bp_rest_api_is_available', function_exists( 'create_initial_rest_routes' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active(); |
| | 59 | return apply_filters( 'bp_rest_api_is_available', bp_is_running_wp( '4.7.0' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active(); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
diff --git src/bp-core/bp-core-theme-compatibility.php src/bp-core/bp-core-theme-compatibility.php
index 787c6b5b0..f6a40e22b 100644
|
|
|
function bp_theme_compat_reset_post( $args = array() ) { |
| 665 | 665 | */ |
| 666 | 666 | function bp_template_include_theme_compat( $template = '' ) { |
| 667 | 667 | // If embed template, bail. |
| 668 | | if ( true === function_exists( 'is_embed' ) && is_embed() ) { |
| | 668 | if ( is_embed() ) { |
| 669 | 669 | return $template; |
| 670 | 670 | } |
| 671 | 671 | |
diff --git src/bp-core/classes/class-bp-admin.php src/bp-core/classes/class-bp-admin.php
index a7823ab0e..d0c0fa800 100644
|
|
|
class BP_Admin { |
| 562 | 562 | */ |
| 563 | 563 | public function add_privacy_policy_content() { |
| 564 | 564 | // Nothing to do if we're running < WP 4.9.6. |
| 565 | | if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) { |
| | 565 | if ( bp_is_running_wp( '4.9.6', '<' ) ) { |
| 566 | 566 | return; |
| 567 | 567 | } |
| 568 | 568 | |
diff --git src/bp-core/classes/class-bp-embed.php src/bp-core/classes/class-bp-embed.php
index b605ae700..4b1d160f5 100644
|
|
|
class BP_Embed extends WP_Embed { |
| 117 | 117 | */ |
| 118 | 118 | $id = apply_filters( 'embed_post_id', 0 ); |
| 119 | 119 | |
| 120 | | $unfiltered_html = current_user_can( 'unfiltered_html' ); |
| 121 | | $default_discovery = false; |
| 122 | | |
| 123 | 120 | // Since 4.4, WordPress is now an oEmbed provider. |
| 124 | | if ( function_exists( 'wp_oembed_register_route' ) ) { |
| 125 | | $unfiltered_html = true; |
| 126 | | $default_discovery = true; |
| 127 | | } |
| | 121 | $unfiltered_html = true; |
| | 122 | $default_discovery = true; |
| 128 | 123 | |
| 129 | 124 | /** |
| 130 | 125 | * Filters whether or not oEmbed discovery is on. |
diff --git src/bp-groups/bp-groups-cssjs.php src/bp-groups/bp-groups-cssjs.php
index a160fa3ee..4a2221486 100644
|
|
|
function bp_groups_get_group_manage_members_script_data( $group_id = 0 ) { |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | $preloaded_members = array(); |
| 53 | | if ( function_exists( 'rest_preload_api_request' ) ) { |
| | 53 | if ( bp_is_running_wp( '5.0.0' ) ) { |
| 54 | 54 | $preloaded_members = rest_preload_api_request( '', $path ); |
| 55 | 55 | } |
| 56 | 56 | |
diff --git src/bp-groups/bp-groups-filters.php src/bp-groups/bp-groups-filters.php
index a3bd2e70f..29b424d20 100644
|
|
|
add_filter( 'groups_group_name_before_save', 'trim' ); |
| 53 | 53 | add_filter( 'groups_group_description_before_save', 'trim' ); |
| 54 | 54 | |
| 55 | 55 | // Support emoji. |
| 56 | | if ( function_exists( 'wp_encode_emoji' ) ) { |
| 57 | | add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' ); |
| 58 | | } |
| | 56 | add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' ); |
| 59 | 57 | |
| 60 | 58 | // Escape output of new group creation details. |
| 61 | 59 | add_filter( 'bp_get_new_group_name', 'esc_attr' ); |
diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
index b6dac6b9e..e202ea11b 100644
|
|
|
function bp_signup_avatar_dir_value() { |
| 2416 | 2416 | */ |
| 2417 | 2417 | function bp_signup_requires_privacy_policy_acceptance() { |
| 2418 | 2418 | // Bail if we're running a version of WP that doesn't have the Privacy Policy feature. |
| 2419 | | if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) { |
| | 2419 | if ( bp_is_running_wp( '4.9.6', '<' ) ) { |
| 2420 | 2420 | return false; |
| 2421 | 2421 | } |
| 2422 | 2422 | |
diff --git src/bp-messages/bp-messages-filters.php src/bp-messages/bp-messages-filters.php
index fad054023..14c20a1f9 100644
|
|
|
add_filter( 'messages_message_subject_before_save', 'force_balance_tags' ); |
| 32 | 32 | add_filter( 'messages_notice_message_before_save', 'force_balance_tags' ); |
| 33 | 33 | add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' ); |
| 34 | 34 | |
| 35 | | if ( function_exists( 'wp_encode_emoji' ) ) { |
| 36 | | add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' ); |
| 37 | | add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' ); |
| 38 | | add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' ); |
| 39 | | add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' ); |
| 40 | | } |
| | 35 | add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' ); |
| | 36 | add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' ); |
| | 37 | add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' ); |
| | 38 | add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' ); |
| 41 | 39 | |
| 42 | 40 | add_filter( 'bp_get_message_notice_subject', 'wptexturize' ); |
| 43 | 41 | add_filter( 'bp_get_message_notice_text', 'wptexturize' ); |
diff --git src/bp-settings/bp-settings-functions.php src/bp-settings/bp-settings-functions.php
index bca439157..02eafb288 100644
|
|
|
function bp_settings_get_personal_data_request( $user_id = 0 ) { |
| 249 | 249 | |
| 250 | 250 | if ( ! empty( $query->post ) ) { |
| 251 | 251 | // WP 5.4 changed the user request function name to wp_get_user_request() |
| 252 | | $user_request = function_exists( 'wp_get_user_request' ) ? 'wp_get_user_request' : 'wp_get_user_request_data'; |
| | 252 | $user_request = bp_is_running_wp( '4.9.6' ) ? 'wp_get_user_request' : 'wp_get_user_request_data'; |
| 253 | 253 | return $user_request( $query->post->ID ); |
| 254 | 254 | } else { |
| 255 | 255 | return false; |
diff --git src/bp-settings/classes/class-bp-settings-component.php src/bp-settings/classes/class-bp-settings-component.php
index dda4a928d..e48747f81 100644
|
|
|
class BP_Settings_Component extends BP_Component { |
| 193 | 193 | $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true ); |
| 194 | 194 | |
| 195 | 195 | // Export Data - only available for WP 4.9.6+. |
| 196 | | if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) { |
| | 196 | if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) { |
| 197 | 197 | $sub_nav[] = array( |
| 198 | 198 | 'name' => __( 'Export Data', 'buddypress' ), |
| 199 | 199 | 'slug' => 'data', |
| … |
… |
class BP_Settings_Component extends BP_Component { |
| 268 | 268 | $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true ); |
| 269 | 269 | |
| 270 | 270 | // Export Data. |
| 271 | | if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) { |
| | 271 | if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) { |
| 272 | 272 | $wp_admin_nav[] = array( |
| 273 | 273 | 'parent' => 'my-account-' . $this->id, |
| 274 | 274 | 'id' => 'my-account-' . $this->id . '-data', |