[wp-meta] [Making WordPress.org] #5687: WP.org Base Theme: Register navigation JS for use in child themes

Making WordPress.org noreply at wordpress.org
Wed Mar 31 21:02:42 UTC 2021


#5687: WP.org Base Theme: Register navigation JS for use in child themes
--------------------------------+---------------------
 Reporter:  ryelle              |       Owner:  (none)
     Type:  defect              |      Status:  new
 Priority:  normal              |   Milestone:
Component:  WordPress.org Site  |  Resolution:
 Keywords:                      |
--------------------------------+---------------------
Description changed by ryelle:

Old description:

> As of r6068, the navigation.js file has been commented out of the `wporg`
> parent theme, which means the child themes need to re-enqueue it from
> scratch (and if it's changed, the versions need to be bumped across all
> instances).
>
> Instead, we could use `wp_register_script` in the parent theme to set up
> the file & information, and let child themes opt in to using it with
> `wp_enqueue_script( 'wporg-navigation' )`.

New description:

 As of r6068, the navigation.js file has been commented out of the `wporg`
 parent theme, which means the child themes need to re-enqueue it from
 scratch (and if it's changed, the versions need to be bumped across all
 instances).

 Instead, we could use `wp_register_script` in the parent theme to set up
 the file & information, and let child themes opt in to using it with
 `wp_enqueue_script( 'wporg-navigation' )`.

 Example of a child theme re-enqueuing the file:
 https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/themes/pub/wporg-main/functions.php#L121

--

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5687#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list