[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-forums/bbpress/ -> edit.php (source)

   1  <?php
   2  require ('./bb-load.php');
   3  
   4  bb_auth('logged_in');
   5  
   6  $post_id = (int) $_GET['id'];
   7  
   8  $bb_post  = bb_get_post( $post_id );
   9  
  10  if ( !$bb_post || !bb_current_user_can( 'edit_post', $post_id ) ) {
  11      wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
  12      die();
  13  }
  14  
  15  if ( 0 != $bb_post->post_status && 'all' == $_GET['view'] ) // We're trying to edit a deleted post
  16      add_filter('bb_is_first_where', 'bb_no_where');
  17  
  18  $topic = get_topic( $bb_post->topic_id );
  19  
  20  if ( bb_is_first( $bb_post->post_id ) && bb_current_user_can( 'edit_topic', $topic->topic_id ) ) 
  21      $topic_title = $topic->topic_title;
  22  else 
  23      $topic_title = false;
  24  
  25  
  26  bb_load_template( 'edit-post.php', array('topic_title') );
  27  
  28  ?>


Generated: Thu Dec 7 01:01:35 2017 Cross-referenced by PHPXref 0.7.1