bp_get_options_nav_<css_id>

Filters the "options nav", the secondary-level single item navigation menu.

Description

This is a dynamic filter that is dependent on the provided css_id value.

Parameters (3)

0. $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li — Optional. (string) => '
  • ' . $subnav_item->name . '
  • '
    The li id esc attr subnav item css id list type li selected a id esc attr subnav item css id href esc url subnav item link subnav item name a li.
    1. $subnav_item (array)
    Submenu array item being displayed.
    2. $selected_item (string)
    The selected item.

    Usage

    To run the hook, copy the example below.
    1. $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li = apply_filters( 'bp_get_options_nav_{$css_id}', $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li, $subnav_item, $selected_item ); 
    2.  
    3. if ( !empty( $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li ) ) { 
    4.  
    5. // everything has led up to this point... 
    6.  
    7.  
    The following example is for adding a hook callback.
    1. // define the bp_get_options_nav_<css_id> callback 
    2. function filter_bp_get_options_nav_css_id( $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li, $subnav_item, $selected_item ) { 
    3. // make filter magic happen here... 
    4. return $li_id_esc_attr_subnav_item_css_id_list_type_li_selected_a_id_esc_attr_subnav_item_css_id_href_esc_url_subnav_item_link_subnav_item_name_a_li
    5. }; 
    6.  
    7. // add the filter 
    8. add_filter( "bp_get_options_nav_{$css_id}", 'filter_bp_get_options_nav_css_id', 10, 3 ); 
    To remove a hook callback, use the example below.
    1. // remove the filter 
    2. remove_filter( "bp_get_options_nav_{$css_id}", 'filter_bp_get_options_nav_css_id', 10, 3 ); 

    Defined (1)

    The filter is defined in the following location(s).

    /bp-core/bp-core-template.php  
    1. echo apply_filters( 'bp_get_options_nav_' . $subnav_item->css_id, '<li id="' . esc_attr( $subnav_item->css_id . '-' . $list_type . '-li' ) . '" ' . $selected . '><a id="' . esc_attr( $subnav_item->css_id ) . '" href="' . esc_url( $subnav_item->link ) . '">' . $subnav_item->name . '</a></li>', $subnav_item, $selected_item );