[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-forums/bbpress/bb-admin/ -> sticky.php (source)

   1  <?php
   2  require ('admin-action.php');
   3  
   4  $topic_id = (int) $_GET['id'];
   5  $topic    =  get_topic ( $topic_id );
   6  $super = ( isset($_GET['super']) && 1 == (int) $_GET['super'] ) ? 1 : 0;
   7  
   8  if ( !$topic )
   9      bb_die(__('There is a problem with that topic, pardner.'));
  10  
  11  if ( !bb_current_user_can( 'stick_topic', $topic_id ) ) {
  12      wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
  13      exit;
  14  }
  15  
  16  bb_check_admin_referer( 'stick-topic_' . $topic_id );
  17  
  18  if ( topic_is_sticky( $topic_id ) )
  19      bb_unstick_topic ( $topic_id );
  20  else
  21      bb_stick_topic   ( $topic_id, $super );
  22  
  23  if ( !$redirect = wp_get_referer() )
  24      $redirect = get_topic_link( $topic_id );
  25  
  26  bb_safe_redirect( $redirect );
  27  exit;
  28  
  29  ?>


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