#20417 closed defect (bug) (fixed)
do_enclose() and other functions should use the WP API when dealing with metadata
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 1.5 |
Component: | Pings/Trackbacks | Keywords: | has-patch |
Focuses: | Cc: |
Description
do_enclose() does this:
$wpdb->insert($wpdb->postmeta, array('post_id' => $post_ID, 'meta_key' => 'enclosure', 'meta_value' => $meta_value) );
And I am not sure why. Some other functions also use $wpdb to interact with postmeta when not necessary.
Attachments (4)
Change History (13)
#1
@
13 years ago
- Component changed from General to Pings/Trackbacks
- Keywords has-patch added
- Version set to 1.5
#2
@
13 years ago
[11968] caused some actions to be duplicated; more recent changesets cause more duplication.
20417.2.diff results in no more (add|added|delete|deleted)_(commentmeta|postmeta) actions called outside of meta.php. It results in the proper functions being used more often. It includes the work in 20417.diff to clean up do_enclose() as well.
#3
@
13 years ago
Tested 20417.2.diff with these steps:
- Applied 20417.2.diff to WordPress trunk r20434
- Created a new post with audio and video links in it, see example code below
- Checked the feed page source to see if the proper <enclosure> tags were added
- Results: One enclosure tag was created for each unique audio or video link in the post.
Example post content with audio/video links for testing:
This post has a duplicate video link in it. Check to make sure only one enclosure tag is added for this post in the blog's feed. <a href="http://videos.videopress.com/w0MiG12E/snow2-its-back-h2642_dvd.mp4">Let It Snow</a> <a href="http://wpcom.files.wordpress.com/2007/01/mattmullenweg-interview.mp3">Matt Mullenweg Interview</a> <a href="http://videos.videopress.com/w0MiG12E/snow2-its-back-h2642_dvd.mp4">Let It Snow</a>
Note: See
TracTickets for help on using
tickets.
//TODO: Tidy this ghetto code up
Done. :-)