@@ 115-117 (lines=3) @@ | ||
112 | } |
|
113 | } |
|
114 | // Check that must have conditions is less then |
|
115 | if ( $passed < $must_pass ) { |
|
116 | return new WP_Error( 'unauthorized', sprintf( __( 'This user is not authorized to %s on this blog.', 'jetpack' ), implode( ', ', $failed ), 403 ) ); |
|
117 | } |
|
118 | ||
119 | } else { |
|
120 | if ( !current_user_can( $capability ) ) { |
|
@@ 119-123 (lines=5) @@ | ||
116 | return new WP_Error( 'unauthorized', sprintf( __( 'This user is not authorized to %s on this blog.', 'jetpack' ), implode( ', ', $failed ), 403 ) ); |
|
117 | } |
|
118 | ||
119 | } else { |
|
120 | if ( !current_user_can( $capability ) ) { |
|
121 | return new WP_Error( 'unauthorized', sprintf( __( 'This user is not authorized to %s on this blog.', 'jetpack' ), $capability ), 403 ); |
|
122 | } |
|
123 | } |
|
124 | ||
125 | return true; |
|
126 | } |