Changeset 6433 for trunk/src/includes/common/template.php
- Timestamp:
- 05/26/2017 09:50:36 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/template.php
r6415 r6433 1398 1398 1399 1399 return apply_filters( 'bbp_get_tab_index', (int) $bbp->tab_index ); 1400 } 1401 1402 /** 1403 * Output a "tabindex" attribute for an element, if an index was passed. 1404 * 1405 * This helper function is in use, but it is generally considered impolite to 1406 * override the "tabindex" attribute beyond what the browser naturally assigns. 1407 * 1408 * Most internal usages pass `false` which results in no attribute being used. 1409 * 1410 * @since 2.6.0 bbPress (r6424) 1411 * 1412 * @param mixed $tab False to skip, any integer to use 1413 */ 1414 function bbp_tab_index_attribute( $tab = false ) { 1415 echo bbp_get_tab_index_attribute( $tab ); 1416 } 1417 1418 /** 1419 * Return a "tabindex" attribute for an element, if an index was passed. 1420 * 1421 * This helper function is in use, but it is generally considered impolite to 1422 * override the "tabindex" attribute beyond what the browser naturally assigns. 1423 * 1424 * Most internal usages pass `false` which results in no attribute being used. 1425 * 1426 * @since 2.6.0 bbPress (r6424) 1427 * 1428 * @param mixed $tab False to skip, any integer to use 1429 * 1430 * @return string 1431 */ 1432 function bbp_get_tab_index_attribute( $tab = false ) { 1433 1434 // Get attribute 1435 $attr = is_numeric( $tab ) 1436 ? ' tabindex="' . (int) $tab . '"' 1437 : ''; 1438 1439 // Filter & return 1440 return apply_filters( 'bbp_get_tab_index_attribute', $attr, $tab ); 1400 1441 } 1401 1442 … … 1884 1925 * escaping the editable output, mucking up existing content. 1885 1926 */ 1886 else : 1887 1888 // Setup the tab index attribute 1889 $tab = ! empty( $r['tab'] ) ? ' tabindex="' . intval( $r['tab'] ) . '"' : ''; ?> 1890 1891 <textarea id="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" class="<?php echo esc_attr( $r['editor_class'] ); ?>" name="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" cols="60" rows="<?php echo esc_attr( $r['textarea_rows'] ); ?>" <?php echo $tab; ?>><?php echo $post_content; ?></textarea> 1927 else : ?> 1928 1929 <textarea id="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" class="<?php echo esc_attr( $r['editor_class'] ); ?>" name="bbp_<?php echo esc_attr( $r['context'] ); ?>_content" cols="60" rows="<?php echo esc_attr( $r['textarea_rows'] ); ?>" <?php bbp_tab_index_attribute( $r['tab'] ); ?>><?php echo $post_content; ?></textarea> 1892 1930 1893 1931 <?php endif;
Note: See TracChangeset
for help on using the changeset viewer.