Skip to content

Commit ac35ec1

Browse files
committed
Deploying version 6.3.6
1 parent 621bfbf commit ac35ec1

File tree

161 files changed

+1136
-1181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1136
-1181
lines changed

acf.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin Name: Advanced Custom Fields
1010
* Plugin URI: https://www.advancedcustomfields.com
1111
* Description: Customize WordPress with powerful, professional and intuitive fields.
12-
* Version: 6.3.5
12+
* Version: 6.3.6
1313
* Author: WP Engine
1414
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
1515
* Text Domain: acf
@@ -35,7 +35,7 @@ class ACF {
3535
*
3636
* @var string
3737
*/
38-
public $version = '6.3.5';
38+
public $version = '6.3.6';
3939

4040
/**
4141
* The plugin settings array.

assets/build/css/acf-field-group.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-field-group.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-field-group.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-global.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-global.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-global.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-escaped-html-notice.js

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-escaped-html-notice.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-field-group.js

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-field-group.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-field-group.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-input.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-input.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-input.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf.js

+20-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/Blocks/Bindings.php

+25-3
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,35 @@ public function register_binding_sources() {
4747
* @param array $source_attrs An array of the source attributes requested.
4848
* @param \WP_Block $block_instance The block instance.
4949
* @param string $attribute_name The block's bound attribute name.
50-
* @return string The block binding value.
50+
* @return string|null The block binding value or an empty string on failure.
5151
*/
5252
public function get_value( array $source_attrs, \WP_Block $block_instance, string $attribute_name ) {
5353
if ( ! isset( $source_attrs['key'] ) || ! is_string( $source_attrs['key'] ) ) {
54-
$value = null;
54+
$value = '';
5555
} else {
56-
$value = get_field( $source_attrs['key'] );
56+
$field = get_field_object( $source_attrs['key'], false, true, true, true );
57+
58+
if ( ! $field ) {
59+
return '';
60+
}
61+
62+
if ( ! acf_field_type_supports( $field['type'], 'bindings', true ) ) {
63+
if ( is_preview() ) {
64+
return apply_filters( 'acf/bindings/field_not_supported_message', '[' . esc_html__( 'The requested ACF field type does not support output in Block Bindings or the ACF shortcode.', 'acf' ) . ']' );
65+
} else {
66+
return '';
67+
}
68+
}
69+
70+
if ( isset( $field['allow_in_bindings'] ) && ! $field['allow_in_bindings'] ) {
71+
if ( is_preview() ) {
72+
return apply_filters( 'acf/bindings/field_not_allowed_message', '[' . esc_html__( 'The requested ACF field is not allowed to be output in bindings or the ACF Shortcode.', 'acf' ) . ']' );
73+
} else {
74+
return '';
75+
}
76+
}
77+
78+
$value = $field['value'];
5779

5880
if ( is_array( $value ) ) {
5981
$value = implode( ', ', $value );

includes/admin/views/escaped-html-notice.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030
$acf_error_msg = sprintf(
31-
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. %3$s - Link to show more details about the error */
31+
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. */
3232
__( '%1$s ACF now automatically escapes unsafe HTML when rendered by <code>the_field</code> or the ACF shortcode. We\'ve detected the output of some of your fields has been modified by this change, but this may not be a breaking change. %2$s.', 'acf' ),
3333
$acf_plugin_name,
3434
$acf_learn_how_to_fix

includes/api/api-template.php

+19-3
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ function acf_shortcode( $atts ) {
10081008
// Return if the ACF shortcode is disabled.
10091009
if ( ! acf_get_setting( 'enable_shortcode' ) ) {
10101010
if ( is_preview() ) {
1011-
return apply_filters( 'acf/shortcode/disabled_message', __( '[The ACF shortcode is disabled on this site]', 'acf' ) );
1011+
return apply_filters( 'acf/shortcode/disabled_message', esc_html__( '[The ACF shortcode is disabled on this site]', 'acf' ) );
10121012
} else {
10131013
return;
10141014
}
@@ -1024,7 +1024,7 @@ function acf_shortcode( $atts ) {
10241024
// Limit previews of ACF shortcode data for users without publish_posts permissions.
10251025
$preview_capability = apply_filters( 'acf/shortcode/preview_capability', 'publish_posts' );
10261026
if ( is_preview() && ! current_user_can( $preview_capability ) ) {
1027-
return apply_filters( 'acf/shortcode/preview_capability_message', __( '[ACF shortcode value disabled for preview]', 'acf' ) );
1027+
return apply_filters( 'acf/shortcode/preview_capability_message', esc_html__( '[ACF shortcode value disabled for preview]', 'acf' ) );
10281028
}
10291029

10301030
// Mitigate issue where some AJAX requests can return ACF field data.
@@ -1051,7 +1051,7 @@ function acf_shortcode( $atts ) {
10511051
if ( $decoded_post_id['type'] === 'post' ) {
10521052
if ( $atts['post_id'] !== false && ( (int) $atts['post_id'] !== (int) acf_get_valid_post_id() ) && ( ! is_post_publicly_viewable( $decoded_post_id['id'] ) ) && apply_filters( 'acf/shortcode/prevent_access_to_fields_on_non_public_posts', true ) ) {
10531053
if ( is_preview() ) {
1054-
return apply_filters( 'acf/shortcode/post_not_public_message', __( '[The ACF shortcode cannot display fields from non-public posts]', 'acf' ) );
1054+
return apply_filters( 'acf/shortcode/post_not_public_message', esc_html__( '[The ACF shortcode cannot display fields from non-public posts]', 'acf' ) );
10551055
} else {
10561056
return;
10571057
}
@@ -1072,6 +1072,22 @@ function acf_shortcode( $atts ) {
10721072

10731073
$field_type = is_array( $field ) && isset( $field['type'] ) ? $field['type'] : 'text';
10741074

1075+
if ( ! acf_field_type_supports( $field_type, 'bindings', true ) ) {
1076+
if ( is_preview() ) {
1077+
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.', 'acf' ) . ']' );
1078+
} else {
1079+
return;
1080+
}
1081+
}
1082+
1083+
if ( isset( $field['allow_in_bindings'] ) && ! $field['allow_in_bindings'] ) {
1084+
if ( is_preview() ) {
1085+
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.', 'acf' ) . ']' );
1086+
} else {
1087+
return;
1088+
}
1089+
}
1090+
10751091
if ( apply_filters( 'acf/shortcode/prevent_access', false, $atts, $decoded_post_id['id'], $decoded_post_id['type'], $field_type, $field ) ) {
10761092
return;
10771093
}

includes/fields/class-acf-field-accordion.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ function initialize() {
2626
$this->description = __( 'Allows you to group and organize custom fields into collapsable panels that are shown while editing content. Useful for keeping large datasets tidy.', 'acf' );
2727
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-accordion.png';
2828
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/accordion/', 'docs', 'field-type-selection' );
29-
$this->supports = array( 'required' => false );
29+
$this->supports = array(
30+
'required' => false,
31+
'bindings' => false,
32+
);
3033
$this->defaults = array(
3134
'open' => 0,
3235
'multi_expand' => 0,

includes/fields/class-acf-field-group.php

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function initialize() {
2424
$this->description = __( 'Provides a way to structure fields into groups to better organize the data and the edit screen.', 'acf' );
2525
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-group.png';
2626
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/group/', 'docs', 'field-type-selection' );
27+
$this->supports = array(
28+
'bindings' => false,
29+
);
2730
$this->defaults = array(
2831
'sub_fields' => array(),
2932
'layout' => 'block',

includes/fields/class-acf-field-message.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ function initialize() {
2424
$this->category = 'layout';
2525
$this->description = __( 'Used to display a message to editors alongside other fields. Useful for providing additional context or instructions around your fields.', 'acf' );
2626
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-message.png';
27-
$this->supports = array( 'required' => false );
27+
$this->supports = array(
28+
'required' => false,
29+
'bindings' => false,
30+
);
2831
$this->defaults = array(
2932
'message' => '',
3033
'esc_html' => 0,

includes/fields/class-acf-field-select.php

+20-28
Original file line numberDiff line numberDiff line change
@@ -42,67 +42,59 @@ function initialize() {
4242

4343

4444
/**
45-
* description
45+
* Enqueues admin scripts for the Select field.
4646
*
47-
* @type function
48-
* @date 16/12/2015
49-
* @since 5.3.2
47+
* @since 5.3.2
5048
*
51-
* @param $post_id (int)
52-
* @return $post_id (int)
49+
* @return void
5350
*/
54-
function input_admin_enqueue_scripts() {
55-
56-
// bail early if no enqueue
51+
public function input_admin_enqueue_scripts() {
52+
// Bail early if not enqueuing select2.
5753
if ( ! acf_get_setting( 'enqueue_select2' ) ) {
5854
return;
5955
}
6056

61-
// globals
62-
global $wp_scripts, $wp_styles;
57+
global $wp_scripts;
6358

64-
// vars
65-
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
66-
$major = acf_get_setting( 'select2_version' );
67-
$version = '';
68-
$script = '';
69-
$style = '';
59+
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
60+
$major = acf_get_setting( 'select2_version' );
7061

7162
// attempt to find 3rd party Select2 version
72-
// - avoid including v3 CSS when v4 JS is already enququed
63+
// - avoid including v3 CSS when v4 JS is already enqueued.
7364
if ( isset( $wp_scripts->registered['select2'] ) ) {
7465
$major = (int) $wp_scripts->registered['select2']->ver;
7566
}
7667

77-
// v4
78-
if ( $major == 4 ) {
79-
$version = '4.0.13';
80-
$script = acf_get_url( "assets/inc/select2/4/select2.full{$min}.js" );
81-
$style = acf_get_url( "assets/inc/select2/4/select2{$min}.css" );
82-
83-
// v3
84-
} else {
68+
if ( $major === 3 ) {
69+
// Use v3 if necessary.
8570
$version = '3.5.2';
8671
$script = acf_get_url( "assets/inc/select2/3/select2{$min}.js" );
8772
$style = acf_get_url( 'assets/inc/select2/3/select2.css' );
73+
} else {
74+
// Default to v4.
75+
$version = '4.0.13';
76+
$script = acf_get_url( "assets/inc/select2/4/select2.full{$min}.js" );
77+
$style = acf_get_url( "assets/inc/select2/4/select2{$min}.css" );
8878
}
8979

90-
// enqueue
9180
wp_enqueue_script( 'select2', $script, array( 'jquery' ), $version );
9281
wp_enqueue_style( 'select2', $style, '', $version );
9382

94-
// localize
9583
acf_localize_data(
9684
array(
9785
'select2L10n' => array(
9886
'matches_1' => _x( 'One result is available, press enter to select it.', 'Select2 JS matches_1', 'acf' ),
87+
/* translators: %d - number of results available in select field */
9988
'matches_n' => _x( '%d results are available, use up and down arrow keys to navigate.', 'Select2 JS matches_n', 'acf' ),
10089
'matches_0' => _x( 'No matches found', 'Select2 JS matches_0', 'acf' ),
10190
'input_too_short_1' => _x( 'Please enter 1 or more characters', 'Select2 JS input_too_short_1', 'acf' ),
91+
/* translators: %d - number of characters to enter into select field input */
10292
'input_too_short_n' => _x( 'Please enter %d or more characters', 'Select2 JS input_too_short_n', 'acf' ),
10393
'input_too_long_1' => _x( 'Please delete 1 character', 'Select2 JS input_too_long_1', 'acf' ),
94+
/* translators: %d - number of characters that should be removed from select field */
10495
'input_too_long_n' => _x( 'Please delete %d characters', 'Select2 JS input_too_long_n', 'acf' ),
10596
'selection_too_long_1' => _x( 'You can only select 1 item', 'Select2 JS selection_too_long_1', 'acf' ),
97+
/* translators: %d - maximum number of items that can be selected in the select field */
10698
'selection_too_long_n' => _x( 'You can only select %d items', 'Select2 JS selection_too_long_n', 'acf' ),
10799
'load_more' => _x( 'Loading more results&hellip;', 'Select2 JS load_more', 'acf' ),
108100
'searching' => _x( 'Searching&hellip;', 'Select2 JS searching', 'acf' ),

includes/fields/class-acf-field-tab.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ function initialize() {
2525
$this->description = __( 'Allows you to group fields into tabbed sections in the edit screen. Useful for keeping fields organized and structured.', 'acf' );
2626
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-tabs.png';
2727
$this->doc_url = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/tab/', 'docs', 'field-type-selection' );
28-
$this->supports = array( 'required' => false );
28+
$this->supports = array(
29+
'required' => false,
30+
'bindings' => false,
31+
);
2932
$this->defaults = array(
3033
'placement' => 'top',
3134
'endpoint' => 0, // added in 5.2.8

0 commit comments

Comments
 (0)