Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/08/2011 06:35:03 AM (13 years ago)
Author:
johnjamesjacoby
Message:

More auditing of _slug and _root_slug functions.

Introduce functions for updating '$bp->is_' globals to prevent loading $bp global in several functions.

Various phpDoc fixes and whitespace clean-up. (1.3 trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r4053 r4088  
    762762    bp_core_update_page_meta( $page_ids );
    763763}
     764
     765/** Global Manipulators *******************************************************/
     766
     767/**
     768 * Set the $bp->is_directory global
     769 *
     770 * @global obj $bp
     771 * @param bool $is_directory
     772 * @param str $component
     773 */
     774function bp_update_is_directory( $is_directory = false, $component = '' ) {
     775    global $bp;
     776
     777    if ( empty( $component ) )
     778        $component = bp_current_component();
     779
     780    $bp->is_directory = apply_filters( 'bp_update_is_directory', $is_directory, $component );
     781}
     782
     783/**
     784 * Set the $bp->is_item_admin global
     785 *
     786 * @global obj $bp
     787 * @param bool $is_item_admin
     788 * @param str $component
     789 */
     790function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) {
     791    global $bp;
     792
     793    if ( empty( $component ) )
     794        $component = bp_current_component();
     795
     796    $bp->is_item_admin = apply_filters( 'bp_update_is_item_admin', $is_item_admin, $component );
     797}
     798
     799/**
     800 * Set the $bp->is_item_mod global
     801 *
     802 * @global obj $bp
     803 * @param bool $is_item_mod
     804 * @param str $component
     805 */
     806function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
     807    global $bp;
     808
     809    if ( empty( $component ) )
     810        $component = bp_current_component();
     811
     812    $bp->is_item_mod = apply_filters( 'bp_update_is_item_mod', $is_item_mod, $component );
     813}
     814
    764815?>
Note: See TracChangeset for help on using the changeset viewer.