<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12745] trunk/src: Core: introduce the `bp_is_running_wp()` function</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12745">12745</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12745","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-10-09 19:17:20 +0000 (Fri, 09 Oct 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Core: introduce the `bp_is_running_wp()` function
This helper function checks WordPress version and is used by BuddyPress to ensure backward-compatibility when a WordPress feature/function is not yet available on the WordPress site BuddyPress is running on.
We have standardized the way we were doing these checks so far by replacing these with the use of this new `bp_is_running_wp()` function. It will help us to identify backward-compatibility chunks when we bump our minimum WP version.
`bp_is_running_wp()` accepts two arguments:
- the WP version, in "PHP-standardized" format.
- the comparison operator. It defaults to `>=`.
Props boonebgorges, r-a-y, espellcaste
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/7906">#7906</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivitybpactivityfiltersphp">trunk/src/bp-activity/bp-activity-filters.php</a></li>
<li><a href="#trunksrcbpblogsbpblogsfunctionsphp">trunk/src/bp-blogs/bp-blogs-functions.php</a></li>
<li><a href="#trunksrcbpcorebpcoreblocksphp">trunk/src/bp-core/bp-core-blocks.php</a></li>
<li><a href="#trunksrcbpcorebpcorecatchuriphp">trunk/src/bp-core/bp-core-catchuri.php</a></li>
<li><a href="#trunksrcbpcorebpcorefunctionsphp">trunk/src/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunksrcbpcorebpcorerestapiphp">trunk/src/bp-core/bp-core-rest-api.php</a></li>
<li><a href="#trunksrcbpcorebpcorethemecompatibilityphp">trunk/src/bp-core/bp-core-theme-compatibility.php</a></li>
<li><a href="#trunksrcbpcoreclassesclassbpadminphp">trunk/src/bp-core/classes/class-bp-admin.php</a></li>
<li><a href="#trunksrcbpcoreclassesclassbpembedphp">trunk/src/bp-core/classes/class-bp-embed.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupscssjsphp">trunk/src/bp-groups/bp-groups-cssjs.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsfiltersphp">trunk/src/bp-groups/bp-groups-filters.php</a></li>
<li><a href="#trunksrcbpmembersbpmemberstemplatephp">trunk/src/bp-members/bp-members-template.php</a></li>
<li><a href="#trunksrcbpmessagesbpmessagesfiltersphp">trunk/src/bp-messages/bp-messages-filters.php</a></li>
<li><a href="#trunksrcbpsettingsbpsettingsfunctionsphp">trunk/src/bp-settings/bp-settings-functions.php</a></li>
<li><a href="#trunksrcbpsettingsclassesclassbpsettingscomponentphp">trunk/src/bp-settings/classes/class-bp-settings-component.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivityfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-filters.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-activity/bp-activity-filters.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,9 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_activity_content_before_save', 'force_balance_tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_activity_action_before_save', 'force_balance_tags' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( function_exists( 'wp_encode_emoji' ) ) {
- add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );
-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_get_activity_action', 'wptexturize' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_get_activity_content_body', 'wptexturize' );
</span></span></pre></div>
<a id="trunksrcbpblogsbpblogsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-blogs/bp-blogs-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-blogs/bp-blogs-functions.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-blogs/bp-blogs-functions.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -575,7 +575,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> bp_blogs_delete_blogmeta( (int) $site_id, 'url' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( function_exists( 'wp_switch_roles_and_user' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( bp_is_running_wp( '4.9.0' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'clean_site_cache', 'bp_blogs_delete_url_blogmeta' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
</span></span></pre></div>
<a id="trunksrcbpcorebpcoreblocksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-blocks.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/bp-core-blocks.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * False otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_support_blocks() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return function_exists( 'register_block_type' ) && bp_rest_api_is_available();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return bp_is_running_wp( '5.0.0' ) && bp_rest_api_is_available();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbpcorebpcorecatchuriphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-catchuri.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-catchuri.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/bp-core-catchuri.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -463,7 +463,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Wiping out the bp-default template allows WordPress to use their special
</span><span class="cx" style="display: block; padding: 0 10px"> * embed template, which is what we want.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( function_exists( 'is_embed' ) && is_embed() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_embed() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $located_template = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-functions.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/bp-core-functions.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,6 +70,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Check whether the current version of WP exceeds a given version.
+ *
+ * @since 7.0.0
+ *
+ * @param string $version WP version, in "PHP-standardized" format.
+ * @param string $compare Optional. Comparison operator. Default '>='.
+ * @return bool
+ */
+function bp_is_running_wp( $version, $compare = '>=' ) {
+ return version_compare( $GLOBALS['wp_version'], $version, $compare );
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** Functions *****************************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3134,7 +3147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // register_term_meta() was introduced in WP 4.9.8.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'register_term_meta' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! bp_is_running_wp( '4.9.8' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args['object_subtype'] = $type_tax;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return register_meta( 'term', $meta_key, $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3538,7 +3551,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( bp_is_running_wp( '4.9.6' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $privacy_policy_url = get_privacy_policy_url();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $privacy_policy_url ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $footer_text[] = sprintf(
</span></span></pre></div>
<a id="trunksrcbpcorebpcorerestapiphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-rest-api.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-rest-api.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/bp-core-rest-api.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param boolean $value True if the BP REST API is available. False otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'bp_rest_api_is_available', function_exists( 'create_initial_rest_routes' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'bp_rest_api_is_available', bp_is_running_wp( '4.7.0' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbpcorebpcorethemecompatibilityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-theme-compatibility.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-theme-compatibility.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/bp-core-theme-compatibility.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,7 +665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_template_include_theme_compat( $template = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // If embed template, bail.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === function_exists( 'is_embed' ) && is_embed() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_embed() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $template;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcoreclassesclassbpadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/classes/class-bp-admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/classes/class-bp-admin.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/classes/class-bp-admin.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -562,7 +562,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_privacy_policy_content() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Nothing to do if we're running < WP 4.9.6.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( bp_is_running_wp( '4.9.6', '<' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcoreclassesclassbpembedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/classes/class-bp-embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/classes/class-bp-embed.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-core/classes/class-bp-embed.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,14 +117,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $id = apply_filters( 'embed_post_id', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $unfiltered_html = current_user_can( 'unfiltered_html' );
- $default_discovery = false;
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Since 4.4, WordPress is now an oEmbed provider.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( function_exists( 'wp_oembed_register_route' ) ) {
- $unfiltered_html = true;
- $default_discovery = true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $unfiltered_html = true;
+ $default_discovery = true;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters whether or not oEmbed discovery is on.
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupscssjsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-cssjs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-cssjs.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-groups/bp-groups-cssjs.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $preloaded_members = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( function_exists( 'rest_preload_api_request' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( bp_is_running_wp( '5.0.0' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $preloaded_members = rest_preload_api_request( '', $path );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-filters.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-groups/bp-groups-filters.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,9 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'groups_group_description_before_save', 'trim' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Support emoji.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( function_exists( 'wp_encode_emoji' ) ) {
- add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' );
-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Escape output of new group creation details.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_get_new_group_name', 'esc_attr' );
</span></span></pre></div>
<a id="trunksrcbpmembersbpmemberstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-template.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-members/bp-members-template.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2416,7 +2416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_signup_requires_privacy_policy_acceptance() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Bail if we're running a version of WP that doesn't have the Privacy Policy feature.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( bp_is_running_wp( '4.9.6', '<' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpmessagesbpmessagesfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-messages/bp-messages-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-messages/bp-messages-filters.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-messages/bp-messages-filters.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,12 +32,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( function_exists( 'wp_encode_emoji' ) ) {
- add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' );
- add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' );
- add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' );
- add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' );
-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' );
+add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' );
+add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' );
+add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_get_message_notice_text', 'wptexturize' );
</span></span></pre></div>
<a id="trunksrcbpsettingsbpsettingsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-settings/bp-settings-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-settings/bp-settings-functions.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-settings/bp-settings-functions.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,7 +249,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $query->post ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // WP 5.4 changed the user request function name to wp_get_user_request()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $user_request = function_exists( 'wp_get_user_request' ) ? 'wp_get_user_request' : 'wp_get_user_request_data';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_request = bp_is_running_wp( '4.9.6' ) ? 'wp_get_user_request' : 'wp_get_user_request_data';
</ins><span class="cx" style="display: block; padding: 0 10px"> return $user_request( $query->post->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span></span></pre></div>
<a id="trunksrcbpsettingsclassesclassbpsettingscomponentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-settings/classes/class-bp-settings-component.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-settings/classes/class-bp-settings-component.php 2020-10-09 13:25:47 UTC (rev 12744)
+++ trunk/src/bp-settings/classes/class-bp-settings-component.php 2020-10-09 19:17:20 UTC (rev 12745)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -193,7 +193,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Export Data - only available for WP 4.9.6+.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sub_nav[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'Export Data', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug' => 'data',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -268,7 +268,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Export Data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_nav[] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 'my-account-' . $this->id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'my-account-' . $this->id . '-data',
</span></span></pre>
</div>
</div>
</body>
</html>