[wp-trac] [WordPress Trac] #17857: WP_Embed - Split shortcode() function into two for increased flexibility

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 21 01:52:41 UTC 2011


#17857: WP_Embed - Split shortcode() function into two for increased flexibility
-------------------------+-----------------------------
 Reporter:  r-a-y        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:  3.1.4
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 Currently, the WP_Embed class is restricted to posts; it takes a post ID
 as a parameter and checks the post meta table.

 What I'd like to propose is to apply a filter to the post ID and split
 WP_Embed::shortcode() into two functions (at
 http://core.trac.wordpress.org/browser/trunk/wp-includes/media.php#L1177).

 In a nutshell, let the link parsing be one function and if the link is
 oEmbed-worthy send it to the second function for parsing.  The second
 function could then be easily extended for usage in 3rd-party plugins not
 using WP posts (like BuddyPress).

 Also, the patch checks the URL against each registered WP oEmbed
 provider's URL scheme if oEmbed discovery is false.  This is designed to
 prevent unnecessary external pinging of an oEmbed provider and avertible
 meta caching for failed attempts.  Andy Peatling primarily wrote this part
 of the code, which he sent to me awhile ago.

 Attached patch is against r18324.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17857>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list