6318570 发表于 2014-12-6 00:54:07

function wpforce_featured() {
          global $post;
          $already_has_thumb = has_post_thumbnail($post->ID);
            if (!$already_has_thumb){
            $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
                        if ($attached_image) {
                              foreach ($attached_image as $attachment_id => $attachment) {
                              set_post_thumbnail($post->ID, $attachment_id);
                              }
                           } else {
                              set_post_thumbnail($post->ID, '414');
                           }
                        }
      }//end function
add_action('the_post', 'wpforce_featured');
add_action('save_post', 'wpforce_featured');
add_action('draft_to_publish', 'wpforce_featured');
add_action('new_to_publish', 'wpforce_featured');
add_action('pending_to_publish', 'wpforce_featured');
add_action('future_to_publish', 'wpforce_featured');

soulseacn 发表于 2014-12-7 21:00:03

不知道现在的能用不

小黑兄 发表于 2014-12-14 23:07:09

渴求啊
组知道 最近有升级没?

sinsky 发表于 2014-12-22 06:19:27

:(s 3.X发布接口支持特色图像发布[免获

tiger_king 发表于 2014-12-23 18:01:02

下载来试试~~~~~~~~~~

yeah888 发表于 2014-12-24 18:06:23

看看能不你呢用                                          

ppyace 发表于 2014-12-25 16:08:05

KMPlayer不知道现在用起来怎样

ray111 发表于 2014-12-25 23:24:49

有更新的版本吗

wg198300 发表于 2014-12-29 14:13:25

学习学习。。。。

xiaoheihei 发表于 2015-1-11 12:56:39

标题已经做了伪原创处理
页: 52 53 54 55 56 57 58 59 60 61 [62] 63 64 65 66 67 68 69 70 71
查看完整版本: 火车头WordPress3.5发布模块WordPress 3.X发布接口支持特色图像发布[免获cookie]模块