<!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][12535] trunk/src/class-buddypress.php: Core: fix PHP Code standards in inline comments</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/12535">12535</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/12535","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-01-20 18:58:31 +0000 (Mon, 20 Jan 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: fix PHP Code standards in inline comments
props passoniate
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/8217">#8217</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcclassbuddypressphp">trunk/src/class-buddypress.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcclassbuddypressphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/class-buddypress.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/class-buddypress.php 2020-01-20 18:55:27 UTC (rev 12534)
+++ trunk/src/class-buddypress.php 2020-01-20 18:58:31 UTC (rev 12535)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,10 +113,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function instance() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Store the instance locally to avoid private static replication
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Store the instance locally to avoid private static replication.
</ins><span class="cx" style="display: block; padding: 0 10px"> static $instance = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Only run these methods if they haven't been run previously
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Only run these methods if they haven't been run previously.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( null === $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = new BuddyPress;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance->constants();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $instance->setup_actions();
</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">- // Always return the instance
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Always return the instance.
</ins><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The last metroid is in captivity. The galaxy is at peace.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,7 +226,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require( WP_PLUGIN_DIR . '/bp-custom.php' );
</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">- // Path and URL
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Path and URL.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_PLUGIN_DIR' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,34 +245,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_FORUMS_SLUG', 'forums' );
</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">- // Only applicable to those running trunk
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Only applicable to those running trunk.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_SOURCE_SUBDIRECTORY' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_SOURCE_SUBDIRECTORY', '' );
</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">- // Define on which blog ID BuddyPress should run
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Define on which blog ID BuddyPress should run.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_ROOT_BLOG' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Default to use current blog ID
- // Fulfills non-network installs and BP_ENABLE_MULTIBLOG installs
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Default to use current blog ID.
+ // Fulfills non-network installs and BP_ENABLE_MULTIBLOG installs.
</ins><span class="cx" style="display: block; padding: 0 10px"> $root_blog_id = get_current_blog_id();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Multisite check
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Multisite check.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_multisite() ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Multiblog isn't enabled
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Multiblog isn't enabled.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_ENABLE_MULTIBLOG' ) || ( defined( 'BP_ENABLE_MULTIBLOG' ) && (int) constant( 'BP_ENABLE_MULTIBLOG' ) === 0 ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Check to see if BP is network-activated
</span><span class="cx" style="display: block; padding: 0 10px"> // We're not using is_plugin_active_for_network() b/c you need to include the
</span><span class="cx" style="display: block; padding: 0 10px"> // /wp-admin/includes/plugin.php file in order to use that function.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // get network-activated plugins
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Get network-activated plugins.
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugins = get_site_option( 'active_sitewide_plugins');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // basename
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Basename.
</ins><span class="cx" style="display: block; padding: 0 10px"> $basename = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // plugin is network-activated; use main site ID instead
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Plugin is network-activated; use main site ID instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $plugins[ $basename ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site = get_current_site();
</span><span class="cx" style="display: block; padding: 0 10px"> $root_blog_id = $current_site->blog_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -285,9 +285,9 @@
</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"> // The search slug has to be defined nice and early because of the way
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // search requests are loaded
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // search requests are loaded.
</ins><span class="cx" style="display: block; padding: 0 10px"> //
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // @todo Make this better
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // @todo Make this better.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_SEARCH_SLUG' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_SEARCH_SLUG', 'search' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -371,27 +371,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Paths**************************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // BuddyPress root directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // BuddyPress root directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->file = constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->basename = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->plugin_dir = trailingslashit( constant( 'BP_PLUGIN_DIR' ) . constant( 'BP_SOURCE_SUBDIRECTORY' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->plugin_url = trailingslashit( constant( 'BP_PLUGIN_URL' ) . constant( 'BP_SOURCE_SUBDIRECTORY' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Languages
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Languages.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->lang_dir = $this->plugin_dir . 'bp-languages';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Templates (theme compatibility)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Templates (theme compatibility).
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->themes_dir = $this->plugin_dir . 'bp-templates';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->themes_url = $this->plugin_url . 'bp-templates';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Themes (for bp-default)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Themes (for bp-default).
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->old_themes_dir = $this->plugin_dir . 'bp-themes';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->old_themes_url = $this->plugin_url . 'bp-themes';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Theme Compat ******************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->theme_compat = new stdClass(); // Base theme compatibility class
- $this->filters = new stdClass(); // Used when adding/removing filters
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->theme_compat = new stdClass(); // Base theme compatibility class.
+ $this->filters = new stdClass(); // Used when adding/removing filters.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Users *************************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -429,17 +429,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private function legacy_constants() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Define the BuddyPress version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Define the BuddyPress version.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_VERSION' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_VERSION', $this->version );
</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">- // Define the database version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Define the database version.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_DB_VERSION' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_DB_VERSION', $this->db_version );
</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">- // Define if deprecated functions should be ignored
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Define if deprecated functions should be ignored.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! defined( 'BP_IGNORE_DEPRECATED' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'BP_IGNORE_DEPRECATED', true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,16 +457,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Load the WP abstraction file so BuddyPress can run on all WordPress setups.
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-wpabstraction.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Setup the versions (after we include multisite abstraction above)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Setup the versions (after we include multisite abstraction above).
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->versions();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Update/Install ****************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Theme compatibility
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Theme compatibility.
</ins><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-template-loader.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-theme-compatibility.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Require all of the BuddyPress core libraries
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Require all of the BuddyPress core libraries.
</ins><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-actions.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-caps.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -489,7 +489,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/bp-core-rest-api.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Maybe load deprecated functionality (this double negative is proof positive!)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Maybe load deprecated functionality (this double negative is proof positive!).
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! bp_get_option( '_bp_ignore_deprecated_code', ! $this->load_deprecated ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/deprecated/1.2.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/deprecated/1.5.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,7 +510,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'bp-core/deprecated/4.0.php' );
</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">- // Load wp-cli module if PHP 5.4+
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Load wp-cli module if PHP 5.4+.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'WP_CLI' ) && file_exists( $this->plugin_dir . 'cli/wp-cli-bp.php' ) && version_compare( phpversion(), '5.4.0', '>=' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> require( $this->plugin_dir . 'cli/wp-cli-bp.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -658,11 +658,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private function setup_actions() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Add actions to plugin activation and deactivation hooks
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add actions to plugin activation and deactivation hooks.
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'activate_' . $this->basename, 'bp_activation' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'deactivate_' . $this->basename, 'bp_deactivation' );
</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 BuddyPress is being deactivated, do not add any actions
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If BuddyPress is being deactivated, do not add any actions.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_deactivation( $this->basename ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -669,20 +669,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Array of BuddyPress core actions
</span><span class="cx" style="display: block; padding: 0 10px"> $actions = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'setup_theme', // Setup the default theme compat
- 'setup_current_user', // Setup currently logged in user
- 'register_post_types', // Register post types
- 'register_post_statuses', // Register post statuses
- 'register_taxonomies', // Register taxonomies
- 'register_views', // Register the views
- 'register_theme_directory', // Register the theme directory
- 'register_theme_packages', // Register bundled theme packages (bp-themes)
- 'load_textdomain', // Load textdomain
- 'add_rewrite_tags', // Add rewrite tags
- 'generate_rewrite_rules' // Generate rewrite rules
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'setup_theme', // Setup the default theme compat.
+ 'setup_current_user', // Setup currently logged in user.
+ 'register_post_types', // Register post types.
+ 'register_post_statuses', // Register post statuses.
+ 'register_taxonomies', // Register taxonomies.
+ 'register_views', // Register the views.
+ 'register_theme_directory', // Register the theme directory.
+ 'register_theme_packages', // Register bundled theme packages (bp-themes).
+ 'load_textdomain', // Load textdomain.
+ 'add_rewrite_tags', // Add rewrite tags.
+ 'generate_rewrite_rules' // Generate rewrite rules.
</ins><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">- // Add the actions
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add the actions.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach( $actions as $class_action ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( method_exists( $this, $class_action ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -708,15 +708,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private function versions() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Get the possible DB versions (boy is this gross)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Get the possible DB versions (boy is this gross).
</ins><span class="cx" style="display: block; padding: 0 10px"> $versions = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $versions['1.6-single'] = get_blog_option( $this->root_blog_id, '_bp_db_version' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // 1.6-single exists, so trust it
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 1.6-single exists, so trust it.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $versions['1.6-single'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->db_version_raw = (int) $versions['1.6-single'];
</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 no 1.6-single exists, use the max of the others
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If no 1.6-single exists, use the max of the others.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $versions['1.2'] = get_site_option( 'bp-core-db-version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $versions['1.5-multi'] = get_site_option( 'bp-db-version' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -723,7 +723,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $versions['1.6-multi'] = get_site_option( '_bp_db_version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $versions['1.5-single'] = get_blog_option( $this->root_blog_id, 'bp-db-version' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Remove empty array items
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove empty array items.
</ins><span class="cx" style="display: block; padding: 0 10px"> $versions = array_filter( $versions );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->db_version_raw = (int) ( !empty( $versions ) ) ? (int) max( $versions ) : 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -764,7 +764,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function register_theme_packages() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Register the default theme compatibility package
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register the default theme compatibility package.
</ins><span class="cx" style="display: block; padding: 0 10px"> bp_register_theme_package( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'legacy',
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'BuddyPress Legacy', 'buddypress' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -794,12 +794,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function setup_theme() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Bail if something already has this under control
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Bail if something already has this under control.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $this->theme_compat->theme ) ) {
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Setup the theme package to use for compatibility
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Setup the theme package to use for compatibility.
</ins><span class="cx" style="display: block; padding: 0 10px"> bp_setup_theme_compat( bp_get_theme_package_id() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>