Changeset 3041524
- Timestamp:
- 02/26/2024 08:46:35 PM (2 years ago)
- Location:
- auto-delete-post
- Files:
-
- 22 added
- 2 edited
-
tags/1.1.3 (added)
-
tags/1.1.3/appsero (added)
-
tags/1.1.3/appsero/composer.json (added)
-
tags/1.1.3/appsero/composer.lock (added)
-
tags/1.1.3/appsero/readme.md (added)
-
tags/1.1.3/appsero/src (added)
-
tags/1.1.3/appsero/src/Client.php (added)
-
tags/1.1.3/appsero/src/Insights.php (added)
-
tags/1.1.3/appsero/src/License.php (added)
-
tags/1.1.3/assets (added)
-
tags/1.1.3/assets/css (added)
-
tags/1.1.3/assets/css/style.css (added)
-
tags/1.1.3/auto-delete-post.php (added)
-
tags/1.1.3/readme.txt (added)
-
trunk/appsero (added)
-
trunk/appsero/composer.json (added)
-
trunk/appsero/composer.lock (added)
-
trunk/appsero/readme.md (added)
-
trunk/appsero/src (added)
-
trunk/appsero/src/Client.php (added)
-
trunk/appsero/src/Insights.php (added)
-
trunk/appsero/src/License.php (added)
-
trunk/auto-delete-post.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
auto-delete-post/trunk/auto-delete-post.php
r2886567 r3041524 4 4 * Plugin URI: https://wordpress.org/plugin/auto-delete-post 5 5 * Description: This plugin automatically deletes a post after a certain time 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.2 … … 32 32 } 33 33 add_action( 'admin_enqueue_scripts', 'adp_all_scripts_inclusion' ); 34 35 /** 36 * Initialize the plugin tracker 37 * 38 * @return void 39 */ 40 function appsero_init_tracker_auto_delete_post() { 41 42 if ( ! class_exists( 'Appsero\Client' ) ) { 43 require_once __DIR__ . '/appsero/src/Client.php'; 44 } 45 46 $client = new Appsero\Client( '777556b2-6bfc-4558-a1ef-08a41e10ee58', 'Auto Delete Post – Ultimate plugin for deleting a post automatically', __FILE__ ); 47 48 // Active insights 49 $client->insights()->init(); 50 51 } 52 53 appsero_init_tracker_auto_delete_post(); 54 34 55 35 56 /** … … 56 77 add_submenu_page( 57 78 'adp-post-list', // menu slug 58 esc_html__( 'All Post sList', 'auto-delete-post' ), // title to show in the page59 esc_html__( 'All Post sList', 'auto-delete-post' ), // title to show in the submenu page79 esc_html__( 'All Post Type List', 'auto-delete-post' ), // title to show in the page 80 esc_html__( 'All Post Type List', 'auto-delete-post' ), // title to show in the submenu page 60 81 'manage_options', // capability of the user 61 82 'adp-post-list' // mneu slug … … 204 225 205 226 $adp_obj = new ADP_Auto_Delete_Post(); // class initialization 227 228 // Class for creating a custom column on posts list showing the deletion time 229 class ADP_Custom_Post_Column { 230 public $counter; 231 232 public function __construct() { 233 add_filter( 'manage_posts_columns', [ $this, 'custom_post_delete_column' ] ); // filter hook to add a new column on the posts list 234 235 add_action( 'manage_posts_custom_column', [ $this, 'custom_post_delete_column_content' ], 10, 2 ); // action hook to add content in our new custom column on the posts list 236 } 237 238 // callback of custom column 239 public function custom_post_delete_column( $column ) { 240 $column['adp_post_deletion_time_column'] = 'Auto Deletion Time'; 241 return $column; 242 } 243 244 // callback of custom column content 245 public function custom_post_delete_column_content( $column_name, $post_id ) { 246 $this->counter = get_post_meta( $post_id, 'auto_delete_post_time_key', true ); 247 $converted_user_date_time = strtotime( $this->counter ); 248 249 if ( empty( $converted_user_date_time ) ) { 250 $converted_in_date_format = 'Time not set'; 251 } else { 252 $converted_in_date_format = date( 'Y-m-d h:i A', $converted_user_date_time ) . ' '; 253 } 254 255 // $final_user_date_time = strtotime( $converted_in_date_format ); 256 if ( 'adp_post_deletion_time_column' == $column_name ) { 257 // Display the deletion time 258 printf( esc_html__( '%s', 'auto-delete-post' ), esc_html( $converted_in_date_format ) ); 259 } 260 } 261 } 262 263 $adp_custom_post_columb_obj = new ADP_Custom_Post_Column(); // class initialization 264 265 class Delete_Post_Meta_On_Post_Restore { 266 public function __construct() { 267 add_action( 'untrashed_post', [ $this, 'delete_auto_delte_post_meta' ] ); 268 } 269 270 // Deleting post meta on clicking restore for every post 271 public function delete_auto_delte_post_meta( $post_id ) { 272 // Specifying the meta key 273 $meta_key_to_delete = 'auto_delete_post_time_key'; 274 275 // Delete the post meta 276 delete_post_meta( $post_id, $meta_key_to_delete ); 277 } 278 } 279 280 $adp_delete_post_meta_on_restore = new Delete_Post_Meta_On_Post_Restore(); // class initialization 281 282 283 -
auto-delete-post/trunk/readme.txt
r2886567 r3041524 1 1 === Auto Delete Post - Ultimate plugin for deleting a post automatically === 2 2 Contributors: palashwpdev 3 Donate link: https:// example.com/3 Donate link: https://buymeacoffee.com/palash_wp 4 4 Tags: automatic post delete, automatic delete post, delete post, delete page, delete custom post type, post delete, delete post after a certain time 5 5 Requires PHP: 7.2 6 6 Requires at least: 5.2 7 Tested up to: 6. 1.18 Version: 1.1. 19 Stable tag: 1.1. 27 Tested up to: 6.4.3 8 Version: 1.1.3 9 Stable tag: 1.1.3 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 == Changelog == 40 40 41 = 1.1. 2=42 Added the menu page where all the posts options are listed.41 = 1.1.3 = 42 Solved unable to restore post from trash issue. 43 43 44 44 == Upgrade Notice == 45 45 46 = 1.1. 2=46 = 1.1.3 = 47 47 There is a upgrade available.
Note: See TracChangeset
for help on using the changeset viewer.