Changeset 903009
- Timestamp:
- 04/26/2014 05:17:00 AM (12 years ago)
- Location:
- autoset-featured-image/trunk
- Files:
-
- 2 edited
-
autoset-featured-image.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
autoset-featured-image/trunk/autoset-featured-image.php
r903003 r903009 7 7 Plugin URI: http://www.arefly.com/autoset-featured-image/ 8 8 Description: Auto Set the first image of your post to Featured Image. 9 Version: 1.1. 19 Version: 1.1.2 10 10 Author: Arefly 11 11 Author URI: http://www.arefly.com/ … … 52 52 add_action('pending_to_publish', 'autoset_featured_image'); 53 53 add_action('future_to_publish', 'autoset_featured_image'); 54 55 function autoset_featured_image_for_old_posts(){56 $all_posts = get_posts(array('numberposts' => 9999));57 foreach($all_posts as $k => $v){58 $args = array(59 'numberposts' => 1,60 'order'=> 'ASC',61 'post_mime_type' => 'image',62 'post_parent' => $v->ID,63 'post_type' => 'attachment'64 );65 $attachments = get_children($args);66 $i = 0;67 foreach($attachments as $attach){68 if($i == 0)69 $attachmentsid = $attach->ID;70 $i++;71 }72 set_post_thumbnail($v->ID, $attachmentsid);73 }74 }75 add_action('admin_init', 'autoset_featured_image_for_old_posts'); -
autoset-featured-image/trunk/readme.txt
r903003 r903009 63 63 == Changelog == 64 64 65 **Version 1.1.2** 66 67 * Fix Bugs. 68 65 69 **Version 1.1.1** 66 70 … … 70 74 71 75 * Support WordPress 3.9. 72 73 * Now the plugin will auto set the Featured Image of old posts!74 76 75 77 **Version 1.0.8 to 1.0.9**
Note: See TracChangeset
for help on using the changeset viewer.