Make WordPress Core

Changes between Version 22 and Version 23 of Ticket #46370


Ignore:
Timestamp:
12/13/2019 11:50:36 AM (5 years ago)
Author:
jonoaldersonwp
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46370 – Description

    v22 v23  
    170170Behind the scenes, there's some additional complexity here. Scripts and styles use a `$handle` to identify them uniquely. Fonts don't have an equivalent concept (multiple font variations may share the same family namespace), so we need to synthesize one. This will allow us to pass gracefully wrap functions like `wp_enqueue_style()`.
    171171
    172 To achieve this, we should combine the (sanitized) `$family`, `$style`, `$weight` and `$media` strings to create a unique representation; e.g., `base64encode($family.$style.$weight.$media)`.
     172To achieve this, we should combine the (sanitized) `$family`, `$style`, `$weight` and `$media` strings to create a unique representation; e.g., `create_font_handle($family.$style.$weight.$media)`.
    173173
    174174If multiple fonts are registered with the same handle, the last-enqueued version should take priority (overwriting previous enqueues).