[wp-hackers] Set post thumbnail via code
bradw at illiams.com
Fri Mar 12 15:54:01 UTC 2010
Well that couldn't have been easier. Thanks Glenn!
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Glenn Ansley
Sent: Friday, March 12, 2010 10:42 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Set post thumbnail via code
Do you need something more than this:
update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id );
I got that from /wp-admin/admin-ajax.php L1413 on trunk (several revisions
On Fri, Mar 12, 2010 at 10:31 AM, Brad Williams <bradw at illiams.com> wrote:
> Is it possible to set a post thumbnail using code? I've been digging
> through the Core process of setting a post thumbnail and it appears the
> WPSetAsThumbnail() function (located in set-post-thumbnail.js) is what
> actually creates/assigns the thumbnail, but I wasn't sure if this could be
> called directly?
> Has anyone tried this?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
wp-hackers mailing list
wp-hackers at lists.automattic.com
More information about the wp-hackers