Skip to:
Content

BuddyPress.org

Changeset 9585


Ignore:
Timestamp:
03/03/2015 04:15:21 AM (12 years ago)
Author:
tw2113
Message:

Adding hook documentation to class-bp-walker-nav-menu.php.

See #5940.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-walker-nav-menu.php

    r9486 r9585  
    151151                $indent = $depth ? str_repeat( "\t", $depth ) : '';
    152152
    153                 // Add HTML classes
     153                /**
     154                 * Filters the classes to be added to the nav menu markup.
     155                 *
     156                 * @since BuddyPress (1.7.0)
     157                 *
     158                 * @param array  $value Array of classes to be added.
     159                 * @param object $item  Menu item data object.
     160                 * @param array  $args  Array of arguments for the item.
     161                 */
    154162                $class_names = join( ' ', apply_filters( 'bp_nav_menu_css_class', array_filter( $item->class ), $item, $args ) );
    155163                $class_names = ! empty( $class_names ) ? ' class="' . esc_attr( $class_names ) . '"' : '';
    … …  
    157165                // Add HTML ID
    158166                $id = sanitize_html_class( $item->css_id . '-personal-li' );  // Backpat with BP pre-1.7
     167
     168                /**
     169                 * Filters the value to be used for the nav menu ID attribute.
     170                 *
     171                 * @since BuddyPress (1.7.0)
     172                 *
     173                 * @param string $id   ID attribute to be added to the menu item.
     174                 * @param object $item Menu item data object.
     175                 * @param array  $args Array of arguments for the item.
     176                 */
    159177                $id = apply_filters( 'bp_nav_menu_item_id', $id, $item, $args );
    160178                $id = ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
    … …  
    169187                $item_output = $args->before;
    170188                $item_output .= '<a' . $attributes . '>';
     189
     190                /**
     191                 * Filters the link text to be added to the item output.
     192                 *
     193                 * @since BuddyPress (1.7.0)
     194                 *
     195                 * @param string $name  Item text to be applied.
     196                 * @param int    $value Post ID the title is for.
     197                 */
    171198                $item_output .= $args->link_before . apply_filters( 'the_title', $item->name, 0 ) . $args->link_after;
    172199                $item_output .= '</a>';
    173200                $item_output .= $args->after;
    174201
    175                 // $output is byref
     202                /**
     203                 * Filters the final result for the menu item.
     204                 *
     205                 * @since BuddyPress (1.7.0)
     206                 *
     207                 * @param string $item_output Constructed output for the menu item to append to output.
     208                 * @param object $item        Menu item data object.
     209                 * @param int    $depth       Depth of menu item. Used for padding.
     210                 * @param array  $args        Array of arguments for the item.
     211                 */
    176212                $output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    177213        }
Note: See TracChangeset for help on using the changeset viewer.