[wp-trac] [WordPress Trac] #34455: Additional Filters for Press This
WordPress Trac
noreply at wordpress.org
Mon Feb 29 01:35:00 UTC 2016
#34455: Additional Filters for Press This
------------------------------+-----------------------
Reporter: cadeyrn | Owner: kraftbj
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.5
Component: Press This | Version: 4.2
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses:
------------------------------+-----------------------
Changes (by azaozz):
* status: closed => reopened
* resolution: fixed =>
Comment:
@cadeyrn
> Is sideloading from the referenced url (which lead to Press This)
possible on regular post save?
I may be missing something but "sideloading" is possible at any time, when
saving a post or not. You have a choice of `media_sideload_image()`,
`media_handle_sideload()` or `wp_handle_sideload()` depending on how much
control you want to have.
> Why would it be repurposing just because some might find other HTML
elements useful as well?
What I mean is that the `press_this_useful_html_elements` filter only runs
when not using the bookmarklet and an URL is typed in PT directly. This is
a compatibility mode that's rarely used. So this filter will never run in
normal, intended use of PT. In addition it is somewhat confusing as plugin
authors may expect it to always run.
> This is not true. I'm using Markdown when writing posts and without
this, I can't do so in Press this.
The `press_this_suggested_content` filter has nothing to do with using
Markdown (or anything else) in the editor. If you don't want the default
HTML tags, you can remove them completely or replace with whatever you
need by using `press_this_suggested_html`. I don't see why we need another
filter for almost the same thing. In addition
`press_this_suggested_content` is harder to use as the only way would be
to parse the HTML with regexp, and that is... not good :)
Reopening for reconsideration. At least the names need to be better.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34455#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list