bb_admin_theme_row

The BuddyPress bb admin theme row function.

Description

bb_admin_theme_row( $theme, $position ); 

Parameters (2)

0. $theme
The theme.
1. $position
The position.

Usage

  1. if ( !function_exists( 'bb_admin_theme_row' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/themes.php'; 
  3.  
  4. // The theme. 
  5. $theme = null; 
  6.  
  7. // The position. 
  8. $position = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_admin_theme_row($theme, $position); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/themes.php  
  1. function bb_admin_theme_row( $theme, $position ) { 
  2. $theme_directory = bb_get_theme_directory( $theme ); 
  3. $theme_data = file_exists( $theme_directory . 'style.css' ) ? bb_get_theme_data( $theme ) : false; 
  4. $screen_shot = file_exists( $theme_directory . 'screenshot.png' ) ? esc_url( bb_get_theme_uri( $theme ) . 'screenshot.png' ) : false; 
  5. $activation_url = bb_get_uri('bb-admin/themes.php', array('theme' => urlencode($theme)), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN); 
  6. $activation_url = esc_url( bb_nonce_url( $activation_url, 'switch-theme' ) ); 
  7.  
  8. if ( 1 === $position || 0 === $position ) { 
  9. echo '<tr>'; 
  10. ?> 
  11. <td class="position-<?php echo( (int) $position ); ?>"> 
  12. <div class="screen-shot"><?php if ( $screen_shot ) : ?><a href="<?php echo $activation_url; ?>" title="<?php echo esc_attr( sprintf( __( 'Activate "%s"' ), $theme_data['Title'] ) ); ?>"><img alt="<?php echo esc_attr( $theme_data['Title'] ); ?>" src="<?php echo $screen_shot; ?>" /></a><?php endif; ?></div> 
  13. <div class="description"> 
  14. <h3 class="themes"> 
  15. <?php 
  16. printf( 
  17. __( '%1$s %2$s by <cite>%3$s</cite>' ),  
  18. $theme_data['Title'],  
  19. $theme_data['Version'],  
  20. $theme_data['Author'] 
  21. ); 
  22. ?> 
  23. </h3> 
  24.  
  25. <?php 
  26. if ( $theme_data['Porter'] ) { 
  27. ?> 
  28. <p> 
  29. <?php 
  30. printf( 
  31. __( 'Ported by <cite>%s</cite>' ),  
  32. $theme_data['Porter'] 
  33. ); 
  34. ?> 
  35. </p> 
  36. <?php 
  37. ?> 
  38.  
  39. <?php echo $theme_data['Description']; // Description is autop'ed ?> 
  40. <?php 
  41. if ( 0 !== $position ) { 
  42. ?> 
  43. <div class="actions"> 
  44. <a href="<?php echo $activation_url; ?>" title="<?php echo esc_attr( sprintf( __( 'Activate "%s"' ), $theme_data['Title'] ) ); ?>"><?php _e( 'Activate' ); ?></a> 
  45. </div> 
  46. <?php 
  47. ?> 
  48. <p class="location"><?php printf(__('All of this theme\'s files are located in the "%s" themes directory.'), $theme_data['Location']); ?></p> 
  49. </div> 
  50. </td> 
  51. <?php 
  52.  
  53. if ( 3 === $position || 0 === $position ) { 
  54. echo '</tr>';