Changeset 44409
- Timestamp:
- 01/06/2019 08:18:08 PM (6 years ago)
- Location:
- branches/5.0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0
- Property svn:mergeinfo changed
/trunk merged: 43659,44408
- Property svn:mergeinfo changed
-
branches/5.0/src/wp-content/themes/twentyseventeen/functions.php
r44213 r44409 587 587 588 588 /** 589 * Get unique ID. 590 * 591 * This is a PHP implementation of Underscore's uniqueId method. A static variable 592 * contains an integer that is incremented with each call. This number is returned 593 * with the optional prefix. As such the returned value is not universally unique, 594 * but it is unique across the life of the PHP process. 595 * 596 * @since Twenty Seventeen 2.0 597 * @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead. 598 * 599 * @staticvar int $id_counter 600 * 601 * @param string $prefix Prefix for the returned ID. 602 * @return string Unique ID. 603 */ 604 function twentyseventeen_unique_id( $prefix = '' ) { 605 static $id_counter = 0; 606 if ( function_exists( 'wp_unique_id' ) ) { 607 return wp_unique_id( $prefix ); 608 } 609 return $prefix . (string) ++$id_counter; 610 } 611 612 /** 589 613 * Implement the Custom Header feature. 590 614 */ -
branches/5.0/src/wp-content/themes/twentyseventeen/inc/icon-functions.php
r41593 r44409 75 75 if ( $args['title'] ) { 76 76 $aria_hidden = ''; 77 $unique_id = uniqid();77 $unique_id = twentyseventeen_unique_id(); 78 78 $aria_labelledby = ' aria-labelledby="title-' . $unique_id . '"'; 79 79 -
branches/5.0/src/wp-content/themes/twentyseventeen/searchform.php
r39618 r44409 11 11 ?> 12 12 13 <?php $unique_id = esc_attr( uniqid( 'search-form-' ) ); ?>13 <?php $unique_id = esc_attr( twentyseventeen_unique_id( 'search-form-' ) ); ?> 14 14 15 15 <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.