bbp_get_tab_index

Output the current tab index of a given form.

Description

(int) bbp_get_tab_index( (bool) $auto_increment = true ); 

Use this function to handle the tab indexing of user facing forms within a template file. Calling this function will automatically increment the global tab index by default.

Returns (int)

$bbp->tab_index The global tab index

Parameters (1)

0. $auto_increment — Optional. (bool) => true
Default true. Set to false to prevent the increment

Usage

  1. if ( !function_exists( 'bbp_get_tab_index' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/template.php'; 
  3.  
  4. // Optional. Default true. Set to false to 
  5. // prevent the increment 
  6. $auto_increment = true; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = bbp_get_tab_index($auto_increment); 
  10.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_get_tab_index( $auto_increment = true ) { 
  2. $bbp =bbpress); 
  3.  
  4. if ( true === $auto_increment ) 
  5. ++$bbp->tab_index; 
  6.  
  7. return apply_filters( 'bbp_get_tab_index', (int) $bbp->tab_index );