diff --git a/includes/api/api-template.php b/includes/api/api-template.php index 4f5b1cc0..2eb699f7 100644 --- a/includes/api/api-template.php +++ b/includes/api/api-template.php @@ -1072,8 +1072,11 @@ function acf_shortcode( $atts ) { $field_type = is_array( $field ) && isset( $field['type'] ) ? $field['type'] : 'text'; + // Allow config errors to show for appropriate caps checked users. + $display_errors_to_user = apply_filters( 'acf/shortcode/display_admin_errors', 'manage_options' ); + if ( ! acf_field_type_supports( $field_type, 'bindings', true ) ) { - if ( is_preview() ) { + if ( is_preview() || current_user_can( $display_errors_to_user ) ) { return apply_filters( 'acf/shortcode/field_not_supported_message', '[' . esc_html__( 'The requested ACF field type does not support output in bindings or the ACF Shortcode.', 'secure-custom-fields' ) . ']' ); } else { return; @@ -1081,7 +1084,7 @@ function acf_shortcode( $atts ) { } if ( isset( $field['allow_in_bindings'] ) && ! $field['allow_in_bindings'] ) { - if ( is_preview() ) { + if ( is_preview() || current_user_can( $display_errors_to_user ) ) { return apply_filters( 'acf/shortcode/field_not_allowed_message', '[' . esc_html__( 'The requested ACF field is not allowed to be output in bindings or the ACF Shortcode.', 'secure-custom-fields' ) . ']' ); } else { return;