Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/02/2013 02:53:12 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Allow bp_core_admin_tabs() to be filtered.

File:
1 edited

Legend:

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

    r7567 r7630  
    384384    // If forums component is active, add additional tab
    385385    if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
     386
    386387        // enqueue thickbox
    387388        wp_enqueue_script( 'thickbox' );
     
    394395    }
    395396
     397    // Allow the tabs to be filtered
     398    $tabs = apply_filters( 'bp_core_admin_tabs', $tabs );
     399
    396400    // Loop through tabs and build navigation
    397401    foreach ( array_values( $tabs ) as $tab_data ) {
    398402        $is_current = (bool) ( $tab_data['name'] == $active_tab );
    399403        $tab_class  = $is_current ? $active_class : $idle_class;
    400         $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>';
     404        $tabs_html .= '<a href="' . esc_url( $tab_data['href'] ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab_data['name'] ) . '</a>';
    401405    }
    402406
Note: See TracChangeset for help on using the changeset viewer.