Changeset 812995
- Timestamp:
- 11/30/2013 08:34:42 PM (12 years ago)
- Location:
- rj-quick-empty-trash/trunk
- Files:
-
- 3 edited
-
RJQET_Plugin.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
rj-quick-empty-trash.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rj-quick-empty-trash/trunk/RJQET_Plugin.php
r807891 r812995 102 102 var data = { 103 103 action: 'rjquet_custom_empty_trash_ajax', 104 type: 'comment'104 type: t.data('pt') 105 105 }; 106 106 107 if (t.hasClass('post')) {107 /*if (t.hasClass('post')) { 108 108 data.type = 'post'; 109 109 } else if (t.hasClass('page')) 110 110 { 111 111 data.type = 'page'; 112 } 112 }*/ 113 113 114 114 $.ajax('".admin_url()."admin-ajax.php', { … … 129 129 if ( array_key_exists( 'trash', $views ) ) 130 130 { 131 $type = ' comment'; 132 if (get_current_screen()->id === 'edit-page') 133 { 134 $type = ' page'; 135 } else if (get_current_screen()->id === 'edit-post') 136 { 137 $type = ' post'; 131 if (get_current_screen()->id == 'edit-comments') { 132 $type = 'comment'; 133 } else { 134 $type = get_current_screen()->post_type; 138 135 } 139 $views['trash'] .= ' | <div id="rj_custom_empty_trash" class="button apply '.$type.'">Empty Trash</div>';136 $views['trash'] .= ' | <div id="rj_custom_empty_trash" class="button apply" data-pt="'.$type.'">Empty Trash</div> '; 140 137 } 141 138 return $views; … … 153 150 } 154 151 if ($hook_suffix == 'edit.php') { 155 add_filter( 'views_edit-post', array( &$this, 'rjquet_custom_empty_trash_filter_menu' ) ); 156 add_filter( 'views_edit-page', array( &$this, 'rjquet_custom_empty_trash_filter_menu' ) ); 152 add_filter( 'views_edit-'.get_current_screen()->post_type, array( &$this, 'rjquet_custom_empty_trash_filter_menu' ) ); 157 153 } 158 154 } … … 178 174 'post_status' => 'trash', 179 175 'numberposts' => -1, 180 'post_type' => 'page'176 'post_type' => $_POST['type'] 181 177 ); 182 if ($_POST['type'] == 'post') {183 $args['post_type'] = 'post';184 }185 178 186 179 $trash = get_posts($args); … … 189 182 } 190 183 191 if ($_POST['type'] == 'post') { 192 die('Emptied trash for Posts'); 193 } 194 195 if ($_POST['type'] == 'page') { 196 die('Emptied trash for Pages'); 197 } 198 199 die( 'Something doesn\'t seem right here.' ); 184 die('Emptied trash for '.$_POST['type']); 200 185 } 201 186 -
rj-quick-empty-trash/trunk/readme.txt
r807891 r812995 6 6 Requires at least: 3.5 7 7 Tested up to: 3.7.1 8 Stable tag: 0.0. 18 Stable tag: 0.0.2 9 9 10 10 Easier access to empty the trash for Comments, Posts and Pages … … 32 32 == Changelog == 33 33 34 = 0.2 = 35 - Added more spacing to nav item to better fit the WordPress style 36 - Added support for Custom Post Types 37 34 38 = 0.1 = 35 39 - Initial Revision -
rj-quick-empty-trash/trunk/rj-quick-empty-trash.php
r807891 r812995 3 3 Plugin Name: RJ Quick Empty Trash 4 4 Plugin URI: http://wordpress.org/extend/plugins/rj-quick-empty-trash/ 5 Version: 0.0. 15 Version: 0.0.2 6 6 Author: Randy Jensen 7 7 Description: Easier access to empty the trash for Posts, Pages and Comments
Note: See TracChangeset
for help on using the changeset viewer.