[wp-hackers] page_edit_form behaves differently?
AJ Chen
canovaj at gmail.com
Fri Jun 30 04:58:00 GMT 2006
Thanks for helping. I use hooks for post/page editors to pass a parameter
throught $_REQUEST to the next hook - "save_post" and 'publish_post'. It
works for writing post, but does not work for writing page. See below for
code sections. Does page_edit_form work the same way as the hooks for post
edit forms?
Is there a better way to pass custom parameters from edit page to save_post
hook function?
function w2x_pass_request_params(){
$w2x_type = $_REQUEST['w2x'];
$out = '<input type="hidden" name="w2x" value="' . $w2x_type . '" />';
echo $out;
}
add_action('simple_edit_form', 'w2x_pass_request_params');
add_action('edit_form_advanced', 'w2x_pass_request_params');
add_action('edit_page_form', 'w2x_pass_request_params');
function post2RDF($id){
$w2x_type = $_REQUEST['w2x']; // this parameter is not set when
edit_page_form hook is used!
}
add_action('publish_post', 'post2RDF');
add_action('save_post', 'post2RDF');
Appreciaete your advice,
AJ
More information about the wp-hackers
mailing list