Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/28/2012 08:41:37 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Clean-up bbp-common-template.php:

  • Remove unused globals
  • Use bbp_get_global_post_field()
  • Avoid accidental inline assignments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-common-template.php

    r3656 r3704  
    479479 */
    480480function bbp_is_user_home() {
    481     global $bbp;
    482481
    483482    // Assume false
     
    10751074
    10761075        // Forums
    1077         if ( $post_type == bbp_get_forum_post_type() ) {
     1076        if ( bbp_get_forum_post_type() == $post_type ) {
    10781077
    10791078            // Private forums
    1080             if ( current_user_can( 'read_private_forums' ) )
     1079            if ( current_user_can( 'read_private_forums' ) ) {
    10811080                $post_stati[] = bbp_get_private_status_id();
     1081            }
    10821082
    10831083            // Hidden forums
    1084             if ( current_user_can( 'read_hidden_forums' ) )
     1084            if ( current_user_can( 'read_hidden_forums' ) ) {
    10851085                $post_stati[] = bbp_get_hidden_status_id();
     1086            }
    10861087        }
    10871088
     
    14091410            // If it's an edit, use the $post global
    14101411            if ( bbp_is_edit() ) {
    1411                 global $post;
    1412                 $post_content = $post->post_content;
     1412                $post_content = bbp_get_global_post_field( 'post_content' );
    14131413            }
    14141414
     
    15171517        global $bbp;
    15181518
    1519         if ( !$view = bbp_get_view_id( $view ) )
     1519        $view = bbp_get_view_id( $view );
     1520        if ( empty( $view ) )
    15201521            return false;
    15211522
     
    15501551        global $bbp, $wp_rewrite;
    15511552
    1552         if ( !$view = bbp_get_view_id( $view ) )
     1553        $view = bbp_get_view_id( $view );
     1554        if ( empty( $view ) )
    15531555            return home_url();
    15541556
Note: See TracChangeset for help on using the changeset viewer.