Opened 11 years ago
Closed 11 years ago
#24263 closed defect (bug) (invalid)
Revision view should display shortcodes the same as the visual editor
Reported by: | a.hoereth | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.6 |
Component: | Revisions | Keywords: | dev-feedback has-patch |
Focuses: | Cc: |
Description (last modified by )
Follow up on ticket:24254:10:
The revision viewer changes to feel more like the visual editor with 3.6 . It no longer uses htmlspecialchars
but wp_kses_post
([23506]). So it now displays images, links etc no longer just as code.
To be consistent the revisions view should also have the same behavior as the visual editor for [caption]
and [gallery]
shortcodes.
For [gallery]
it is important changes are still being displayed if present. The shortcode is just replaced by a placeholder in the editor - not very meaningful for revisions. Or don't display it at all?
Attachments (3)
Change History (9)
#1
follow-up:
↓ 2
@
11 years ago
24263.patch is a rudimentary migration of the "do shortcode" function from editor_plugin.js to the revisions interface.
It displays the captions nicely, but only when nothing inside the caption shortcode changed in any of the compared revisions.
Todo: Caption should also be displayed visually when newly added or only caption text was changed..
Waiting for dev feedback before further investigating on this
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
11 years ago
Replying to a.hoereth:
#24263 is a rudimentary migration of the "do shortcode" function from editor_plugin.js to the revisions interface.
It displays the captions nicely, but only when nothing inside the caption shortcode changed in any of the compared revisions.
Todo: Caption should also be displayed visually when newly added or only caption text was changed..
Waiting for dev feedback before further investigating on this
works, except this looks like old code, looking for the current code to include instead of reproduce
#3
in reply to:
↑ 2
@
11 years ago
Replying to adamsilverstein:
Replying to a.hoereth:
#24263 is a rudimentary migration of the "do shortcode" function from editor_plugin.js to the revisions interface.
It displays the captions nicely, but only when nothing inside the caption shortcode changed in any of the compared revisions.
Todo: Caption should also be displayed visually when newly added or only caption text was changed..
Waiting for dev feedback before further investigating on this
works, except this looks like old code, looking for the current code to include instead of reproduce
I think we could also make this happen on the server side. For the visual editor the flexibility of JS is needed, for revisions we can also do it using PHP with a regex and call to img_caption_shortcode.
#4
@
11 years ago
- Keywords has-patch added; needs-patch removed
24263.2.patch uses do_shortcode
in addition to wp_kses_post
. This could result in errors when plugins register shortcodes in admin, but not all required scripts etc.
24263.3.patch uses a custom array for defining which shortcodes should be applyed. The regex is copyied from wp-incudes/shortcodes.php:191ff.
tinyMCE style caption-shortcode in revisions