Opened 11 years ago
Closed 9 years ago
#28627 closed enhancement (fixed)
wp_prepare_revisions_for_js Should have more hooks/filters.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Revisions | Keywords: | has-patch |
Focuses: | javascript, administration | Cc: |
Description
Specifically, the array at the end should be passed through a filter then use wp_parse_args to ensure the correct parameters are correct. This would be useful for infusing more data to the models (i.e. post-meta for revisions, see this stackexchange: http://wordpress.stackexchange.com/questions/151630/how-to-hook-in-and-modify-the-new-revisions-ui-3-6). We still need a more WordPress way to tap into the Backbone views for the revisions UI as well.
Attachments (3)
Change History (13)
#1
follow-up:
↓ 2
@
11 years ago
Into it.
I don't see an immediate use case for overriding the settings array. For the use case suggested (adding data to a revision model), I could see a more specific filter applied when the data's array is built.
a la
<?php $revisions[$revision->ID] = apply_filters( 'wp_prepare_revision_for_js', array( /* revision data */ ) );
The filter naming is for parity with the wp_prepare_attachment_for_js filter.
#2
in reply to:
↑ 1
@
11 years ago
Replying to ericlewis:
For the use case suggested (adding data to a revision model), I could see a more specific filter applied when the revision data's array is built.
That makes sense to me.
#5
@
10 years ago
- Keywords has-patch dev-feedback added
- Owner set to adamsilverstein
- Status changed from new to assigned
Did a little freshening and hook docs cleanup in 28627.2.diff - curious to hear the use case!
#6
@
9 years ago
- Keywords dev-feedback removed
- Milestone changed from Awaiting Review to 4.4
- Owner changed from adamsilverstein to wonderboymusic
Proposed filter