Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Bulk Actions Cron Offload
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
Bulk Actions Cron Offload
Commits
ee296499
Commit
ee296499
authored
8 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Display notice for anyone who accesses the trash while a purge is pending
parent
49ba1f03
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/class-delete-all.php
+18
-8
18 additions, 8 deletions
includes/class-delete-all.php
with
18 additions
and
8 deletions
includes/class-delete-all.php
+
18
−
8
View file @
ee296499
...
...
@@ -109,16 +109,26 @@ class Delete_All {
* Let the user know what's going on
*/
public
static
function
admin_notices
()
{
if
(
!
isset
(
$_REQUEST
[
self
::
ADMIN_NOTICE_KEY
]
)
)
{
return
;
$screen
=
get_current_screen
();
if
(
isset
(
$_REQUEST
[
self
::
ADMIN_NOTICE_KEY
]
)
)
{
if
(
1
===
(
int
)
$_REQUEST
[
self
::
ADMIN_NOTICE_KEY
]
)
{
$class
=
'notice-success'
;
$message
=
__
(
'Success! The trash will be emptied soon.'
,
'automattic-bulk-edit-cron-offload'
);
}
else
{
$class
=
'notice-error'
;
$message
=
__
(
'A request to empty the trash is already pending for this post type.'
,
'automattic-bulk-edit-cron-offload'
);
}
}
elseif
(
'edit'
===
$screen
->
base
&&
isset
(
$_REQUEST
[
'post_status'
]
)
&&
'trash'
===
$_REQUEST
[
'post_status'
]
)
{
if
(
self
::
action_next_scheduled
(
self
::
CRON_EVENT
,
$screen
->
post_type
)
)
{
$class
=
'notice-warning'
;
$message
=
__
(
'A pending request to empty the trash will be processed soon.'
,
'automattic-bulk-edit-cron-offload'
);
}
}
if
(
1
===
(
int
)
$_REQUEST
[
self
::
ADMIN_NOTICE_KEY
]
)
{
$class
=
'notice-success'
;
$message
=
__
(
'Success! The trash will be emptied soon.'
,
'automattic-bulk-edit-cron-offload'
);
}
else
{
$class
=
'notice-error'
;
$message
=
__
(
'A request to empty the trash is already pending for this post type.'
,
'automattic-bulk-edit-cron-offload'
);
// Nothing to display
if
(
!
isset
(
$class
)
||
!
isset
(
$message
)
)
{
return
;
}
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment