[wp-trac] [WordPress Trac] #44883: Twenty Seventeen: Use simple counter rather than uniqid() for generating unique IDs for HTML elements

WordPress Trac noreply at wordpress.org
Mon Sep 24 20:56:33 UTC 2018


#44883: Twenty Seventeen: Use simple counter rather than uniqid() for generating
unique IDs for HTML elements
------------------------------+----------------------------
 Reporter:  westonruter       |       Owner:  laurelfulford
     Type:  enhancement       |      Status:  reviewing
 Priority:  normal            |   Milestone:  4.9.9
Component:  Bundled Theme     |     Version:  4.7
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+----------------------------

Comment (by SergeyBiryukov):

 In [changeset:"43658" 43658]:
 {{{
 #!CommitTicketReference repository="" revision="43658"
 General: Introduce `wp_unique_id()`, a PHP implementation of Underscore's
 `uniqueId` method.

 A static variable contains an integer that is incremented with each call.
 This number is returned with the optional prefix.
 As such the returned value is not universally unique, but it is unique
 across the life of the PHP process.

 Props westonruter, dlh.
 See #44883.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44883#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list