<!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][7446] 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/7446">7446</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2013-10-19 18:41:17 +0000 (Sat, 19 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="#trunkbpcorebpcorecssjsphp">trunk/bp-core/bp-core-cssjs.php</a></li>
<li><a href="#trunkbpcorebpcoredependencyphp">trunk/bp-core/bp-core-dependency.php</a></li>
<li><a href="#trunkbpcorebpcorefiltersphp">trunk/bp-core/bp-core-filters.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcorecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-cssjs.php (7445 => 7446)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-cssjs.php 2013-10-19 13:21:35 UTC (rev 7445)
+++ trunk/bp-core/bp-core-cssjs.php 2013-10-19 18:41:17 UTC (rev 7446)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> <?php
</span><span class="cx"> /**
</span><del>- * Core component CSS & JS
</del><ins>+ * Core component CSS & JS.
</ins><span class="cx"> *
</span><span class="cx"> * @package BuddyPress
</span><span class="cx"> * @subpackage Core
</span><span class="lines">@@ -9,6 +9,9 @@
</span><span class="cx"> // Exit if accessed directly
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><ins>+/**
+ * Load the JS for "Are you sure?" .confirm links.
+ */
</ins><span class="cx"> function bp_core_confirmation_js() {
</span><span class="cx">
</span><span class="cx"> if ( is_multisite() && ! bp_is_root_blog() )
</span><span class="lines">@@ -35,11 +38,7 @@
</span><span class="cx"> add_action( 'admin_head', 'bp_core_confirmation_js', 100 );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_add_jquery_cropper()
- *
- * Makes sure the jQuery jCrop library is loaded.
- *
- * @package BuddyPress Core
</del><ins>+ * Enqueues jCrop library and hooks BP's custom cropper JS.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_add_jquery_cropper() {
</span><span class="cx"> wp_enqueue_style( 'jcrop' );
</span><span class="lines">@@ -49,11 +48,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_add_cropper_inline_js()
- *
- * Adds the inline JS needed for the cropper to work on a per-page basis.
- *
- * @package BuddyPress Core
</del><ins>+ * Output the inline JS needed for the cropper to work on a per-page basis.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_add_cropper_inline_js() {
</span><span class="cx">
</span><span class="lines">@@ -119,10 +114,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_add_cropper_inline_css()
</del><ins>+ * Output the inline CSS for the BP image cropper.
</ins><span class="cx"> *
</span><del>- * Adds the inline CSS needed for the cropper to work on a per-page basis.
- *
</del><span class="cx"> * @package BuddyPress Core
</span><span class="cx"> */
</span><span class="cx"> function bp_core_add_cropper_inline_css() {
</span><span class="lines">@@ -143,9 +136,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Adds AJAX target URL so themes can access the WordPress AJAX functionality.
</del><ins>+ * Define the 'ajaxurl' JS variable, used by themes as an AJAX endpoint.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.1)
</del><ins>+ * @since BuddyPress (1.1.0)
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_add_ajax_url_js() {
</span><span class="cx"> ?>
</span><span class="lines">@@ -157,14 +150,14 @@
</span><span class="cx"> add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Returns the proper value for BP's ajaxurl
</del><ins>+ * Get the proper value for BP's ajaxurl.
</ins><span class="cx"> *
</span><span class="cx"> * Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite
</span><span class="cx"> * configurations.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
</del><ins>+ * @since BuddyPress (1.7.0)
</ins><span class="cx"> *
</span><del>- * @return string
</del><ins>+ * @return string AJAX endpoint URL.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_ajax_url() {
</span><span class="cx"> return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
</span></span></pre></div>
<a id="trunkbpcorebpcoredependencyphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-dependency.php (7445 => 7446)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-dependency.php 2013-10-19 13:21:35 UTC (rev 7445)
+++ trunk/bp-core/bp-core-dependency.php 2013-10-19 18:41:17 UTC (rev 7446)
</span><span class="lines">@@ -1,52 +1,52 @@
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Plugin Dependency
</del><ins>+ * Plugin Dependency Action Hooks.
</ins><span class="cx"> *
</span><span class="cx"> * The purpose of the following hooks is to mimic the behavior of something
</span><span class="cx"> * called 'plugin dependency' which enables a plugin to have plugins of their
</span><span class="cx"> * own in a safe and reliable way.
</span><span class="cx"> *
</span><del>- * We do this in BuddyPress by mirroring existing WordPress hookss in many places
</del><ins>+ * We do this in BuddyPress by mirroring existing WordPress hooks in many places
</ins><span class="cx"> * allowing dependant plugins to hook into the BuddyPress specific ones, thus
</span><span class="cx"> * guaranteeing proper code execution only when BuddyPress is active.
</span><span class="cx"> *
</span><del>- * The following functions are wrappers for hookss, allowing them to be
</del><ins>+ * The following functions are wrappers for hooks, allowing them to be
</ins><span class="cx"> * manually called and/or piggy-backed on top of other hooks if needed.
</span><span class="cx"> *
</span><span class="cx"> * @todo use anonymous functions when PHP minimun requirement allows (5.3)
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Include files on this action
</del><ins>+ * Fire the 'bp_include' action, where plugins should include files.
</ins><span class="cx"> */
</span><span class="cx"> function bp_include() {
</span><span class="cx"> do_action( 'bp_include' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Include files on this action
</del><ins>+ * Fire the 'bp_setup_components' action, where plugins should initialize components.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_components() {
</span><span class="cx"> do_action( 'bp_setup_components' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Setup global variables and objects
</del><ins>+ * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_globals() {
</span><span class="cx"> do_action( 'bp_setup_globals' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Set navigation elements
</del><ins>+ * Fire the 'bp_setup_nav' action, where plugins should register their navigation items.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_nav() {
</span><span class="cx"> do_action( 'bp_setup_nav' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Set up BuddyPress implementation of the WP Toolbar
</del><ins>+ * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_admin_bar() {
</span><span class="cx"> if ( bp_use_wp_admin_bar() )
</span><span class="lines">@@ -54,24 +54,24 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Set the page title
</del><ins>+ * Fire the 'bp_setup_title' action, where plugins should modify the page title.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_title() {
</span><span class="cx"> do_action( 'bp_setup_title' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Register widgets
</del><ins>+ * Fire the 'bp_register_widgets' action, where plugins should register widgets.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_widgets() {
</span><span class="cx"> do_action( 'bp_register_widgets' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Setup the currently logged-in user
</del><ins>+ * Set up the currently logged-in user.
</ins><span class="cx"> *
</span><del>- * @uses did_action() To make sure the user isn't loaded out of order
- * @uses do_action() Calls 'bp_setup_current_user'
</del><ins>+ * @uses did_action() To make sure the user isn't loaded out of order.
+ * @uses do_action() Calls 'bp_setup_current_user'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_current_user() {
</span><span class="cx">
</span><span class="lines">@@ -85,49 +85,63 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Initlialize code
</del><ins>+ * Fire the 'bp_init' action, BuddyPress's main initialization hook.
</ins><span class="cx"> */
</span><span class="cx"> function bp_init() {
</span><span class="cx"> do_action( 'bp_init' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Attached to plugins_loaded
</del><ins>+ * Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded.
+ *
+ * Attached to 'plugins_loaded'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_loaded() {
</span><span class="cx"> do_action( 'bp_loaded' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Attached to wp
</del><ins>+ * Fire the 'bp_ready' action, which runs after BP is set up and the page is about to render.
+ *
+ * Attached to 'wp'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_ready() {
</span><span class="cx"> do_action( 'bp_ready' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Attach potential template actions
</del><ins>+ * Fire the 'bp_actions' action, which runs just before rendering.
+ *
+ * Attach potential template actions, such as catching form requests or routing
+ * custom URLs.
</ins><span class="cx"> */
</span><span class="cx"> function bp_actions() {
</span><span class="cx"> do_action( 'bp_actions' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Attach potential template screens
</del><ins>+ * Fire the 'bp_screens' action, which runs just before rendering.
+ *
+ * Runs just after 'bp_actions'. Use this hook to attach your template
+ * loaders.
</ins><span class="cx"> */
</span><span class="cx"> function bp_screens() {
</span><span class="cx"> do_action( 'bp_screens' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Initialize widgets
</del><ins>+ * Fire 'bp_widgets_init', which runs after widgets have been set up.
+ *
+ * Hooked to 'widgets_init'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_widgets_init() {
</span><span class="cx"> do_action ( 'bp_widgets_init' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * BuddyPress head scripts
</del><ins>+ * Fire 'bp_head', which is used to hook scripts and styles in the <head>.
+ *
+ * Hooked to 'wp_head'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_head() {
</span><span class="cx"> do_action ( 'bp_head' );
</span><span class="lines">@@ -136,11 +150,14 @@
</span><span class="cx"> /** Theme Permissions *********************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * The main action used for redirecting BuddyPress theme actions that are not
- * permitted by the current_user
</del><ins>+ * Fire the 'bp_template_redirect' action.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * Run at 'template_redirect', just before WordPress selects and loads a theme
+ * template. The main purpose of this hook in BuddyPress is to redirect users
+ * who do not have the proper permission to access certain content.
</ins><span class="cx"> *
</span><ins>+ * @since BuddyPress (1.6.0)
+ *
</ins><span class="cx"> * @uses do_action()
</span><span class="cx"> */
</span><span class="cx"> function bp_template_redirect() {
</span><span class="lines">@@ -150,9 +167,12 @@
</span><span class="cx"> /** Theme Helpers *************************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * The main action used registering theme directory
</del><ins>+ * Fire the 'bp_register_theme_directory' action.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.5)
</del><ins>+ * The main action used registering theme directories.
+ *
+ * @since BuddyPress (1.5.0)
+ *
</ins><span class="cx"> * @uses do_action()
</span><span class="cx"> */
</span><span class="cx"> function bp_register_theme_directory() {
</span><span class="lines">@@ -160,9 +180,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * The main action used registering theme packages
</del><ins>+ * Fire the 'bp_register_theme_packages' action.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
</del><ins>+ * The main action used registering theme packages.
+ *
+ * @since BuddyPress (1.7.0)
+ *
</ins><span class="cx"> * @uses do_action()
</span><span class="cx"> */
</span><span class="cx"> function bp_register_theme_packages() {
</span><span class="lines">@@ -170,69 +193,76 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Enqueue BuddyPress specific CSS and JS
</del><ins>+ * Fire the 'bp_enqueue_scripts' action, where BP enqueues its CSS and JS.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @uses do_action() Calls 'bp_enqueue_scripts'
</del><ins>+ * @uses do_action() Calls 'bp_enqueue_scripts'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_enqueue_scripts() {
</span><span class="cx"> do_action ( 'bp_enqueue_scripts' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Add the BuddyPress-specific rewrite tags
</del><ins>+ * Fire the 'bp_add_rewrite_tag' action, where BP adds its custom rewrite tags.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.8)
- * @uses do_action() Calls 'bp_add_rewrite_tags'
</del><ins>+ * @since BuddyPress (1.8.0)
+ *
+ * @uses do_action() Calls 'bp_add_rewrite_tags'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_add_rewrite_tags() {
</span><span class="cx"> do_action( 'bp_add_rewrite_tags' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Add the BuddyPress-specific rewrite rules
</del><ins>+ * Fire the 'bp_add_rewrite_rules' action, where BP adds its custom rewrite rules.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.9)
- * @uses do_action() Calls 'bp_add_rewrite_rules'
</del><ins>+ * @since BuddyPress (1.9.0)
+ *
+ * @uses do_action() Calls 'bp_add_rewrite_rules'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_add_rewrite_rules() {
</span><span class="cx"> do_action( 'bp_add_rewrite_rules' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Add the BuddyPress-specific permalink structures
</del><ins>+ * Fire the 'bp_add_permastructs' action, where BP adds its BP-specific permalink structure.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.9)
- * @uses do_action() Calls 'bp_add_permastructs'
</del><ins>+ * @since BuddyPress (1.9.0)
+ *
+ * @uses do_action() Calls 'bp_add_permastructs'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_add_permastructs() {
</span><span class="cx"> do_action( 'bp_add_permastructs' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Piggy back action for BuddyPress sepecific theme actions before the theme has
- * been setup and the theme's functions.php has loaded.
</del><ins>+ * Fire the 'bp_setup_theme' action.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * The main purpose of 'bp_setup_theme' is give themes a place to load their
+ * BuddyPress-specific functionality.
</ins><span class="cx"> *
</span><del>- * @uses do_action() Calls 'bp_setup_theme'
</del><ins>+ * @since BuddyPress (1.6.0)
+ *
+ * @uses do_action() Calls 'bp_setup_theme'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_setup_theme() {
</span><span class="cx"> do_action ( 'bp_setup_theme' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Piggy back action for BuddyPress sepecific theme actions once the theme has
- * been setup and the theme's functions.php has loaded.
</del><ins>+ * Fire the 'bp_after_setup_theme' action.
</ins><span class="cx"> *
</span><ins>+ * Piggy-back action for BuddyPress-specific theme actions once the theme has
+ * been set up and the theme's functions.php has loaded.
+ *
</ins><span class="cx"> * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of
</span><span class="cx"> * time for other themes to load their features, such as BuddyPress support,
</span><span class="cx"> * before our theme compatibility layer kicks in.
</span><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.6.0)
</ins><span class="cx"> *
</span><del>- * @uses do_action() Calls 'bp_after_setup_theme'
</del><ins>+ * @uses do_action() Calls 'bp_after_setup_theme'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_after_setup_theme() {
</span><span class="cx"> do_action ( 'bp_after_setup_theme' );
</span><span class="lines">@@ -241,60 +271,69 @@
</span><span class="cx"> /** Theme Compatibility Filter ************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Piggy back filter for WordPress's 'request' filter
</del><ins>+ * Fire the 'bp_request' filter, a piggy-back of WP's 'request'.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
- * @param array $query_vars
- * @return array
</del><ins>+ * @since BuddyPress (1.7.0)
+ *
+ * @see WP::parse_request() for a description of parameters.
+ *
+ * @param array $query_vars See {@link WP::parse_request()}.
+ * @return array $query_vars See {@link WP::parse_request()}.
</ins><span class="cx"> */
</span><span class="cx"> function bp_request( $query_vars = array() ) {
</span><span class="cx"> return apply_filters( 'bp_request', $query_vars );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Piggy back filter to handle login redirects.
</del><ins>+ * Fire the 'bp_login_redirect' filter, a piggy-back of WP's 'login_redirect'.
</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 $redirect_to
- * @param string $redirect_to_raw
- * @param string $user
</del><ins>+ * @param string $redirect_to See 'login_redirect'.
+ * @param string $redirect_to_raw See 'login_redirect'.
+ * @param string $user See 'login_redirect'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) {
</span><span class="cx"> return apply_filters( 'bp_login_redirect', $redirect_to, $redirect_to_raw, $user );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * The main filter used for theme compatibility and displaying custom BuddyPress
- * theme files.
</del><ins>+ * Fire 'bp_template_include', main filter used for theme compatibility and displaying custom BP theme files.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * Hooked to 'template_include'.
</ins><span class="cx"> *
</span><ins>+ * @since BuddyPress (1.6.0)
+ *
</ins><span class="cx"> * @uses apply_filters()
</span><span class="cx"> *
</span><del>- * @param string $template
- * @return string Template file to use
</del><ins>+ * @param string $template See 'template_include'.
+ * @return string Template file to use.
</ins><span class="cx"> */
</span><span class="cx"> function bp_template_include( $template = '' ) {
</span><span class="cx"> return apply_filters( 'bp_template_include', $template );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Generate BuddyPress-specific rewrite rules
</del><ins>+ * Fire the 'bp_generate_rewrite_rules' filter, where BP generates its rewrite rules.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
- * @param WP_Rewrite $wp_rewrite
- * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}
</del><ins>+ * @since BuddyPress (1.7.0)
+ *
+ * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}.
+ *
+ * @param WP_Rewrite $wp_rewrite See 'generate_rewrite_rules'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_generate_rewrite_rules( $wp_rewrite ) {
</span><span class="cx"> do_action_ref_array( 'bp_generate_rewrite_rules', array( &$wp_rewrite ) );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Filter the allowed themes list for BuddyPress specific themes
</del><ins>+ * Fire the 'bp_allowed_themes' filter.
</ins><span class="cx"> *
</span><del>- * @since BuddyPress (1.7)
- * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list
</del><ins>+ * Filter the allowed themes list for BuddyPress-specific themes.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list.
</ins><span class="cx"> */
</span><span class="cx"> function bp_allowed_themes( $themes ) {
</span><span class="cx"> return apply_filters( 'bp_allowed_themes', $themes );
</span></span></pre></div>
<a id="trunkbpcorebpcorefiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-filters.php (7445 => 7446)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-filters.php 2013-10-19 13:21:35 UTC (rev 7445)
+++ trunk/bp-core/bp-core-filters.php 2013-10-19 18:41:17 UTC (rev 7446)
</span><span class="lines">@@ -1,13 +1,13 @@
</span><span class="cx"> <?php
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * BuddyPress Filters
</del><ins>+ * BuddyPress Filters.
</ins><span class="cx"> *
</span><del>- * This file contains the filters that are used through-out BuddyPress. They are
</del><ins>+ * This file contains the filters that are used throughout BuddyPress. They are
</ins><span class="cx"> * consolidated here to make searching for them easier, and to help developers
</span><span class="cx"> * understand at a glance the order in which things occur.
</span><span class="cx"> *
</span><del>- * There are a few common places that additional filters can currently be found
</del><ins>+ * There are a few common places that additional filters can currently be found.
</ins><span class="cx"> *
</span><span class="cx"> * - BuddyPress: In {@link BuddyPress::setup_actions()} in buddypress.php
</span><span class="cx"> * - Component: In {@link BP_Component::setup_actions()} in
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Attach BuddyPress to WordPress
</del><ins>+ * Attach BuddyPress to WordPress.
</ins><span class="cx"> *
</span><span class="cx"> * BuddyPress uses its own internal actions to help aid in third-party plugin
</span><span class="cx"> * development, and to limit the amount of potential future code changes when
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> add_filter( 'bp_core_render_message_content', 'wp_kses_data', 5 );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Template Compatibility
</del><ins>+ * Template Compatibility.
</ins><span class="cx"> *
</span><span class="cx"> * If you want to completely bypass this and manage your own custom BuddyPress
</span><span class="cx"> * template hierarchy, start here by removing this filter, then look at how
</span><span class="lines">@@ -69,13 +69,13 @@
</span><span class="cx"> add_filter( 'comments_open', 'bp_comments_open', 10, 2 );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_exclude_pages()
</del><ins>+ * Prevent specific pages (eg 'Activate') from showing on page listings.
</ins><span class="cx"> *
</span><del>- * Excludes specific pages from showing on page listings, for example the "Activation" page.
</del><ins>+ * @uses bp_is_active() checks if a BuddyPress component is active.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress Core
- * @uses bp_is_active() checks if a BuddyPress component is active.
- * @return array The list of page ID's to exclude
</del><ins>+ * @param array $pages List of excluded page IDs, as passed to the
+ * 'wp_list_pages_excludes' filter.
+ * @return array The exclude list, with BP's pages added.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_exclude_pages( $pages = array() ) {
</span><span class="cx">
</span><span class="lines">@@ -99,13 +99,11 @@
</span><span class="cx"> add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_email_from_name_filter()
</del><ins>+ * Set "From" name in outgoing email to the site name.
</ins><span class="cx"> *
</span><del>- * Sets the "From" name in emails sent to the name of the site and not "WordPress"
</del><ins>+ * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress Core
- * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table
- * @return string The blog name for the root blog
</del><ins>+ * @return string The blog name for the root blog.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_email_from_name_filter() {
</span><span class="cx"> return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
</span><span class="lines">@@ -113,11 +111,11 @@
</span><span class="cx"> add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_filter_comments()
- *
</del><span class="cx"> * Filter the blog post comments array and insert BuddyPress URLs for users.
</span><span class="cx"> *
</span><del>- * @package BuddyPress Core
</del><ins>+ * @param array $comments The array of comments supplied to the comments template.
+ * @param int $post->ID The post ID.
+ * @return array $comments The modified comment array.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_filter_comments( $comments, $post_id ) {
</span><span class="cx"> global $wpdb;
</span><span class="lines">@@ -150,17 +148,17 @@
</span><span class="cx"> add_filter( 'comments_array', 'bp_core_filter_comments', 10, 2 );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * When a user logs in, redirect him in a logical way
</del><ins>+ * When a user logs in, redirect him in a logical way.
</ins><span class="cx"> *
</span><del>- * @package BuddyPress Core
</del><ins>+ * @uses apply_filters() Filter 'bp_core_login_redirect' to modify where users
+ * are redirected to on login.
</ins><span class="cx"> *
</span><del>- * @uses apply_filters Filter bp_core_login_redirect to modify where users are redirected to on
- * login
- * @param string $redirect_to The URL to be redirected to, sanitized in wp-login.php
</del><ins>+ * @param string $redirect_to The URL to be redirected to, sanitized
+ * in wp-login.php.
</ins><span class="cx"> * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to'])
</span><del>- * @param WP_User $user The WP_User object corresponding to a successfully logged-in user. Otherwise
- * a WP_Error object
- * @return string The redirect URL
</del><ins>+ * @param WP_User $user The WP_User object corresponding to a successfully
+ * logged-in user. Otherwise a WP_Error object.
+ * @return string The redirect URL.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) {
</span><span class="cx">
</span><span class="lines">@@ -195,15 +193,18 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
</span><span class="cx">
</span><del>-/***
- * bp_core_filter_user_welcome_email()
</del><ins>+/**
+ * Replace the generated password in the welcome email with '[User Set]'.
</ins><span class="cx"> *
</span><del>- * Replace the generated password in the welcome email.
- * This will not filter when the site admin registers a user.
</del><ins>+ * On a standard BP installation, users who register themselves also set their
+ * own passwords. Therefore there is no need for the insecure practice of
+ * emailing the plaintext password to the user in the welcome email.
</ins><span class="cx"> *
</span><del>- * @uses locate_template To see if custom registration files exist
- * @param string $welcome_email Complete email passed through WordPress
- * @return string Filtered $welcome_email with 'PASSWORD' replaced by [User Set]
</del><ins>+ * This filter will not fire when a user is registered by the site admin.
+ *
+ * @param string $welcome_email Complete email passed through WordPress.
+ * @return string Filtered $welcome_email with the password replaced
+ * by '[User Set]'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_filter_user_welcome_email( $welcome_email ) {
</span><span class="cx">
</span><span class="lines">@@ -216,18 +217,20 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
</span><span class="cx">
</span><del>-/***
- * bp_core_filter_blog_welcome_email()
</del><ins>+/**
+ * Replace the generated password in the welcome email with '[User Set]'.
</ins><span class="cx"> *
</span><del>- * Replace the generated password in the welcome email.
- * This will not filter when the site admin registers a user.
</del><ins>+ * On a standard BP installation, users who register themselves also set their
+ * own passwords. Therefore there is no need for the insecure practice of
+ * emailing the plaintext password to the user in the welcome email.
</ins><span class="cx"> *
</span><del>- * @uses locate_template To see if custom registration files exist
- * @param string $welcome_email Complete email passed through WordPress
- * @param integer $blog_id ID of the blog user is joining
- * @param integer $user_id ID of the user joining
- * @param string $password Password of user
- * @return string Filtered $welcome_email with $password replaced by [User Set]
</del><ins>+ * This filter will not fire when a user is registered by the site admin.
+ *
+ * @param string $welcome_email Complete email passed through WordPress.
+ * @param int $blog_id ID of the blog user is joining.
+ * @param int $user_id ID of the user joining.
+ * @param string $password Password of user.
+ * @return string Filtered $welcome_email with $password replaced by '[User Set]'.
</ins><span class="cx"> */
</span><span class="cx"> function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
</span><span class="cx">
</span><span class="lines">@@ -240,7 +243,24 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 );
</span><span class="cx">
</span><del>-// Notify user of signup success.
</del><ins>+/**
+ * Notify new users of a successful registration (with blog).
+ *
+ * This function filter's WP's 'wpmu_signup_blog_notification', and replaces
+ * WP's default welcome email with a BuddyPress-specific message.
+ *
+ * @see wpmu_signup_blog_notification() for a description of parameters.
+ *
+ * @param string $domain The new blog domain.
+ * @param string $path The new blog path.
+ * @param string $title The site title.
+ * @param string $user The user's login name.
+ * @param string $user_email The user's email address.
+ * @param string $key The activation key created in wpmu_signup_blog()
+ * @param array $meta By default, contains the requested privacy setting and
+ * lang_id.
+ * @return bool True on success, false on failure.
+ */
</ins><span class="cx"> function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
</span><span class="cx">
</span><span class="cx"> // Send email with activation link.
</span><span class="lines">@@ -271,6 +291,17 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
</span><span class="cx">
</span><ins>+/**
+ * Notify new users of a successful registration (without blog).
+ *
+ * @see wpmu_signup_user_notification() for a full description of params.
+ *
+ * @param string $user The user's login name.
+ * @param string $user_email The user's email address.
+ * @param string $key The activation key created in wpmu_signup_user()
+ * @param array $meta By default, an empty array.
+ * @return bool True on success, false on failure.
+ */
</ins><span class="cx"> function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
</span><span class="cx">
</span><span class="cx"> $activate_url = bp_get_activation_page() . "?key=$key";
</span><span class="lines">@@ -300,15 +331,17 @@
</span><span class="cx"> add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Filter the page title for BuddyPress pages
</del><ins>+ * Filter the page title for BuddyPress pages.
</ins><span class="cx"> *
</span><del>- * @global object $bp BuddyPress global settings
- * @param string $title Original page title
</del><ins>+ * @since BuddyPress (1.5.0)
+ *
+ * @see wp_title()
+ * @global object $bp BuddyPress global settings.
+ *
+ * @param string $title Original page title.
</ins><span class="cx"> * @param string $sep How to separate the various items within the page title.
</span><del>- * @param string $seplocation Direction to display title
- * @return string new page title
- * @see wp_title()
- * @since BuddyPress (1.5)
</del><ins>+ * @param string $seplocation Direction to display title.
+ * @return string New page title.
</ins><span class="cx"> */
</span><span class="cx"> function bp_modify_page_title( $title, $sep, $seplocation ) {
</span><span class="cx"> global $bp;
</span></span></pre>
</div>
</div>
</body>
</html>