How to get images from EDD post?
How to get images from EDD post?
How to get images from EDD post?
Hi @Jeremy Love: Good question! And it’s a good question because there do not appear to be any hooks to allow you to write code to filtering by author. Sadly that means to copy their copy to make your own functions so you can make the required 1 line change (in this case, it’s ‘post_author’ … Read more
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
that’s your nivo-slider at work
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
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!
It’s a icon with which to display the attachment. If it isn’t set, it uses the default icon. The exception here is for images: the returned values always refer to the thumbnail (of size set in the arguments of wp_get_attachment_image_src). Icons are always shown at their original size. If the attachment was an audio file, … Read more
Wrote a script myself, along with a blog post. Contributions for improvements are appreciated. Refer to this link for answer: Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
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
So I have completed a way to replace links to attachments pages for images, and replace them with not only the url to the img tag, but to the large version of the image file. I’m not using regex because it’s evil and I don’t want to make kitten dies. It working for me, so … Read more