Skip to content

Commit

Permalink
Additional check for current user capabilities #845
Browse files Browse the repository at this point in the history
Typo fixes
  • Loading branch information
Devin Walker committed Aug 10, 2016
1 parent c113659 commit cfae0a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/admin/shortcodes/abstract-shortcode-generator.php
Expand Up @@ -75,6 +75,10 @@ public function __construct( $shortcode ) {
*/
public function init() {

if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
return;
}

if ( $this->shortcode_tag ) {

$this->self = get_class( $this );
Expand Down Expand Up @@ -382,7 +386,7 @@ protected function validate( $field ) {

if ( ! ! $required || is_array( $required ) ) {

$alert = esc_html__( 'Some of the Shortcode options are required.', 'give' );
$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );

if ( isset( $required['alert'] ) ) {

Expand All @@ -391,7 +395,7 @@ protected function validate( $field ) {
} else if ( ! empty( $label ) ) {

$alert = sprintf(
/* translators: %s: option lable */
/* translators: %s: option label */
esc_html__( 'The "%s" option is required.', 'give' ),
str_replace( ':', '', $label )
);
Expand Down

0 comments on commit cfae0a3

Please sign in to comment.