Skip to:
Content

bbPress.org

Changeset 5084


Ignore:
Timestamp:
08/21/2013 09:11:47 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Add 'show_none' to forum ID dropdown in form-topic.php template part. Fixes UX problem where a new-topic page would automatically select the first option in the list for topics to go in. Also escape output of 'show_none' in bbp_get_dropdown(). Fixes #2390.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/template.php

    r5049 r5084  
    14251425
    14261426            // Get the options
    1427             $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . $r['show_none'] . '</option>' : '';
     1427            $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . esc_html( $r['show_none'] ) . '</option>' : '';
    14281428            $retval .= walk_page_dropdown_tree( $posts, 0, $r );
    14291429
  • trunk/templates/default/bbpress/form-topic.php

    r5060 r5084  
    113113                        <p>
    114114                            <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    115                             <?php bbp_dropdown( array( 'selected' => bbp_get_form_topic_forum() ) ); ?>
     115                            <?php
     116                                bbp_dropdown( array(
     117                                    'show_none' => __( '(No Forum)', 'bbpress' ),
     118                                    'selected'  => bbp_get_form_topic_forum()
     119                                ) );
     120                            ?>
    116121                        </p>
    117122
Note: See TracChangeset for help on using the changeset viewer.