Plugin Directory

Changeset 2716499


Ignore:
Timestamp:
04/29/2022 08:55:46 PM (4 years ago)
Author:
gingeds
Message:

Update to version 2.0.0 from GitHub

Location:
force-delete-posts
Files:
6 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • force-delete-posts/tags/2.0.0/index.php

    r2487425 r2716499  
    33Plugin Name: Force Delete Posts
    44Plugin 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.2
     5Description: 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.
     6Version: 2.0.0
    77Author: Liam Stewart
    88Author URI: https://liamstewart.ca
    99*/
    1010
    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.
     12if ( ! defined('WPINC')) {
     13    die;
    2014}
    2115
    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&amp;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 );
     16require 'admin/forceDeletePosts.php';
     17$plugin = new \ForceDeletePosts\forceDeletePosts();
  • force-delete-posts/tags/2.0.0/readme.txt

    r2688510 r2716499  
    99Deleting Posts has never been so fast!
    1010
    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. 
     11This 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.
    1212
    1313== Installation ==
     
    2323
    2424== Changelog ==
     25 = 2.0.0 =
     26 * Complete plugin rewrite to modernize the codebase
    2527 = 1.1.2 =
    26  * WordPress 5.3 support 
     28 * WordPress 5.3 support
    2729 = 1.1.1 =
    2830 * Icon color change
  • force-delete-posts/trunk/index.php

    r2487425 r2716499  
    33Plugin Name: Force Delete Posts
    44Plugin 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.2
     5Description: 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.
     6Version: 2.0.0
    77Author: Liam Stewart
    88Author URI: https://liamstewart.ca
    99*/
    1010
    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.
     12if ( ! defined('WPINC')) {
     13    die;
    2014}
    2115
    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&amp;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 );
     16require 'admin/forceDeletePosts.php';
     17$plugin = new \ForceDeletePosts\forceDeletePosts();
  • force-delete-posts/trunk/readme.txt

    r2688510 r2716499  
    99Deleting Posts has never been so fast!
    1010
    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. 
     11This 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.
    1212
    1313== Installation ==
     
    2323
    2424== Changelog ==
     25 = 2.0.0 =
     26 * Complete plugin rewrite to modernize the codebase
    2527 = 1.1.2 =
    26  * WordPress 5.3 support 
     28 * WordPress 5.3 support
    2729 = 1.1.1 =
    2830 * Icon color change
Note: See TracChangeset for help on using the changeset viewer.