Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
WP Revisions Control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WP Plugins
WP Revisions Control
Commits
43628c1f
Commit
43628c1f
authored
May 26, 2019
by
Erick Hitter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cap checks to bulk actions
parent
f9201143
Pipeline
#1064
passed with stages
in 3 minutes and 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
inc/class-wp-revisions-control-bulk-actions.php
inc/class-wp-revisions-control-bulk-actions.php
+14
-0
languages/wp-revisions-control.pot
languages/wp-revisions-control.pot
+4
-4
No files found.
inc/class-wp-revisions-control-bulk-actions.php
View file @
43628c1f
...
...
@@ -103,6 +103,20 @@ class WP_Revisions_Control_Bulk_Actions {
return
;
}
$post_type_caps
=
get_post_type_object
(
$screen
->
post_type
)
->
cap
;
$user_can
=
current_user_can
(
$post_type_caps
->
edit_posts
)
&&
current_user_can
(
$post_type_caps
->
edit_published_posts
)
&&
current_user_can
(
$post_type_caps
->
edit_others_posts
);
$user_can
=
apply_filters
(
'wp_revisions_control_current_user_can_bulk_actions'
,
$user_can
,
$screen
->
post_type
);
if
(
!
$user_can
)
{
return
;
}
if
(
'edit'
!==
$screen
->
base
)
{
return
;
}
...
...
languages/wp-revisions-control.pot
View file @
43628c1f
...
...
@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: WP Revisions Control 1.3\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/wp-revisions-control\n"
"POT-Creation-Date: 2019-05-26 2
0:48:21
+00:00\n"
"POT-Creation-Date: 2019-05-26 2
3:14:32
+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
...
...
@@ -33,15 +33,15 @@ msgstr ""
msgid "Purge ALL revisions"
msgstr ""
#: inc/class-wp-revisions-control-bulk-actions.php:2
29
#: inc/class-wp-revisions-control-bulk-actions.php:2
43
msgid "Purged all revisions."
msgstr ""
#: inc/class-wp-revisions-control-bulk-actions.php:2
36
#: inc/class-wp-revisions-control-bulk-actions.php:2
50
msgid "Purged excess revisions."
msgstr ""
#: inc/class-wp-revisions-control-bulk-actions.php:2
44
#: inc/class-wp-revisions-control-bulk-actions.php:2
58
msgid "WP Revisions Control encountered an unspecified error."
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment