Skip to:
Content

BuddyPress.org

Ticket #7345: 7345.patch

File 7345.patch, 2.6 KB (added by slaFFik, 8 years ago)
  • src/bp-core/bp-core-buddybar.php

     
    9090 * Add a link to the main BuddyPress navigation.
    9191 *
    9292 * @since 2.4.0
    93  * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Nav_Item object on success.
     93 * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Core_Nav_Item object on success.
    9494 *
    9595 * @param array|string $args {
    9696 *     Array describing the new nav item.
     
    108108 *                                                item is clicked.
    109109 * }
    110110 * @param string       $component Optional. Component that the nav belongs to.
    111  * @return bool|BP_Nav_Item Returns false on failure, new nav item on success.
     111 * @return bool|BP_Core_Nav_Item Returns false on failure, new nav item on success.
    112112 */
    113113function bp_core_create_nav_link( $args = '', $component = 'members' ) {
    114114        $bp = buddypress();
     
    446446 * Add a subnav link to the BuddyPress navigation.
    447447 *
    448448 * @since 2.4.0
    449  * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Nav_Item object on success.
     449 * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Core_Nav_Item object on success.
    450450 *
    451451 * @param array|string $args {
    452452 *     Array describing the new subnav item.
     
    475475 *                                          Default: false.
    476476 * }
    477477 * @param string       $component The component the navigation is attached to. Defaults to 'members'.
    478  * @return bool|object Returns false on failure, new BP_Nav_Item instance on success.
     478 * @return bool|object Returns false on failure, new BP_Core_Nav_Item instance on success.
    479479 */
    480480function bp_core_create_subnav_link( $args = '', $component = 'members' ) {
    481481        $bp = buddypress();
  • src/bp-core/classes/class-bp-core-nav-item.php

     
    33// Exit if accessed directly.
    44defined( 'ABSPATH' ) || exit;
    55
    6 if ( class_exists( 'ArrayObject' ) ) :
    7 
    86/**
    97 * Navigation item.
    108 *
     
    1513                parent::__construct( $data, ArrayObject::ARRAY_AS_PROPS );
    1614        }
    1715}
    18 
    19 else :
    20 
    21 /**
    22  * Navigation item.
    23  *
    24  * @since 2.6.0
    25  */
    26 class BP_Core_Nav_Item {
    27         public function __construct( $data ) {
    28                 foreach ( $data as $key => $value ) {
    29                         $this->key = $value;
    30                 }
    31         }
    32 }
    33 
    34 endif;