So Im just getting started with Custom Post Types. I'm trying to make a custom post called a Certificate. The thing is, I don't need any of the usual 'editor' boxes or anything that would normally be in a post. All I need is an upload form for a user to upload a file.

So I've set up the the Certificate post-type, and I made it so it doesn't support anything, so nothing appears on the page. I then added a 'admin_init' hook to display a form.

But now i'm a little stuck. Can someone give me a breif outline of what hooks to use to process the form? How do I make it so it activates this hook only for 'Certificate' post types?

  • have any example form code you wish to share? It'll make it easier to answer. – Brooke. Oct 10 '11 at 6:19

Take a look at this answer.


You can use the save_post hook. Your hooked-in function examines the posted data and runs a block of code only if the $_POST['post_type'] matches your Certificate type.

The function should also ensure that the user has the authentication and intention of running the particular function.

More information including a full worked example of adding a post meta box and processing the data is included in the WordPress codex at: http://codex.wordpress.org/Function_Reference/add_meta_box

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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