Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

1st question is: is a nonce required for a meta box? i read on the wordpress codex add_meta_box and they have a nonce for the meta box, i'd thought that maybe the add post form will already include a nonce?

echo '<input type="hidden" name="myplugin_noncename" id="myplugin_noncename" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

2nd question is: whats the parameters available for the function that creates the markup of the meta box. from what i read in profesional wordpress looks like

function pp_meta($post, $box)

how will i know what parameters are available in such functions? and what does box refer to?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Not sure about nonces.

As for arguments it is probably their usage of add_meta_box():

$callback_args (array) (optional) Arguments to pass into your callback function. The callback will receive the $post object and whatever parameters are passed through this variable. Default: null

So $post is post object and $box is whatever they are passing in $callback_args

share|improve this answer
    
The nonce in the example is unrelated to add_meta_box. It's just something that example code is making use of to use it to protect the form, but that's optional. You can learn more about nonces here: wp_create_nonce() : codex.wordpress.org/Function_Reference/wp_create_nonce –  hakre Sep 14 '10 at 17:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.