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.

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?

share|improve this question
    
have any example form code you wish to share? It'll make it easier to answer. –  BandonRandon Oct 10 '11 at 6:19
add comment

2 Answers 2

up vote 0 down vote accepted

Take a look at this answer.

share|improve this answer
add comment

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

share|improve this answer
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.