[wp-trac] [WordPress Trac] #12969: save_post action hook called before post-new.php is loaded
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 11 23:09:01 UTC 2010
#12969: save_post action hook called before post-new.php is loaded
--------------------------+-------------------------------------------------
Reporter: duck_ | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: General | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Since r12987 new posts/pages are being saved into database as auto-drafts,
this means that the save_post action hook is called as post-new.php is
loading ({{{$post = get_default_post_to_edit( $post_type, true );}}} on
line 55).
Unfortunately any plugin or theme following the
[http://codex.wordpress.org/Function_Reference/add_meta_box#Example codex]
on adding meta boxes may run into trouble with nonce protection. Whenever
a user goes to create a new post/page myplugin_save_postdata (function
from codex example) will be called (because of the save_post action).
However, the custom nonce will not exist since the function to create the
meta box hasn't been called.
I guess best fix might be just to change the instructions.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12969>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list