bb_get_generator

The BuddyPress bb get generator function.

Description

bb_get_generator( (string) $type = 'xhtml' ); 

Parameters (1)

0. $type — Optional. (string) => 'xhtml'
The type.

Usage

  1. if ( !function_exists( 'bb_get_generator' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The type. 
  5. $type = 'xhtml'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_generator($type); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_generator( $type = 'xhtml' ) 
  2. if ( !$type ) { 
  3. $type = 'xhtml'; 
  4. switch ( $type ) { 
  5. case 'html': 
  6. $gen = '<meta name="generator" content="bbPress ' . bb_get_option( 'version' ) . '">'; 
  7. break; 
  8. case 'xhtml': 
  9. $gen = '<meta name="generator" content="bbPress ' . bb_get_option( 'version' ) . '" />'; 
  10. break; 
  11. case 'atom': 
  12. $gen = '<generator uri="http://bbpress.org/" version="' . bb_get_option( 'version' ) . '">bbPress</generator>'; 
  13. break; 
  14. case 'rss2': 
  15. $gen = '<generator>http://bbpress.org/?v=' . bb_get_option( 'version' ) . '</generator>'; 
  16. break; 
  17. case 'rdf': 
  18. $gen = '<admin:generatorAgent rdf:resource="http://bbpress.org/?v=' . bb_get_option( 'version' ) . '" />'; 
  19. break; 
  20. case 'comment': 
  21. $gen = '<!-- generator="bbPress/' . bb_get_option( 'version' ) . '" -->'; 
  22. break; 
  23. case 'export': 
  24. $gen = '<!-- generator="bbPress/' . bb_get_option( 'version' ) . '" created="'. date( 'Y-m-d H:i' ) . '"-->'; 
  25. break; 
  26. return apply_filters( 'bb_get_generator', $gen, $type );