bb_admin_list_posts

Posts.

Description

bb_admin_list_posts(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php  
  1. function bb_admin_list_posts() { 
  2. global $bb_posts, $bb_post; 
  3.  
  4. if ( !$bb_posts ) { 
  5. ?> 
  6. <p class="no-results"><?php _e('No posts found.'); ?></p> 
  7. <?php 
  8. } else { 
  9. ?> 
  10. <table id="posts-list" class="widefat" cellspacing="0" cellpadding="0"> 
  11. <thead> 
  12. <tr> 
  13. <th scope="col" class="check-column"><input type="checkbox" /></th> 
  14. <th scope="col"><?php _e( 'Post' ); ?></th> 
  15. <th scope="col"><?php _e( 'Author' ); ?></th> 
  16. <th scope="col"><?php _e( 'Topic' ); ?></th> 
  17. <th scope="col"><?php _e( 'Date' ); ?></th> 
  18. </tr> 
  19. </thead> 
  20. <tfoot> 
  21. <tr> 
  22. <th scope="col" class="check-column"><input type="checkbox" /></th> 
  23. <th scope="col"><?php _e( 'Post' ); ?></th> 
  24. <th scope="col"><?php _e( 'Author' ); ?></th> 
  25. <th scope="col"><?php _e( 'Topic' ); ?></th> 
  26. <th scope="col"><?php _e( 'Date' ); ?></th> 
  27. </tr> 
  28. </tfoot> 
  29. <tbody> 
  30. <?php 
  31. foreach ( $bb_posts as $bb_post ) { 
  32. ?> 
  33. <tr id="post-<?php post_id(); ?>"<?php alt_class('post', post_del_class()); ?>> 
  34. <td class="check-column"><input type="checkbox" name="post[]" value="<?php post_id(); ?>" /></td> 
  35. <td class="post"> 
  36. <?php post_text(); ?> 
  37. <div> 
  38. <span class="row-actions"> 
  39. <a href="<?php echo esc_url( get_post_link() ); ?>"><?php _e( 'View' ); ?></a> 
  40. <?php 
  41. bb_post_admin( array( 
  42. 'before_each' => ' | ',  
  43. 'each' => array( 
  44. 'undelete' => array( 
  45. 'before' => ' ' 
  46. ),  
  47. 'last_each' => array( 
  48. 'before' => ' | ' 
  49. ) ); 
  50. ?> 
  51. </span>  
  52. </div> 
  53. </td> 
  54.  
  55. <td class="author"> 
  56. <?php if ( get_post_author_id() ) : ?> 
  57.  
  58. <a href="<?php user_profile_link( get_post_author_id() ); ?>"> 
  59. <?php post_author_avatar( '16' ); ?> 
  60. <?php post_author(); ?> 
  61. </a> 
  62.  
  63. <?php else : ?> 
  64.  
  65. <span> 
  66. <?php post_author_avatar( '16' ); ?> 
  67. <?php post_author(); ?> 
  68. </span> 
  69.  
  70. <?php endif; ?> 
  71. </td> 
  72.  
  73. <td class="topic"> 
  74. <a href="<?php topic_link( $bb_post->topic_id ); ?>"><?php topic_title( $bb_post->topic_id ); ?></a> 
  75. </td> 
  76.  
  77. <td class="date"> 
  78. <?php 
  79. if ( bb_get_post_time( 'U' ) < ( time() - 86400 ) ) { 
  80. bb_post_time( 'Y/m/d\<\b\r \/\>H:i:s' ); 
  81. } else { 
  82. printf( __( '%s ago' ), bb_get_post_time( 'since' ) ); 
  83. ?> 
  84. </td> 
  85. </tr> 
  86. <?php  
  87. ?> 
  88. </tbody> 
  89. </table> 
  90. <?php