[wp-trac] [WordPress Trac] #18833: Pass raw data into save_post/wp_insert_post
WordPress Trac
wp-trac at lists.automattic.com
Sat Oct 1 13:49:06 UTC 2011
#18833: Pass raw data into save_post/wp_insert_post
----------------------------+------------------------------
Reporter: rmccue | Owner: rmccue
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch |
----------------------------+------------------------------
Comment (by rmccue):
Example usage:
{{{
function rm_savemydata($id, $post, $raw) {
// Use `isset` here if it can be blank
if (!empty($raw['rm_myfield'])) {
return;
}
update_post_meta($id, 'rm_myfield', $raw['rm_myfield']);
}
add_filter('save_post', 'rm_savemydata', 10, 3);
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18833#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list