<!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][7451] trunk/bp-core: Improve inline docs in bp-core.</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 { 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">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/7451">7451</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2013-10-20 19:21:38 +0000 (Sun, 20 Oct 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Improve inline docs in bp-core. See <a href="http://buddypress.trac.wordpress.org/ticket/5022">#5022</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoreloaderphp">trunk/bp-core/bp-core-loader.php</a></li>
<li><a href="#trunkbpcorebpcoremoderationphp">trunk/bp-core/bp-core-moderation.php</a></li>
<li><a href="#trunkbpcorebpcoreoptionsphp">trunk/bp-core/bp-core-options.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoreloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-loader.php (7450 => 7451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-loader.php 2013-10-20 18:28:48 UTC (rev 7450)
+++ trunk/bp-core/bp-core-loader.php 2013-10-20 19:21:38 UTC (rev 7451)
</span><span class="lines">@@ -1,9 +1,9 @@
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * BuddyPress Core Loader
</del><ins>+ * BuddyPress Core Loader.
</ins><span class="cx"> *
</span><del>- * Core contains the commonly used functions, classes, and API's
</del><ins>+ * Core contains the commonly used functions, classes, and APIs.
</ins><span class="cx"> *
</span><span class="cx"> * @package BuddyPress
</span><span class="cx"> * @subpackage Core
</span><span class="lines">@@ -15,9 +15,9 @@
</span><span class="cx"> class BP_Core extends BP_Component {
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Start the members component creation process
</del><ins>+ * Start the members component creation process.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
</ins><span class="cx"> *
</span><span class="cx"> * @uses BP_Core::bootstrap()
</span><span class="cx"> */
</span><span class="lines">@@ -32,12 +32,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Populate the global data needed before BuddyPress can continue
</del><ins>+ * Populate the global data needed before BuddyPress can continue.
</ins><span class="cx"> *
</span><span class="cx"> * This involves figuring out the currently required, active, deactive,
</span><span class="cx"> * and optional components.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
</ins><span class="cx"> */
</span><span class="cx"> private function bootstrap() {
</span><span class="cx"> $bp = buddypress();
</span><span class="lines">@@ -108,6 +108,13 @@
</span><span class="cx"> $bp->required_components[] = 'core';
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ /**
+ * Include bp-core files.
+ *
+ * @see BP_Component::includes() for description of parameters.
+ *
+ * @param array $includes See {@link BP_Component::includes()}.
+ */
</ins><span class="cx"> public function includes( $includes = array() ) {
</span><span class="cx">
</span><span class="cx"> if ( !is_admin() )
</span><span class="lines">@@ -121,10 +128,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Set up bp-core global settings.
+ *
</ins><span class="cx"> * Sets up a majority of the BuddyPress globals that require a minimal
</span><span class="cx"> * amount of processing, meaning they cannot be set in the BuddyPress class.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
+ *
+ * @see BP_Component::setup_globals() for description of parameters.
+ *
+ * @param array $args See {@link BP_Component::setup_globals()}.
</ins><span class="cx"> */
</span><span class="cx"> public function setup_globals( $args = array() ) {
</span><span class="cx"> $bp = buddypress();
</span><span class="lines">@@ -184,11 +197,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Setup BuddyBar navigation
</del><ins>+ * Set up component navigation.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
+ *
+ * @see BP_Component::setup_nav() for a description of arguments.
+ *
+ * @param array $main_nav Optional. See BP_Component::setup_nav() for
+ * description.
+ * @param array $sub_nav Optional. See BP_Component::setup_nav() for
+ * description.
</ins><span class="cx"> */
</span><del>- public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
</del><ins>+ public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
</ins><span class="cx"> $bp = buddypress();
</span><span class="cx">
</span><span class="cx"> // If xprofile component is disabled, revert to WordPress profile
</span><span class="lines">@@ -227,11 +247,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Setup the BuddyPress Core component
</del><ins>+ * Set up the BuddyPress Core component.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @global BuddyPress $bp
</del><ins>+ * @global BuddyPress $bp BuddyPress global settings object.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_core() {
</span><span class="cx"> buddypress()->core = new BP_Core();
</span></span></pre></div>
<a id="trunkbpcorebpcoremoderationphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-moderation.php (7450 => 7451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-moderation.php 2013-10-20 18:28:48 UTC (rev 7450)
+++ trunk/bp-core/bp-core-moderation.php 2013-10-20 19:21:38 UTC (rev 7451)
</span><span class="lines">@@ -1,10 +1,10 @@
</span><span class="cx"> <?php
</span><span class="cx"> /**
</span><del>- * BuddyPress Moderation Functions
</del><ins>+ * BuddyPress Moderation Functions.
</ins><span class="cx"> *
</span><span class="cx"> * @package BuddyPress
</span><span class="cx"> * @subpackage Core
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> // Exit if accessed directly
</span><span class="lines">@@ -13,18 +13,20 @@
</span><span class="cx"> /** Moderation ****************************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Check for flooding
</del><ins>+ * Check for flooding.
</ins><span class="cx"> *
</span><span class="cx"> * Check to make sure that a user is not making too many posts in a short amount
</span><span class="cx"> * of time.
</span><span class="cx"> *
</span><del>- * @param int $user_id User id to check for flood
- * @return bool True if there is no flooding, true if there is
- * @since BuddyPress (1.6)
- * @uses current_user_can() To check if the current user can throttle
- * @uses bp_get_option() To get the throttle time
- * @uses get_transient() To get the last posted transient of the ip
- * @uses get_user_meta() To get the last posted meta of the user
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses current_user_can() To check if the current user can throttle.
+ * @uses bp_get_option() To get the throttle time.
+ * @uses get_transient() To get the last posted transient of the ip.
+ * @uses get_user_meta() To get the last posted meta of the user.
+ *
+ * @param int $user_id User id to check for flood.
+ * @return bool True if there is no flooding, false if there is.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_check_for_flood( $user_id = 0 ) {
</span><span class="cx">
</span><span class="lines">@@ -44,16 +46,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Check for moderation keys and too many links
</del><ins>+ * Check for moderation keys and too many links.
</ins><span class="cx"> *
</span><del>- * @param int $user_id Topic or reply author ID
- * @param string $title The title of the content
- * @param string $content The content being posted
- * @return bool True if test is passed, false if fail
- * @since BuddyPress (1.6)
- * @uses bp_current_author_ip() To get current user IP address
- * @uses bp_current_author_ua() To get current user agent
- * @uses bp_current_user_can() Allow super admins to bypass blacklist
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_current_author_ip() To get current user IP address.
+ * @uses bp_current_author_ua() To get current user agent.
+ * @uses bp_current_user_can() Allow super admins to bypass blacklist.
+ *
+ * @param int $user_id Topic or reply author ID.
+ * @param string $title The title of the content.
+ * @param string $content The content being posted.
+ * @return bool True if test is passed, false if fail.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' ) {
</span><span class="cx">
</span><span class="lines">@@ -150,16 +154,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Checks for blocked keys
</del><ins>+ * Check for blocked keys.
</ins><span class="cx"> *
</span><del>- * @param int $user_id Topic or reply author ID
- * @param string $title The title of the content
- * @param string $content The content being posted
- * @return bool True if test is passed, false if fail
- * @uses bp_current_author_ip() To get current user IP address
- * @uses bp_current_author_ua() To get current user agent
- * @uses bp_current_user_can() Allow super admins to bypass blacklist
- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_current_author_ip() To get current user IP address.
+ * @uses bp_current_author_ua() To get current user agent.
+ * @uses bp_current_user_can() Allow super admins to bypass blacklist.
+ *
+ * @param int $user_id Topic or reply author ID.
+ * @param string $title The title of the content.
+ * @param string $content The content being posted.
+ * @return bool True if test is passed, false if fail.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
</span><span class="cx">
</span><span class="lines">@@ -238,10 +244,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Get the current-user IP address
</del><ins>+ * Get the current user's IP address.
</ins><span class="cx"> *
</span><del>- * @return string
- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @return string IP address.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_current_user_ip() {
</span><span class="cx"> $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
</span><span class="lines">@@ -250,10 +257,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Get the current-user user-agent
</del><ins>+ * Get the current user's user-agent.
</ins><span class="cx"> *
</span><del>- * @return string
- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @return string User agent string.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_current_user_ua() {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpcorebpcoreoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-options.php (7450 => 7451)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-options.php 2013-10-20 18:28:48 UTC (rev 7450)
+++ trunk/bp-core/bp-core-options.php 2013-10-20 19:21:38 UTC (rev 7451)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * BuddyPress Options
</del><ins>+ * BuddyPress Options.
</ins><span class="cx"> *
</span><span class="cx"> * @package BuddyPress
</span><span class="cx"> * @subpackage Options
</span><span class="lines">@@ -11,11 +11,11 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Get the default site options and their values
</del><ins>+ * Get the default site options and their values.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @return array Filtered option names and values
</del><ins>+ * @return array Filtered option names and values.
</ins><span class="cx"> */
</span><span class="cx"> function bp_get_default_options() {
</span><span class="cx">
</span><span class="lines">@@ -86,16 +86,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Add default options
</del><ins>+ * Add default options when BuddyPress is first activated.
</ins><span class="cx"> *
</span><span class="cx"> * Hooked to bp_activate, it is only called once when BuddyPress is activated.
</span><span class="cx"> * This is non-destructive, so existing settings will not be overridden.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * Currently unused.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_default_options() To get default options
- * @uses add_option() Adds default options
- * @uses do_action() Calls 'bp_add_options'
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_get_default_options() To get default options.
+ * @uses add_option() Adds default options.
+ * @uses do_action() Calls 'bp_add_options'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_add_options() {
</span><span class="cx">
</span><span class="lines">@@ -111,16 +113,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Delete default options
</del><ins>+ * Delete default options.
</ins><span class="cx"> *
</span><span class="cx"> * Hooked to bp_uninstall, it is only called once when BuddyPress is uninstalled.
</span><span class="cx"> * This is destructive, so existing settings will be destroyed.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * Currently unused.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_default_options() To get default options
- * @uses delete_option() Removes default options
- * @uses do_action() Calls 'bp_delete_options'
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_get_default_options() To get default options.
+ * @uses delete_option() Removes default options.
+ * @uses do_action() Calls 'bp_delete_options'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_delete_options() {
</span><span class="cx">
</span><span class="lines">@@ -136,14 +140,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Add filters to each BuddyPress option and allow them to be overloaded from
- * inside the $bp->options array.
</del><ins>+ * Add filters to each BP option, allowing them to be overloaded from inside the $bp->options array.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * Currently unused.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_default_options() To get default options
- * @uses add_filter() To add filters to 'pre_option_{$key}'
- * @uses do_action() Calls 'bp_add_option_filters'
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_get_default_options() To get default options.
+ * @uses add_filter() To add filters to 'pre_option_{$key}'.
+ * @uses do_action() Calls 'bp_add_option_filters'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_option_filters() {
</span><span class="cx">
</span><span class="lines">@@ -159,9 +164,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Filter default options and allow them to be overloaded from inside the
- * $bp->options array.
</del><ins>+ * Filter default options and allow them to be overloaded from inside the $bp->options array.
</ins><span class="cx"> *
</span><ins>+ * Currently unused.
+ *
</ins><span class="cx"> * @since BuddyPress (1.6)
</span><span class="cx"> *
</span><span class="cx"> * @global BuddyPress $bp
</span><span class="lines">@@ -186,20 +192,21 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Retrieve an option
</del><ins>+ * Retrieve an option.
</ins><span class="cx"> *
</span><del>- * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)
- * on the appropriate blog, given your current setup.
</del><ins>+ * This is a wrapper for {@link get_blog_option()}, which in turn stores settings data
+ * (such as bp-pages) on the appropriate blog, given your current setup.
</ins><span class="cx"> *
</span><span class="cx"> * The 'bp_get_option' filter is primarily for backward-compatibility.
</span><span class="cx"> *
</span><del>- * @package BuddyPress
- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
</ins><span class="cx"> *
</span><span class="cx"> * @uses bp_get_root_blog_id()
</span><del>- * @param string $option_name The option to be retrieved
- * @param string $default Optional. Default value to be returned if the option isn't set
- * @return mixed The value for the option
</del><ins>+ *
+ * @param string $option_name The option to be retrieved.
+ * @param string $default Optional. Default value to be returned if the option
+ * isn't set. See {@link get_blog_option()}.
+ * @return mixed The value for the option.
</ins><span class="cx"> */
</span><span class="cx"> function bp_get_option( $option_name, $default = '' ) {
</span><span class="cx"> $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
</span><span class="lines">@@ -208,46 +215,49 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Save an option
</del><ins>+ * Save an option.
</ins><span class="cx"> *
</span><del>- * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)
- * on the appropriate blog, given your current setup.
</del><ins>+ * This is a wrapper for {@link update_blog_option()}, which in turn stores
+ * settings data (such as bp-pages) on the appropriate blog, given your current
+ * setup.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress
- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
</ins><span class="cx"> *
</span><span class="cx"> * @uses bp_get_root_blog_id()
</span><del>- * @param string $option_name The option key to be set
- * @param string $value The value to be set
</del><ins>+ *
+ * @param string $option_name The option key to be set.
+ * @param string $value The value to be set.
</ins><span class="cx"> */
</span><span class="cx"> function bp_update_option( $option_name, $value ) {
</span><span class="cx"> update_blog_option( bp_get_root_blog_id(), $option_name, $value );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Delete an option
</del><ins>+ * Delete an option.
</ins><span class="cx"> *
</span><del>- * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as
- * bp-pages) on the appropriate blog, given your current setup.
</del><ins>+ * This is a wrapper for {@link delete_blog_option()}, which in turn deletes
+ * settings data (such as bp-pages) on the appropriate blog, given your current
+ * setup.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress
- * @since BuddyPress (1.5)
</del><ins>+ * @since BuddyPress (1.5.0)
</ins><span class="cx"> *
</span><span class="cx"> * @uses bp_get_root_blog_id()
</span><del>- * @param string $option_name The option key to be set
</del><ins>+ *
+ * @param string $option_name The option key to be deleted.
</ins><span class="cx"> */
</span><span class="cx"> function bp_delete_option( $option_name ) {
</span><span class="cx"> delete_blog_option( bp_get_root_blog_id(), $option_name );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * When switching from single to multisite we need to copy blog options to
- * site options.
</del><ins>+ * Copy BP options from a single site to multisite config.
</ins><span class="cx"> *
</span><del>- * This function is no longer used
</del><ins>+ * Run when switching from single to multisite and we need to copy blog options
+ * to site options.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress Core
- * @deprecated Since BuddyPress (1.6)
</del><ins>+ * This function is no longer used.
+ *
+ * @deprecated 1.6.0
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_activate_site_options( $keys = array() ) {
</span><span class="cx"> global $bp;
</span><span class="lines">@@ -274,12 +284,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Fetch global BP options.
+ *
</ins><span class="cx"> * BuddyPress uses common options to store configuration settings. Many of these
</span><span class="cx"> * settings are needed at run time. Instead of fetching them all and adding many
</span><span class="cx"> * initial queries to each page load, let's fetch them all in one go.
</span><span class="cx"> *
</span><del>- * @package BuddyPress Core
- * @todo Use settings API and audit these methods
</del><ins>+ * @todo Use settings API and audit these methods.
+ *
+ * @return array $root_blog_options_meta List of options.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_get_root_options() {
</span><span class="cx"> global $wpdb;
</span><span class="lines">@@ -375,12 +388,13 @@
</span><span class="cx"> /**
</span><span class="cx"> * Is profile sycing disabled?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional.Default value true
</del><ins>+ * @uses bp_get_option() To get the profile sync option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the profile sync option
- * @return bool Is profile sync enabled or not
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if profile sync is enabled, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_disable_profile_sync( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
</span><span class="lines">@@ -389,12 +403,14 @@
</span><span class="cx"> /**
</span><span class="cx"> * Is the Toolbar hidden for logged out users?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional.Default value true
</del><ins>+ * @uses bp_get_option() To get the logged out Toolbar option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the logged out Toolbar option
- * @return bool Is logged out Toolbar enabled or not
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if the admin bar should be hidden for logged-out users,
+ * otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_hide_loggedout_adminbar( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );
</span><span class="lines">@@ -403,12 +419,13 @@
</span><span class="cx"> /**
</span><span class="cx"> * Are members able to upload their own avatars?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value true
</del><ins>+ * @uses bp_get_option() To get the avatar uploads option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the avatar uploads option
- * @return bool Are avatar uploads allowed?
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if avatar uploads are disabled, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_disable_avatar_uploads( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );
</span><span class="lines">@@ -417,12 +434,14 @@
</span><span class="cx"> /**
</span><span class="cx"> * Are members able to delete their own accounts?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value
</del><ins>+ * @uses bp_get_option() To get the account deletion option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the account deletion option
- * @return bool Is account deletion allowed?
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if users are able to delete their own accounts, otherwise
+ * false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_disable_account_deletion( $default = false ) {
</span><span class="cx"> return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) );
</span><span class="lines">@@ -431,12 +450,15 @@
</span><span class="cx"> /**
</span><span class="cx"> * Are blog and forum activity stream comments disabled?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value false
- * @todo split and move into blog and forum components
- * @uses bp_get_option() To get the blog/forum comments option
- * @return bool Is blog/forum comments allowed?
</del><ins>+ * @todo split and move into blog and forum components.
+ * @uses bp_get_option() To get the blog/forum comments option.
+ *
+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: false.
+ * @return bool True if activity comments are disabled for blog and forum
+ * items, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_disable_blogforum_comments( $default = false ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) );
</span><span class="lines">@@ -445,93 +467,98 @@
</span><span class="cx"> /**
</span><span class="cx"> * Is group creation turned off?
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value true
</del><ins>+ * @todo Move into groups component.
+ * @uses bp_get_option() To get the group creation.
</ins><span class="cx"> *
</span><del>- * @todo Move into groups component
- * @uses bp_get_option() To get the group creation
- * @return bool Allow group creation?
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if group creation is restricted, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_restrict_group_creation( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Have we migrated to using the WordPress Toolbar?
</del><ins>+ * Should the old BuddyBar be forced in place of the WP admin bar?
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value true
</del><ins>+ * @uses bp_get_option() To get the BuddyBar option.
</ins><span class="cx"> *
</span><del>- * @todo Move into groups component
- * @uses bp_get_option() To get the WP editor option
- * @return bool Use WP editor?
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if the BuddyBar should be forced on, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_force_buddybar( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Output the group forums root parent forum id
</del><ins>+ * Output the group forums root parent forum id.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value
</del><ins>+ * @param bool $default Optional. Default: '0'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_group_forums_root_id( $default = '0' ) {
</span><span class="cx"> echo bp_get_group_forums_root_id( $default );
</span><span class="cx"> }
</span><span class="cx"> /**
</span><del>- * Return the group forums root parent forum id
</del><ins>+ * Return the group forums root parent forum id.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value 0
</del><ins>+ * @uses bp_get_option() To get the root forum ID from the database.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the maximum title length
- * @return int Is anonymous posting allowed?
</del><ins>+ * @param bool $default Optional. Default: '0'.
+ * @return int The ID of the group forums root forum.
</ins><span class="cx"> */
</span><span class="cx"> function bp_get_group_forums_root_id( $default = '0' ) {
</span><span class="cx"> return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bp_group_forums_root_id', $default ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Checks if BuddyPress Group Forums are enabled
</del><ins>+ * Check whether BuddyPress Group Forums are enabled.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value true
</del><ins>+ * @uses bp_get_option() To get the group forums option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the group forums option
- * @return bool Is group forums enabled or not
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if group forums are active, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_is_group_forums_active( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bp_enable_group_forums', $default ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Checks if Akismet is enabled
</del><ins>+ * Check whether Akismet is enabled.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @param bool $default Optional. Default value true
</del><ins>+ * @uses bp_get_option() To get the Akismet option.
</ins><span class="cx"> *
</span><del>- * @uses bp_get_option() To get the Akismet option
- * @return bool Is Akismet enabled or not
</del><ins>+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: true.
+ * @return bool True if Akismet is enabled, otherwise false.
</ins><span class="cx"> */
</span><span class="cx"> function bp_is_akismet_active( $default = true ) {
</span><span class="cx"> return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Get the current theme package ID
</del><ins>+ * Get the current theme package ID.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
</del><ins>+ * @since BuddyPress (1.7.0)
</ins><span class="cx"> *
</span><del>- * @param string $default Optional. Default value 'default'
- * @uses get_option() To get the subtheme option
- * @return string ID of the subtheme
</del><ins>+ * @uses get_option() To get the theme package option.
+ *
+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Default: 'legacy'.
+ * @return string ID of the theme package.
</ins><span class="cx"> */
</span><span class="cx"> function bp_get_theme_package_id( $default = 'legacy' ) {
</span><span class="cx"> return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $default ) );
</span></span></pre>
</div>
</div>
</body>
</html>