Updates to 6.4.2

This commit is contained in:
ACF 2025-05-21 10:22:19 +00:00
parent 6d124e29a6
commit 0e92288e89
90 changed files with 16429 additions and 15181 deletions

View File

@ -9,7 +9,7 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.4.1
* Version: 6.4.2
* Author: WP Engine
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
* Update URI: https://www.advancedcustomfields.com/pro
@ -36,7 +36,7 @@ if ( ! class_exists( 'ACF' ) ) {
*
* @var string
*/
public $version = '6.4.1';
public $version = '6.4.2';
/**
* The plugin settings array.

View File

@ -10,10 +10,12 @@ $tool = $active ? ' tool-' . $active : '';
?>
<div id="acf-admin-tools" class="wrap<?php echo esc_attr( $tool ); ?>">
<h1><?php esc_html_e( 'Tools', 'acf' ); ?> <?php
if ( $active ) :
?>
<a class="page-title-action" href="<?php echo esc_url( acf_get_admin_tools_url() ); ?>"><?php esc_html_e( 'Back to all tools', 'acf' ); ?></a><?php endif; ?></h1>
<h1>
<?php esc_html_e( 'Tools', 'acf' ); ?>
<?php if ( $active ) { ?>
<a class="page-title-action" href="<?php echo esc_url( acf_get_admin_tools_url() ); ?>"><?php esc_html_e( 'Back to all tools', 'acf' ); ?></a>
<?php } ?>
</h1>
<div class="acf-meta-box-wrap -<?php echo esc_attr( $class ); ?>">
<?php do_meta_boxes( $screen_id, 'normal', '' ); ?>

View File

@ -344,9 +344,9 @@ if ( ! class_exists( 'acf_field' ) ) :
$binding_url
);
// This field setting has a unique behaviour. If the value isn't defined on the field object, it defaults to true, but for new fields, it defaults to off.
// This field setting has unique behavior. If the value isn't defined on the field object, it defaults to true, but for new fields or when changing field types, it defaults to off.
if ( ! isset( $field['allow_in_bindings'] ) ) {
if ( empty( $field['ID'] ) ) {
if ( empty( $field['ID'] ) || doing_action( 'wp_ajax_acf/field_group/render_field_settings' ) ) {
$field['allow_in_bindings'] = false;
} else {
$field['allow_in_bindings'] = true;

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: ar\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: bg_BG\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: de_CH\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: fr_CA\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: he_IL\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: hr\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: hu_HU\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: id_ID\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2025-05-08T10:20:52+00:00\n"
"PO-Revision-Date: 2025-05-19T16:45:13+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: sk_SK\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -414,6 +414,16 @@ function acf_validate_block_type( $block ) {
$block['supports']['jsx'] = $block['supports']['__experimental_jsx'];
}
// Normalize block 'parent' setting.
if ( array_key_exists( 'parent', $block ) ) {
// As of WP 6.8, parent must be an array.
if ( null === $block['parent'] ) {
unset( $block['parent'] );
} elseif ( is_string( $block['parent'] ) ) {
$block['parent'] = array( $block['parent'] );
}
}
// Return block.
return $block;
}

View File

@ -4,7 +4,7 @@ Tags: acf, fields, custom fields, meta, repeater
Requires at least: 6.0
Tested up to: 6.8.1
Requires PHP: 7.4
Stable tag: 6.4.1
Stable tag: 6.4.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@ -94,6 +94,14 @@ From your WordPress dashboard
== Changelog ==
= 6.4.2 =
*Release Date 20th May 2025*
* New - In ACF PRO, fields can now be added to WooCommerce Subscriptions when using HPOS
* Security - Changing a field type no longer enables the "Allow Access to Value in Editor UI" setting
* Fix - Paginated Repeater fields no longer save duplicate values when saving to a WooCommerce Order with HPOS disabled
* Fix - Blocks registered via acf_register_block_type() with a `parent` value of `null` no longer fail to register
= 6.4.1 =
*Release Date 8th May 2025*

View File

@ -9,7 +9,7 @@
namespace ACF\Pro\Forms;
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
use Automattic\WooCommerce\Utilities\OrderUtil;
/**
* Adds ACF metaboxes to the new WooCommerce order screen.
@ -23,6 +23,7 @@ class WC_Order {
*/
public function __construct() {
add_action( 'load-woocommerce_page_wc-orders', array( $this, 'initialize' ) );
add_action( 'load-woocommerce_page_wc-orders--shop_subscription', array( $this, 'initialize' ) );
add_action( 'woocommerce_update_order', array( $this, 'save_order' ), 10, 1 );
}
@ -52,16 +53,20 @@ class WC_Order {
// Storage for localized postboxes.
$postboxes = array();
$order = ( $post instanceof \WP_Post ) ? wc_get_order( $post->ID ) : $post;
$screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled()
? wc_get_page_screen_id( 'shop-order' )
: 'shop_order';
$location = 'shop_order';
$order = ( $post instanceof \WP_Post ) ? wc_get_order( $post->ID ) : $post;
$screen = $this->is_hpos_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'shop_order';
if ( $order instanceof \WC_Subscription ) {
$location = 'shop_subscription';
$screen = function_exists( 'wcs_get_page_screen_id' ) ? wcs_get_page_screen_id( 'shop_subscription' ) : 'shop_subscription';
}
// Get field groups for this screen.
$field_groups = acf_get_field_groups(
array(
'post_id' => $order->get_id(),
'post_type' => 'shop_order',
'post_type' => $location,
)
);
@ -71,12 +76,7 @@ class WC_Order {
$id = "acf-{$field_group['key']}"; // acf-group_123
$title = $field_group['title']; // Group 1
$context = $field_group['position']; // normal, side, acf_after_title
$priority = 'high'; // high, core, default, low
// Reduce priority for sidebar metaboxes for best position.
if ( $context === 'side' ) {
$priority = 'core';
}
$priority = 'core'; // high, core, default, low
// Allow field groups assigned to after title to still be rendered.
if ( 'acf_after_title' === $context ) {
@ -179,6 +179,21 @@ class WC_Order {
acf_render_fields( $fields, 'woo_order_' . $order->get_id(), 'div', $field_group['instruction_placement'] );
}
/**
* Checks if WooCommerce HPOS is enabled.
*
* @since 6.4.2
*
* @return boolean
*/
public function is_hpos_enabled(): bool {
if ( class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) && OrderUtil::custom_orders_table_usage_is_enabled() ) {
return true;
}
return false;
}
/**
* Saves ACF fields to the current order.
*
@ -188,6 +203,11 @@ class WC_Order {
* @return void
*/
public function save_order( int $order_id ) {
// Bail if not using HPOS to prevent a double-save.
if ( ! $this->is_hpos_enabled() ) {
return;
}
// Remove the action to prevent an infinite loop via $order->save().
remove_action( 'woocommerce_update_order', array( $this, 'save_order' ), 10 );
acf_save_post( 'woo_order_' . $order_id );