#30220 closed enhancement (fixed)
Make single responsibility function for outputting Revisions JS templates
| Reported by: | ericlewis | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.1 |
| Component: | Revisions | Version: | 3.6 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | javascript |
Description
Attachments (1)
Change History (10)
#4
@
12 years ago
Most of wp-admin is really simplistic and self-contained, for better or worse, and keeping the templates inside wp-admin/revision.php was deliberate at the time. As a reviewer I'm not entirely sure why this was done — If this was for a use case specific to something you are building, that's _fine_, but it's worth stating in the bug report.
#5
follow-up:
↓ 6
@
12 years ago
If we are going to do something like this, we should probably pass the post object in, rather than relying on global state.
#6
in reply to: ↑ 5
@
12 years ago
Replying to nacin:
If we are going to do something like this, we should probably pass the post object in, rather than relying on global state.
That. Or use get_post(). Or both. Or pass the post lock state in data so we don't even need the post object?
#8
@
12 years ago
Sorry for not explaining why this was useful earlier.
While building a post forking plugin, I wanted to use the revision diffing view on an Edit Fork page, so editors can compare changes to the original. This required work in #30221, #30219, #30222, and needs follow-up on #30232.
#9
@
12 years ago
So, I like using $post here, or at least not making it a function argument (as in, $post = get_post() would be fine), because it's only actually used to set a disabled attribute on a button. This should really be set in JS based on the model. It would be lovely to get rid of any kind of state in this function.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 30129: