1

I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the save_post hook. For example, in the WordPress Codex it gives the following example:

<?php add_action( 'save_post', 'my_save_post', 10, 2 ); ?> 

What do the 10 and 2 mean at the end?

I've tried talking to an "expert", but they've been of no help ;)

1
  • 2
    You yourself have linked to the codex entry that answers this. Commented Apr 1, 2013 at 18:01

1 Answer 1

2

The 10 is the priority (relative to other added actions) and the 2 is simply the number of arguments that my_save_post() will accept.

See the codex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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