Changeset 2716499
- Timestamp:
- 04/29/2022 08:55:46 PM (4 years ago)
- Location:
- force-delete-posts
- Files:
-
- 6 added
- 4 edited
- 1 copied
-
tags/2.0.0 (copied) (copied from force-delete-posts/trunk)
-
tags/2.0.0/admin (added)
-
tags/2.0.0/admin/forceDeletePosts.php (added)
-
tags/2.0.0/admin/styles.css (added)
-
tags/2.0.0/index.php (modified) (1 diff)
-
tags/2.0.0/readme.txt (modified) (2 diffs)
-
trunk/admin (added)
-
trunk/admin/forceDeletePosts.php (added)
-
trunk/admin/styles.css (added)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
force-delete-posts/tags/2.0.0/index.php
r2487425 r2716499 3 3 Plugin Name: Force Delete Posts 4 4 Plugin URI: https://github.com/liamstewart23/WordPressForceDeletePosts 5 Description: Adds the ability for administrators to instantly delete posts by skipping the trash.6 Version: 1.1.25 Description: Adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. 6 Version: 2.0.0 7 7 Author: Liam Stewart 8 8 Author URI: https://liamstewart.ca 9 9 */ 10 10 11 /** 12 * Post List Styles 13 */ 14 function ls_fd_column_width() 15 { 16 echo '<style type="text/css">'; 17 echo '.column-ls_fd_column { text-align: center; width:60px !important; overflow:hidden }'; 18 echo '.ls_plfi_label {justify-content:center;display:flex;}'; 19 echo '</style>'; 11 // If this file is called directly, abort. 12 if ( ! defined('WPINC')) { 13 die; 20 14 } 21 15 22 add_action('admin_head', 'ls_fd_column_width'); 23 24 /** 25 * @param $defaults 26 * @return mixed 27 * Adding column to post list. 28 */ 29 function ls_fd_columns_head($defaults) 30 { 31 $defaults['ls_fd_column'] = '<span class="ls_plfi_label">Force <br/> Delete</span>'; 32 return $defaults; 33 } 34 35 /** 36 * @param $column_name 37 * @param $post_ID 38 * Adding column icon. 39 */ 40 function ls_fd_columns_content($column_name, $post_ID) 41 { 42 // If column exists 43 if ($column_name === 'ls_fd_column') { 44 ls_fd_force_delete('<span class="dashicons dashicons-trash" style="color: #b90e0e;"></span>'); 45 } 46 } 47 48 // Pages 49 add_filter('manage_pages_columns', 'ls_fd_columns_head'); 50 add_action('manage_pages_custom_column', 'ls_fd_columns_content', 10, 2); 51 52 // All Post Types 53 add_filter('manage_posts_columns', 'ls_fd_columns_head'); 54 add_action('manage_posts_custom_column', 'ls_fd_columns_content', 10, 2); 55 56 /** 57 * @param string $link 58 * Delete Post 59 */ 60 function ls_fd_force_delete($link = '<span class="dashicons dashicons-trash" style="color: #b90e0e;"></span>') 61 { 62 global $post; 63 if (!current_user_can('edit_post', $post->ID)) { 64 return; 65 } 66 67 $link = "<a onclick=\"return confirm('Permanently delete this?')\" href='" . wp_nonce_url(get_admin_url() . 'post.php?action=delete&post=' . $post->ID, 'delete-post_' . $post->ID) . "'>" . $link . "</a>"; 68 echo $link; 69 } 70 71 /** 72 * @param $post_id 73 * Delete post attachments 74 */ 75 function ls_fd_remove_attachment($post_id) 76 { 77 if(has_post_thumbnail( $post_id )) { 78 $attachment_id = get_post_thumbnail_id( $post_id ); 79 wp_delete_attachment($attachment_id, true); 80 } 81 } 82 add_action( 'before_delete_post', 'ls_fd_remove_attachment', 10 ); 16 require 'admin/forceDeletePosts.php'; 17 $plugin = new \ForceDeletePosts\forceDeletePosts(); -
force-delete-posts/tags/2.0.0/readme.txt
r2688510 r2716499 9 9 Deleting Posts has never been so fast! 10 10 11 This lightweight plugin adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. Clicking the Force Delete Button will delete the item instantly by skipping the trash. 11 This lightweight plugin adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. Clicking the Force Delete Button will delete the item instantly by skipping the trash. 12 12 13 13 == Installation == … … 23 23 24 24 == Changelog == 25 = 2.0.0 = 26 * Complete plugin rewrite to modernize the codebase 25 27 = 1.1.2 = 26 * WordPress 5.3 support 28 * WordPress 5.3 support 27 29 = 1.1.1 = 28 30 * Icon color change -
force-delete-posts/trunk/index.php
r2487425 r2716499 3 3 Plugin Name: Force Delete Posts 4 4 Plugin URI: https://github.com/liamstewart23/WordPressForceDeletePosts 5 Description: Adds the ability for administrators to instantly delete posts by skipping the trash.6 Version: 1.1.25 Description: Adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. 6 Version: 2.0.0 7 7 Author: Liam Stewart 8 8 Author URI: https://liamstewart.ca 9 9 */ 10 10 11 /** 12 * Post List Styles 13 */ 14 function ls_fd_column_width() 15 { 16 echo '<style type="text/css">'; 17 echo '.column-ls_fd_column { text-align: center; width:60px !important; overflow:hidden }'; 18 echo '.ls_plfi_label {justify-content:center;display:flex;}'; 19 echo '</style>'; 11 // If this file is called directly, abort. 12 if ( ! defined('WPINC')) { 13 die; 20 14 } 21 15 22 add_action('admin_head', 'ls_fd_column_width'); 23 24 /** 25 * @param $defaults 26 * @return mixed 27 * Adding column to post list. 28 */ 29 function ls_fd_columns_head($defaults) 30 { 31 $defaults['ls_fd_column'] = '<span class="ls_plfi_label">Force <br/> Delete</span>'; 32 return $defaults; 33 } 34 35 /** 36 * @param $column_name 37 * @param $post_ID 38 * Adding column icon. 39 */ 40 function ls_fd_columns_content($column_name, $post_ID) 41 { 42 // If column exists 43 if ($column_name === 'ls_fd_column') { 44 ls_fd_force_delete('<span class="dashicons dashicons-trash" style="color: #b90e0e;"></span>'); 45 } 46 } 47 48 // Pages 49 add_filter('manage_pages_columns', 'ls_fd_columns_head'); 50 add_action('manage_pages_custom_column', 'ls_fd_columns_content', 10, 2); 51 52 // All Post Types 53 add_filter('manage_posts_columns', 'ls_fd_columns_head'); 54 add_action('manage_posts_custom_column', 'ls_fd_columns_content', 10, 2); 55 56 /** 57 * @param string $link 58 * Delete Post 59 */ 60 function ls_fd_force_delete($link = '<span class="dashicons dashicons-trash" style="color: #b90e0e;"></span>') 61 { 62 global $post; 63 if (!current_user_can('edit_post', $post->ID)) { 64 return; 65 } 66 67 $link = "<a onclick=\"return confirm('Permanently delete this?')\" href='" . wp_nonce_url(get_admin_url() . 'post.php?action=delete&post=' . $post->ID, 'delete-post_' . $post->ID) . "'>" . $link . "</a>"; 68 echo $link; 69 } 70 71 /** 72 * @param $post_id 73 * Delete post attachments 74 */ 75 function ls_fd_remove_attachment($post_id) 76 { 77 if(has_post_thumbnail( $post_id )) { 78 $attachment_id = get_post_thumbnail_id( $post_id ); 79 wp_delete_attachment($attachment_id, true); 80 } 81 } 82 add_action( 'before_delete_post', 'ls_fd_remove_attachment', 10 ); 16 require 'admin/forceDeletePosts.php'; 17 $plugin = new \ForceDeletePosts\forceDeletePosts(); -
force-delete-posts/trunk/readme.txt
r2688510 r2716499 9 9 Deleting Posts has never been so fast! 10 10 11 This lightweight plugin adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. Clicking the Force Delete Button will delete the item instantly by skipping the trash. 11 This lightweight plugin adds the ability for administrators to instantly delete posts by adding a Force Delete Button to the Post List for Pages, Posts, and all Custom Post Types. Clicking the Force Delete Button will delete the item instantly by skipping the trash. 12 12 13 13 == Installation == … … 23 23 24 24 == Changelog == 25 = 2.0.0 = 26 * Complete plugin rewrite to modernize the codebase 25 27 = 1.1.2 = 26 * WordPress 5.3 support 28 * WordPress 5.3 support 27 29 = 1.1.1 = 28 30 * Icon color change
Note: See TracChangeset
for help on using the changeset viewer.