Skip to:
Content

bbPress.org

Changeset 3256


Ignore:
Timestamp:
05/28/2011 06:03:16 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Fix missing @since revision, update phpdoc, and variable clean-up for bbp_author_metabox(). Props eagle-eyed duck_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-metaboxes.php

    r3120 r3256  
    415415 * Anonymous user information metabox
    416416 *
    417  * @since bbPress (r)
    418  *
     417 * @since bbPress (r2828)
     418 *
     419 * @uses bbp_is_reply_anonymous() To check if reply is anonymous
     420 * @uses bbp_is_topic_anonymous() To check if topic is anonymous
     421 * @uses get_the_ID() To get the global post ID
    419422 * @uses get_post_meta() To get the author user information
    420423 */
    421 function bbp_author_metabox () {
    422     global $post;
    423 
    424     // Bail if topic/reply is not anonymous
    425     if ( bbp_is_reply_anonymous( get_the_ID() ) || bbp_is_topic_anonymous( get_the_ID() ) ) : ?>
     424function bbp_author_metabox() {
     425
     426    // Post ID
     427    $post_id = get_the_ID();
     428   
     429    // Show extra bits if topic/reply is anonymous
     430    if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?>
    426431
    427432        <p><strong><?php _e( 'Name', 'bbpress' ); ?></strong></p>
     
    429434        <p>
    430435            <label class="screen-reader-text" for="bbp_anonymous_name"><?php _e( 'Name', 'bbpress' ); ?></label>
    431             <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo get_post_meta( $post->ID, '_bbp_anonymous_name', true ); ?>" size="38" />
     436            <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo get_post_meta( $post_id, '_bbp_anonymous_name', true ); ?>" size="38" />
    432437        </p>
    433438
     
    436441        <p>
    437442            <label class="screen-reader-text" for="bbp_anonymous_email"><?php _e( 'Email', 'bbpress' ); ?></label>
    438             <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo get_post_meta( $post->ID, '_bbp_anonymous_email', true ); ?>" size="38" />
     443            <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo get_post_meta( $post_id, '_bbp_anonymous_email', true ); ?>" size="38" />
    439444        </p>
    440445
     
    443448        <p>
    444449            <label class="screen-reader-text" for="bbp_anonymous_website"><?php _e( 'Website', 'bbpress' ); ?></label>
    445             <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo get_post_meta( $post->ID, '_bbp_anonymous_website', true ); ?>" size="38" />
     450            <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo get_post_meta( $post_id, '_bbp_anonymous_website', true ); ?>" size="38" />
    446451        </p>
    447452
     
    452457    <p>
    453458        <label class="screen-reader-text" for="bbp_author_ip_address"><?php _e( 'IP Address', 'bbpress' ); ?></label>
    454         <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo get_post_meta( $post->ID, '_bbp_author_ip', true ); ?>" size="38" disabled="disabled" />
     459        <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo get_post_meta( $post_id, '_bbp_author_ip', true ); ?>" size="38" disabled="disabled" />
    455460    </p>
    456461
    457462    <?php
    458463
    459     do_action( 'bbp_author_metabox', $post->ID );
     464    do_action( 'bbp_author_metabox', $post_id );
    460465}
    461466
Note: See TracChangeset for help on using the changeset viewer.