WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 7 months ago

#37938 accepted enhancement

Split Source Parsing Functions from Press This So Can Be Used Globally

Reported by: dshanske Owned by: kraftbj
Milestone: Future Release Priority: low
Severity: minor Version: 4.2
Component: Embeds Keywords: needs-patch needs-unit-tests
Focuses: Cc:

Description

WordPress already has an HTML parsing function in the form of WP_Press_This::source_data_fetch_fallback and its private called functions.

Suggesting this be split off so it can be used elsewhere. Specifically, my use case is over on the Ping and Trackbacks component. One of the proposals I keep advocating for is improving the presentation.

As we already have this code in WordPress that allows for parsing of HTML for images, embeds, meta tags, etc, it should be used over writing new code to do the same.

But if it were to be called right now, it would reretrieve source HTML already retrieved by the Pingback code and passed into the comment array.

Change History (7)

#1 @swissspidy
21 months ago

  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

Thought the same the other day. A separate class would be very handy for things like automatic link previews.

#2 @dshanske
21 months ago

@swissspidy If you remember, I chimed in re link previews during the oEmbed discussions, so I completely agree there too.

This should be relatively easy to separate. The code is pretty much written and stable. WP_Press_This will just call another class and focus on the Press This legacy merge and other related things.

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


16 months ago

#4 @kraftbj
7 months ago

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

Noting that while I'm closing out various PT tickets since it is moving to a plugin, I'm leaving this since this is more of an enhancement to Core than strictly PT. I do like this idea though.

This ticket was mentioned in Slack in #core-pressthis by kraft. View the logs.


7 months ago

#6 @kraftbj
7 months ago

  • Component changed from Press This to Embeds

#7 @rglennnall
7 months ago

I'm not a core coder. I just came to this from the link in the PT-in-4-9 thread.

Like many people, I'm sorely disappointed in the loss of the ability to populate the PT plugin like the bookmarklet availed.

WHAT CAN WE DO to get such functionality back - HOWEVER it could be accomplished (vice this bookmarklet ya'll have seen fit to deprecate)?

Note: See TracTickets for help on using tickets.