[wp-hackers] Adding a checkbox to the write articles page

Mário Gamito gamito at gmail.com
Tue Jan 22 08:33:58 GMT 2008


Hi,

I'm trying to write a plugin to add a checkbox to the write articles 
page, but it doesn't appear.

My code is:

function sapo_tags($id)
{

//delete the existing field
delete_post_meta($id, 'checkbox');
//Get the value from your form
$userEnteredValue = $_POST["userEnteredValue"];
//Add your value as a custom field with the key 'myKey'
//but only if the form data exists
if (isset($userEnteredValue) && !empty ($userEnteredValue)){
add_post_meta($id, 'checkbox', $userEnteredValue);}

}

Any ideas ?

Any help would be appreciated.

Warm Regards,
Mário Gamito


More information about the wp-hackers mailing list