Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/19/2016 07:35:41 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Statuses, Types, Visibilities: Pass the forum, topic, or reply ID into helper functions.

These ID's pass additional context into respective filters, useful for fine-grained control over UI elements.

This commit normalizes the way these functions work across all of bbPress where applicable, by ensuring all similar functions accept an ID and assume 0 by default. Note that there are currently 2 locations where no ID exists to pass context into, which is by design.

Fixes #2954.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/template.php

    r6024 r6026  
    26832683        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
    26842684
    2685             <?php foreach ( bbp_get_forum_types() as $key => $label ) : ?>
     2685            <?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?>
    26862686
    26872687                <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
     
    27752775        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
    27762776
    2777             <?php foreach ( bbp_get_forum_statuses() as $key => $label ) : ?>
     2777            <?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?>
    27782778
    27792779                <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
     
    28672867        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select"<?php echo $tab; ?>>
    28682868
    2869             <?php foreach ( bbp_get_forum_visibilities() as $key => $label ) : ?>
     2869            <?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?>
    28702870
    28712871                <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $r['selected'] ); ?>><?php echo esc_html( $label ); ?></option>
Note: See TracChangeset for help on using the changeset viewer.