Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#39930 closed task (blessed) (fixed)

Adding documentation for wp.customize properties

Reported by: shramee's profile shramee Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.8
Component: Customize Keywords: has-patch needs-docs
Focuses: javascript, docs Cc:

Description

Adding documentation for...

  • wp.customize.control
  • wp.customize.section
  • wp.customize.panel

Along with examples for usage.

Attachments (2)

39930.patch (2.0 KB) - added by shramee 8 years ago.
Patch for docs
39930-1.patch (2.5 KB) - added by shramee 8 years ago.
Second patch for docs

Download all attachments as: .zip

Change History (16)

@shramee
8 years ago

Patch for docs

This ticket was mentioned in Slack in #docs by shramee. View the logs.


8 years ago

#2 @westonruter
8 years ago

  • Milestone changed from Awaiting Review to 4.8

Thanks. I wouldn't mention _values as it is private. The items in the collection should only be accessed via the methods on Values like each().

Also, instead of @return {object|undefined} these should have @returns {wp.customize.Section|undefined} according to the various types.

Also a key example to include is how to use the deferred pattern, for example:

wp.customize.section( 'title_tagline', function( section ) { section.expand(); } )

The deferred pattern is preferred since it ensures there is no JS error in the case of something not being registered.

#3 @shramee
8 years ago

  • Focuses docs added
  • Keywords has-patch needs-docs added

#4 @shramee
8 years ago

Aye, Agree @westonruter,

Adding a new patch ;)

@shramee
8 years ago

Second patch for docs

#5 @shramee
8 years ago

@westonruter Thanks a lot, I am using this in one of my plugin (will be live on wp.org soon).
Passing a deferred (anonymous) function would make my plugin more robust :)

PFA 39930-1.patch

Last edited 8 years ago by shramee (previous) (diff)

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


8 years ago

#7 @jbpaul17
8 years ago

  • Milestone changed from 4.8 to 4.8.1

Per yesterday's bug scrub, we're going to punt this to 4.8.1.

#8 @westonruter
8 years ago

  • Milestone changed from 4.8.1 to 4.9

#9 @DrewAPicture
7 years ago

  • Focuses javascript added

This ticket was mentioned in Slack in #core-customize by jeffpaul. View the logs.


7 years ago

#11 @jbpaul17
7 years ago

  • Type changed from enhancement to task (blessed)

As this is a documentation update, we'll switch this from an enhancement to a task ticket type.

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


7 years ago

#13 @westonruter
7 years ago

  • Owner set to westonruter
  • Status changed from new to accepted

#14 @westonruter
7 years ago

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

In 41799:

Customize: Add jsdoc for api.panel, api.section, api.control, and api.notifications collections.

Props shramee, westonruter.
Fixes #39930.

Note: See TracTickets for help on using tickets.