Skip to:
Content

bbPress.org

Changeset 2911


Ignore:
Timestamp:
02/18/2011 04:54:25 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Change subscription checkbox text if the post is the current users or someone else's. Fixes #1462.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/functions.bb-template.php

    r2865 r2911  
    35673567    if ( !bb_is_user_logged_in() )
    35683568        return false;
    3569    
    3570     $defaults = array( 'tab' => false );
    3571     $args = wp_parse_args( $args, $defaults );
    3572     $tab = $args['tab'] !== false ? ' tabindex="' . $args['tab'] . '"' : '';
     3569
     3570    $is_current = false;
     3571    $defaults   = array( 'tab' => false );
     3572    $args       = wp_parse_args( $args, $defaults );
     3573    $tab        = $args['tab'] !== false ? ' tabindex="' . $args['tab'] . '"' : '';
     3574
     3575    // Change subscription checkbox message if current or moderating
     3576    if ( isset( $_GET['new'] ) || ( $is_current = ( bb_get_user_id( get_post_author_id() ) == bb_get_current_user_info( 'id' ) ) ) )
     3577        $text = __( 'Notify me of follow-up posts via email' );
     3578    else
     3579        $text = __( 'This user should be notified of follow-up posts via email' );
    35733580
    35743581    echo '
    35753582    <label for="subscription_checkbox">
    35763583        <input name="subscription_checkbox" id="subscription_checkbox" type="checkbox" value="subscribe" ' . checked( true, bb_is_user_subscribed(), false ) . $tab . ' />
    3577         ' .  apply_filters( 'bb_user_subscribe_checkbox_label', __( 'Notify me of follow-up posts via email' ) ) . '
     3584        ' .  apply_filters( 'bb_user_subscribe_checkbox_label', $text, (bool) $is_current ) . '
    35783585    </label>';
    35793586
Note: See TracChangeset for help on using the changeset viewer.