- fixed small notices about array_intersect;

This commit is contained in:
nikitozzzzzzz
2018-02-19 12:10:54 +02:00
parent f4d1251220
commit 1b03923c6b
7 changed files with 12 additions and 9 deletions
+2 -2
View File
@@ -671,13 +671,13 @@ if ( ! class_exists( 'Shortcodes' ) ) {
if ( ! empty( $a['not'] ) ) {
$not_in_roles = explode( ",", $a['not'] );
if ( is_array( $not_in_roles ) && count( array_intersect( $current_user_roles, $not_in_roles ) ) <= 0 ) {
if ( is_array( $not_in_roles ) && ( empty( $current_user_roles ) || count( array_intersect( $current_user_roles, $not_in_roles ) ) <= 0 ) ) {
return do_shortcode( $this->convert_locker_tags( $content ) );
}
} else {
$roles = explode( ",", $a['roles'] );
if ( is_array( $roles ) && count( array_intersect( $current_user_roles, $roles ) ) > 0 ) {
if ( ! empty( $current_user_roles ) && is_array( $roles ) && count( array_intersect( $current_user_roles, $roles ) ) > 0 ) {
return do_shortcode( $this->convert_locker_tags( $content ) );
}
}