Changeset 12745
- Timestamp:
- 10/09/2020 07:17:20 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-filters.php
r12698 r12745 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' ); -
trunk/src/bp-blogs/bp-blogs-functions.php
r12734 r12745 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 { -
trunk/src/bp-core/bp-core-blocks.php
r12684 r12745 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 -
trunk/src/bp-core/bp-core-catchuri.php
r12541 r12745 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 } -
trunk/src/bp-core/bp-core-functions.php
r12729 r12745 70 70 return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0; 71 71 } 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 } 72 85 73 86 /** Functions *****************************************************************/ … … 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 … … 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 ) { -
trunk/src/bp-core/bp-core-rest-api.php
r12455 r12745 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 -
trunk/src/bp-core/bp-core-theme-compatibility.php
r12558 r12745 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 } -
trunk/src/bp-core/classes/class-bp-admin.php
r12730 r12745 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 } -
trunk/src/bp-core/classes/class-bp-embed.php
r12414 r12745 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 /** -
trunk/src/bp-groups/bp-groups-cssjs.php
r12531 r12745 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 } -
trunk/src/bp-groups/bp-groups-filters.php
r12440 r12745 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. -
trunk/src/bp-members/bp-members-template.php
r12693 r12745 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 } -
trunk/src/bp-messages/bp-messages-filters.php
r12416 r12745 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' ); -
trunk/src/bp-settings/bp-settings-functions.php
r12694 r12745 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 { -
trunk/src/bp-settings/classes/class-bp-settings-component.php
r12272 r12745 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' ), … … 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,
Note: See TracChangeset
for help on using the changeset viewer.