WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ;)

share|improve this question
You yourself have linked to the codex entry that answers this. – Johannes Pille Apr 1 '13 at 18:01
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


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.