Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/26/2017 09:50:36 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Forms: Introduce bbp_tab_index_attribute() helpers to handle tabindex attribute output.

Note that these functions are used but normally their output is suppressed, because overriding the browser's natural tabindex order is impolite, and may introduce more issues than it actually fixes.

(Also includes some surrounding code clean-up.)

File:
1 edited

Legend:

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

    r6414 r6433  
    25762576        }
    25772577
    2578         // Used variables
    2579         $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
    2580 
    25812578        // Start an output buffer, we'll finish it after the select loop
    25822579        ob_start(); ?>
    25832580
    2584         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
     2581        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
    25852582
    25862583            <?php foreach ( bbp_get_forum_types( $r['forum_id'] ) as $key => $label ) : ?>
     
    26692666        }
    26702667
    2671         // Used variables
    2672         $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
    2673 
    26742668        // Start an output buffer, we'll finish it after the select loop
    26752669        ob_start(); ?>
    26762670
    2677         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
     2671        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
    26782672
    26792673            <?php foreach ( bbp_get_forum_statuses( $r['forum_id'] ) as $key => $label ) : ?>
     
    27622756        }
    27632757
    2764         // Used variables
    2765         $tab = ! empty( $r['tab'] ) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
    2766 
    27672758        // Start an output buffer, we'll finish it after the select loop
    27682759        ob_start(); ?>
    27692760
    2770         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
     2761        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ) ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php bbp_tab_index_attribute( $r['tab'] ); ?>>
    27712762
    27722763            <?php foreach ( bbp_get_forum_visibilities( $r['forum_id'] ) as $key => $label ) : ?>
Note: See TracChangeset for help on using the changeset viewer.