Skip to content

Commit 94726f3

Browse files
OlegApanovichorkunaybek
authored andcommitted
VC-3425 fix report issue
1 parent adcced8 commit 94726f3

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

plugin-wordpress.php

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
/**
54
* Plugin Name: Visual Composer
65
* Plugin URI: https://visualcomposer.com/premium/?utm_source=vcwb&utm_medium=wpplugins&utm_campaign=vcbrand&utm_content=text

visualcomposer/Helpers/Access/UserCapabilities.php

+20
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,26 @@ public function isEditorEnabled($postType)
7070
return $hasAccess;
7171
}
7272

73+
/**
74+
* Check if last user who edit post has unfiltered_html capability.
75+
*
76+
* @return bool
77+
*/
78+
public function isLastPostEditorCanUnfilteredHtml($post_id)
79+
{
80+
$is_unfiltered_html = false;
81+
$last_id = get_post_meta($post_id, '_edit_last', true);
82+
if ($last_id) {
83+
$last_user = get_userdata($last_id);
84+
85+
if ($last_user && $last_user->has_cap('unfiltered_html')) {
86+
$is_unfiltered_html = true;
87+
}
88+
}
89+
90+
return $is_unfiltered_html;
91+
}
92+
7393
public function getPrefixedCapabilities()
7494
{
7595
if (!empty(self::$prefixedCapabilities)) {

0 commit comments

Comments
 (0)