Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions includes/api/api-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1072,16 +1072,19 @@ 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;
}
}

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;
Expand Down
Loading