WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 8 months ago

#24424 closed task (blessed) (fixed)

Add a general WordPress Backbone utility file

Reported by: koopersmith Owned by: koopersmith
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

We've already added wp.template, but we could use a few more common Backbone helpers. Let's move these to a single wp-backbone file to start.

Attachments (1)

24424.diff (3.0 KB) - added by nacin 9 months ago.

Download all attachments as: .zip

Change History (16)

comment:2 koopersmith11 months ago

In 24360:

Extract the base views from media.

See #24424.

comment:3 koopersmith11 months ago

  • Owner set to koopersmith
  • Resolution set to fixed
  • Status changed from new to closed

In 24361:

Update the subview controller for the patterns found in Backbone 1.0.

Fixes #24424.

comment:4 koopersmith11 months ago

In 24366:

Alias media.template to wp.template. See #23263, #24424.

comment:5 koopersmith11 months ago

In 24367:

Add Backbone property to the wp-backbone namespace. See #24424.

comment:6 koopersmith11 months ago

In 24368:

Branch the generic JS utilities from the Backbone commands. See #24424.

comment:7 koopersmith11 months ago

In 24369:

Move XHR helpers from media to utils. See #24424.

comment:8 SergeyBiryukov11 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Getting this on Edit Post screen after [24369] (with SCRIPT_DEBUG disabled):

TypeError: wp.xhr is undefined

The error breaks "Add Media" button (as reported in the forums), and also breaks the JS for switching post formats.

Looks like bumpbot didn't create wp-util.min.js.

Last edited 11 months ago by SergeyBiryukov (previous) (diff)

comment:9 follow-up: mindctrl11 months ago

I can't seem to replicate it at the moment, but when I first saw the issue with "Add Media", "Select Audio", etc. I was also having a problem, where on custom post types, the switcher was kicking me out to standard 'post' types and out of the custom post type. The link was missing the post_type=demo var. Just a heads up that maybe someone else can test.

comment:10 in reply to: ↑ 9 SergeyBiryukov11 months ago

Replying to mindctrl:

I can't seem to replicate it at the moment, but when I first saw the issue with "Add Media", "Select Audio", etc. I was also having a problem, where on custom post types, the switcher was kicking me out to standard 'post' types and out of the custom post type.

Related: #24360

comment:11 nacin11 months ago

In 24374:

Add wp-util.min.js. See #24424.

comment:12 SergeyBiryukov11 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:13 sunnyratilal11 months ago

#24435 was marked as a duplicate.

nacin9 months ago

comment:14 nacin9 months ago

In 24652:

Rename wp.xhr to wp.ajax to match admin-ajax.php (which it uses), jQuery.ajax (which it wraps), etc. see #24424.

comment:15 kadamwhite8 months ago

  • Cc kadamwhite added
Note: See TracTickets for help on using tickets.