Custom select box meta field

To save post meta fields from custom meta boxes you need to hook into save_post with something like this: add_action( ‘save_post’, ‘myplugin_save_postdata’ ); There is some full example code on adding meta boxes on the codex Function Reference/add meta box

Metabox doesn’t retain values

Many of the comments below refer to code used for debugging, which for clarity I’ve removed. I should have spotted this soon – you are adding only one row into the postmeta table, and that row has the key _my_meta. Before inserting the array int the table, WordPress serializes the array. When you retrieve the … Read more

Setting Event to Expire Using Custom Metabox

Have a look at the Post Expirator plugin. The Post Expirator plugin allows the user to set expiration dates for both posts and pages. There is a configuration option page in the plugins area that will allow you to seperataly control whether or not posts/pages are either deleted or changed to draft status.

Attaching a metabox to a single post

Since you are familiar with the how to create metabox using add_meta_box already, I’ll skip to the relevant bits. You can either conditionally add_meta_box depending on the current post title, or ID, (this is the preferred method) or, you can conditionally remove_meta_box depending on the the post displayed. To detect the current post ID you … Read more

Form submit from modal window to parent window

Use the parent method to pass data back to your meta field. Create a JS function to handle the passing of data from Thickbox to the meta field: function foo_interstitial(data){ $(‘.form-field-selector’).val(data); } Add a submit handler to your thickbox instance that passes to the parent.foo_interstitial() function. $(‘.thickbox-submit-selector’).submit(function(){ var _value_to_pass = $(‘.field-to-pass-selector’).val(); parent.foo_interstitial(_value_to_pass); });