Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#36695 closed enhancement (fixed)

wp-util: update to latest _.template syntax

Reported by: jnylen0 Owned by: rachelbaker
Priority: normal Milestone: 4.6
Component: General Version: 4.6
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description

With the upgrade to Underscore 1.8.3 in [36546] and 4.5, the preferred syntax for passing options to _.template is to pass two parameters (template, options) rather than three (template, data, options). This patch updates the wp.template function accordingly (and also cleans up the style of the immediately surrounding code).

No functional changes, since Underscore supports passing data = null for backwards compatibility, but we should fix this to be consistent with the correct usage of the function.

Attachments (2)

36695.diff (926 bytes ) - added by jnylen0 10 years ago.
36695.2.diff (889 bytes ) - added by jnylen0 10 years ago.
Fix misreading of WP coding standards.

Download all attachments as: .zip

Change History (6)

@jnylen0
10 years ago

#1 @jnylen0
10 years ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core by jnylen. View the logs.


10 years ago

#3 @rachelbaker
10 years ago

  • Milestone Awaiting Review4.6
  • Owner set to rachelbaker
  • Status newreviewing

@jnylen0
10 years ago

Fix misreading of WP coding standards.

#4 @rachelbaker
10 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 37851:

Utils: Update wp.template to match parameter changes to _.template in Underscore 1.8.3.

Removes passing a null value for the back-compat only data parameter to _.template.

Props jnylen0.
Fixes #36695.

Note: See TracTickets for help on using tickets.