Changeset 478283
- Timestamp:
- 12/20/2011 11:43:08 PM (14 years ago)
- Location:
- attached-images-title-editor/trunk
- Files:
-
- 3 edited
-
attached_images_title_editor.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
attached-images-title-editor/trunk/attached_images_title_editor.php
r477822 r478283 31 31 case 'name': 32 32 case 'post_title': 33 case 'post_date': 33 34 return $item[$column_name]; 34 35 default: … … 56 57 } 57 58 58 function column_cb($item){ 59 return sprintf( 60 '<input type="checkbox" name="%1$s[]" value="%2$s" />', 61 /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("image") 62 /*$2%s*/ $item['ID'] //The value of the checkbox should be the record's id 63 ); 64 } 59 function column_date($item) { 60 $date = sprintf('%s',$item['post_date']); 61 return $date; 62 } 63 64 function column_qty($item) { 65 $qty = sprintf('%s',$item['attached']); 66 return $qty; 67 } 68 69 //function column_cb($item){ 70 // return sprintf( 71 // '<input type="checkbox" name="%1$s[]" value="%2$s" />', 72 /*$1%s*/ //$this->_args['singular'], //Let's simply repurpose the table's singular label ("image") 73 /*$2%s*/ //$item['ID'] //The value of the checkbox should be the record's id 74 //); 75 //} 65 76 66 77 function get_columns(){ 67 78 $columns = array( 68 'post_title' => 'Title', 69 'name' => 'Category', 70 'tx' => 'New title' 79 'post_title' => 'Title', 80 'name' => 'Category', 81 'date' => 'Date', 82 'qty' => 'Attached images', 83 'tx' => 'New title' 71 84 ); 72 85 return $columns; … … 75 88 function get_sortable_columns() { 76 89 $sortable_columns = array( 77 'post_title' => array('post_title',true), //true means its already sorted 78 'name' => array('name',false) 90 'post_title' => array('post_title',true), //true means its already sorted 91 'name' => array('name',false), 92 'date' => array('post_date',false) 79 93 ); 80 94 return $sortable_columns; … … 94 108 global $wpdb; 95 109 global $post; 96 $querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->terms.name 97 FROM $wpdb->posts98 LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)99 LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)100 LEFT JOIN $wpdb->terms ON($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id)101 WHERE $wpdb->posts.post_type = '$tipo'102 AND $wpdb->posts.post_status='publish'110 111 $querystr = "SELECT p.ID, p.post_title, p.post_date, wp_terms.name, (SELECT COUNT(pp.ID) FROM wp_posts pp WHERE pp.post_type = 'attachment' AND pp.post_parent = p.ID) as attached 112 FROM wp_posts p 113 LEFT JOIN wp_term_relationships ON (p.ID =wp_term_relationships.object_id) 114 LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) 115 LEFT JOIN wp_terms ON(wp_terms.term_id =wp_term_taxonomy.term_id) 116 WHERE p.post_status='publish' 103 117 "; 104 118 if ($tipo == 'post') { $querystr = $querystr." AND $wpdb->term_taxonomy.taxonomy = 'category'"; } -
attached-images-title-editor/trunk/readme.txt
r477822 r478283 5 5 Requires at least: 3 6 6 Tested up to: 3.3 7 Stable tag: 1 7 Stable tag: 1.1 8 8 9 9 This plugin has the hability to change the title of all the images attached to a post by inserting a new title for them all. … … 45 45 == Upgrade Notice == 46 46 47 = 1.0 = 48 This is a fully working version. 47 = 1.1 = 48 *Added sortable date column. 49 *Added quantity of images attached column -
attached-images-title-editor/trunk/style.css
r477822 r478283 5 5 float:right; 6 6 } 7 #filter input {8 margin-right:5px;9 }10 7 .checkmark { 11 8 margin-left:5px; 12 9 margin-right:5px; 13 10 } 11 #post_title { width:30%; } 12 #name { width:20%; } 13 #date { width:150px; } 14 #qty { width:80px; } 15 .column-qty { text-align:center; } 16 #tx { width:30%; } 17 .new_desc { width:50%; margin-right:5px; }
Note: See TracChangeset
for help on using the changeset viewer.