How to add multiple checkbox elements to media attachments?

Like @Bainternet said, it is the same thing. Taking the code from the question you linked to, you can do it like this: function filter_attachment_fields_to_edit( $form_fields, $post ) { $foo = (bool)get_post_meta( $post->ID, ‘foo’, true ); $bar = (bool)get_post_meta( $post->ID, ‘bar’, true ); $form_fields[‘foo’] = array( ‘label’ => ‘Is Foo’, ‘input’ => ‘html’, ‘html’ => … Read more

Post Auto Draft Issue

You probably need to modify the columns displayed in your Custom Post posts list, so that the list isn’t dependent solely on Post Title. I have a similar situation, with a Custom Post Type that consists solely of a “featured image” (and a “link” custom metabox). I modified the Post list to output the image, … Read more

How to add attachment without uploading?

You need the local path to add an attachment: // add the file to the media library $attachment = array( ‘post_mime_type’ => ‘image/png’ // the MIME type , ‘post_title’ => ‘Attachment title’ ); // Adds the file to the media library and generates the thumbnails. $attach_id = wp_insert_attachment( $attachment, $path ); // PATH!

Getting ID from ajax response of async-upload.php

I could but i really don’t want to post the work of others here, even if it’s open source code. Rilwis Meta Box Class has a plupload field, which has a custom upload handler. If you mind to take a look: https://github.com/rilwis/meta-box resp: https://github.com/rilwis/meta-box/blob/master/inc/fields/plupload-image.php#L31 The answer is there. This code,or at least the idea, gives … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)