Skip to content

Commit e880a7e

Browse files
authored
Update disable-empty-trash.php
1 parent a11b49d commit e880a7e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

disable-empty-trash.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@
33
Plugin Name: Disable Empty Trash
44
Plugin URI: https://www.littlebizzy.com/plugins/disable-empty-trash
55
Description: Stops WordPress emptying trash
6-
Version: 2.0.1
6+
Version: 2.0.2
7+
Requires PHP: 7.0
78
Author: LittleBizzy
89
Author URI: https://www.littlebizzy.com
910
License: GPL3
1011
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1112
GitHub Plugin URI: littlebizzy/disable-empty-trash
1213
Primary Branch: master
13-
Prefix: DETTRS
1414
*/
1515

16-
// Disable WordPress.org updates for this plugin
17-
add_filter('gu_override_dot_org', function ($overrides) {
16+
// prevent direct access
17+
if ( ! defined( 'ABSPATH' ) ) {
18+
exit;
19+
}
20+
21+
// disable wordpress.org updates for this plugin
22+
add_filter( 'gu_override_dot_org', function( $overrides ) {
1823
$overrides[] = 'disable-empty-trash/disable-empty-trash.php';
1924
return $overrides;
20-
});
25+
}, 999 );
2126

22-
/**
23-
* Disable automatic trash emptying.
24-
*/
27+
// disable automatic trash emptying
2528
function disable_empty_trash() {
2629
// Remove the scheduled action for emptying trash
2730
remove_action('wp_scheduled_delete', 'wp_scheduled_delete');

0 commit comments

Comments
 (0)