[wp-hackers] getting edit data in entirety before posts go to database

Jennifer Hodgdon yahgrp at poplarware.com
Wed Dec 17 15:50:19 GMT 2008


horatio wrote:
> for example; lets say i want to rewrite the way slugs are saved. i'd hook
> into the 'name_save_pre' filter, but then i'm isolated to the passed name
> with no reference to the rest of the post. how can i get the proper title of
> the post without going into the database or using raw post data?

I'm not sure why you are opposed to using the raw post data. You can 
see the entire form the person submitted in $_POST, and it's a 
legitimate way to figure out what's going on in post-save-related hook 
functions.

You might also look at the sanitize_title filter. That lets you 
influence the default slug, without overwriting if someone has 
manually edited the slug (probably a good thing to leave manual edits 
alone).

     --Jennifer

-- 
Jennifer Hodgdon * Poplar ProductivityWare
www.poplarware.com

Drupal/WordPress Sites, Themes, Modules/Plugins
Custom Web Programming, Web Databases
PHP, Perl, MySQL, JavaScript, XML, AJAX



More information about the wp-hackers mailing list