Skip to content

Commit 368a956

Browse files
committed
Deploying version 6.3.12
1 parent 693e8de commit 368a956

File tree

144 files changed

+28128
-16076
lines changed

Some content is hidden

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

144 files changed

+28128
-16076
lines changed

acf.php

+5-53
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.11
12+
* Version: 6.3.12
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
* Update URI: false
@@ -36,7 +36,7 @@ class ACF {
3636
*
3737
* @var string
3838
*/
39-
public $version = '6.3.11';
39+
public $version = '6.3.12';
4040

4141
/**
4242
* The plugin settings array.
@@ -228,10 +228,10 @@ public function initialize() {
228228
// Include legacy.
229229
acf_include( 'includes/legacy/legacy-locations.php' );
230230

231-
// Include updater.
232-
acf_include( 'includes/Updater/Updater.php' );
231+
// Include updater if included with this build.
232+
acf_include( 'includes/Updater/init.php' );
233233

234-
// Include PRO.
234+
// Include PRO if included with this build.
235235
acf_include( 'pro/acf-pro.php' );
236236

237237
if ( is_admin() && function_exists( 'acf_is_pro' ) && ! acf_is_pro() ) {
@@ -401,18 +401,6 @@ public function init() {
401401
new ACF\Blocks\Bindings();
402402
}
403403

404-
// If we're ACF free, register the updater.
405-
if ( function_exists( 'acf_is_pro' ) && ! acf_is_pro() ) {
406-
acf_register_plugin_update(
407-
array(
408-
'id' => 'acf',
409-
'slug' => acf_get_setting( 'slug' ),
410-
'basename' => acf_get_setting( 'basename' ),
411-
'version' => acf_get_setting( 'version' ),
412-
)
413-
);
414-
}
415-
416404
/**
417405
* Fires after ACF is completely "initialized".
418406
*
@@ -799,42 +787,6 @@ public function acf_plugin_activated() {
799787
}
800788
}
801789

802-
if ( ! class_exists( 'ACF_Updates' ) ) {
803-
/**
804-
* The main function responsible for returning the acf_updates singleton.
805-
* Use this function like you would a global variable, except without needing to declare the global.
806-
*
807-
* Example: <?php $acf_updates = acf_updates(); ?>
808-
*
809-
* @since 5.5.12
810-
*
811-
* @return ACF\Updater The singleton instance of Updater.
812-
*/
813-
function acf_updates() {
814-
global $acf_updates;
815-
if ( ! isset( $acf_updates ) ) {
816-
$acf_updates = new ACF\Updater();
817-
}
818-
return $acf_updates;
819-
}
820-
821-
/**
822-
* Alias of acf_updates()->add_plugin().
823-
*
824-
* @since 5.5.10
825-
*
826-
* @param array $plugin Plugin data array.
827-
*/
828-
function acf_register_plugin_update( $plugin ) {
829-
acf_updates()->add_plugin( $plugin );
830-
}
831-
832-
/**
833-
* Register a dummy ACF_Updates class for back compat.
834-
*/
835-
class ACF_Updates {} //phpcs:ignore -- Back compat.
836-
}
837-
838790
/**
839791
* An ACF specific getter to replace `home_url` in our license checks to ensure we can avoid third party filters.
840792
*

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.

includes/Updater/init.php

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?php
2+
/**
3+
* Initializes ACF updater logic and logic specific to ACF direct downloads.
4+
*
5+
* @package ACF
6+
*/
7+
8+
if ( ! defined( 'ABSPATH' ) ) {
9+
exit;
10+
}
11+
12+
// Include updater.
13+
acf_include( 'includes/Updater/Updater.php' );
14+
15+
if ( ! class_exists( 'ACF_Updates' ) ) {
16+
/**
17+
* The main function responsible for returning the acf_updates singleton.
18+
* Use this function like you would a global variable, except without needing to declare the global.
19+
*
20+
* Example: <?php $acf_updates = acf_updates(); ?>
21+
*
22+
* @since 5.5.12
23+
*
24+
* @return ACF\Updater The singleton instance of Updater.
25+
*/
26+
function acf_updates() {
27+
global $acf_updates;
28+
if ( ! isset( $acf_updates ) ) {
29+
$acf_updates = new ACF\Updater();
30+
}
31+
return $acf_updates;
32+
}
33+
34+
/**
35+
* Alias of acf_updates()->add_plugin().
36+
*
37+
* @since 5.5.10
38+
*
39+
* @param array $plugin Plugin data array.
40+
*/
41+
function acf_register_plugin_update( $plugin ) {
42+
acf_updates()->add_plugin( $plugin );
43+
}
44+
45+
/**
46+
* Register a dummy ACF_Updates class for back compat.
47+
*/
48+
class ACF_Updates {} //phpcs:ignore -- Back compat.
49+
}
50+
51+
/**
52+
* Registers updates for the free version of ACF hosted on connect.
53+
*
54+
* @return void
55+
*/
56+
function acf_register_free_updates() {
57+
// If we're ACF free, register the updater.
58+
if ( function_exists( 'acf_is_pro' ) && ! acf_is_pro() ) {
59+
acf_register_plugin_update(
60+
array(
61+
'id' => 'acf',
62+
'slug' => acf_get_setting( 'slug' ),
63+
'basename' => acf_get_setting( 'basename' ),
64+
'version' => acf_get_setting( 'version' ),
65+
)
66+
);
67+
}
68+
}
69+
add_action( 'acf/init', 'acf_register_free_updates' );
70+
71+
/**
72+
* Filters the "Update Source" param in the ACF site health.
73+
*
74+
* @since 6.3.11.1
75+
*
76+
* @param string $update_source The original update source.
77+
* @return string
78+
*/
79+
function acf_direct_update_source( $update_source ) {
80+
return __( 'ACF Direct', 'acf' );
81+
}
82+
add_filter( 'acf/site_health/update_source', 'acf_direct_update_source' );
83+
84+
/**
85+
* Unsets ACF from reporting back to the WP.org API.
86+
*
87+
* @param array $args An array of HTTP request arguments.
88+
* @param string $url The request URL.
89+
* @return array|mixed
90+
*/
91+
function acf_unset_plugin_from_org_reporting( $args, $url ) {
92+
// Bail if not a plugins request.
93+
if ( empty( $args['body']['plugins'] ) ) {
94+
return $args;
95+
}
96+
97+
// Bail if not a request to the wp.org API.
98+
$parsed_url = wp_parse_url( $url );
99+
if ( empty( $parsed_url['host'] ) || 'api.wordpress.org' !== $parsed_url['host'] ) {
100+
return $args;
101+
}
102+
103+
$plugins = json_decode( $args['body']['plugins'], true );
104+
if ( empty( $plugins ) ) {
105+
return $args;
106+
}
107+
108+
// Remove ACF from reporting.
109+
if ( ! empty( $plugins['plugins'][ ACF_BASENAME ] ) ) {
110+
unset( $plugins['plugins'][ ACF_BASENAME ] );
111+
}
112+
113+
if ( ! empty( $plugins['active'] ) && is_array( $plugins['active'] ) ) {
114+
$is_active = array_search( ACF_BASENAME, $plugins['active'], true );
115+
if ( $is_active !== false ) {
116+
unset( $plugins['active'][ $is_active ] );
117+
$plugins['active'] = array_values( $plugins['active'] );
118+
}
119+
}
120+
121+
// Add the plugins list (minus ACF) back to $args.
122+
$args['body']['plugins'] = wp_json_encode( $plugins );
123+
124+
return $args;
125+
}
126+
add_filter( 'http_request_args', 'acf_unset_plugin_from_org_reporting', 10, 2 );

includes/admin/admin.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,18 @@ public function admin_footer_text( $text ) {
318318
$wp_engine_link = acf_add_url_utm_tags( 'https://wpengine.com/', 'bx_prod_referral', acf_is_pro() ? 'acf_pro_plugin_footer_text' : 'acf_free_plugin_footer_text', false, 'acf_plugin', 'referral' );
319319
$acf_link = acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/', 'footer', 'footer' );
320320

321+
if ( acf_is_pro() ) {
322+
return sprintf(
323+
/* translators: This text is prepended by a link to ACF's website, and appended by a link to WP Engine's website. */
324+
'<a href="%1$s" target="_blank">ACF&#174;</a> and <a href="%1$s" target="_blank">ACF&#174; PRO</a> ' . __( 'are developed and maintained by', 'acf' ) . ' <a href="%2$s" target="_blank">WP Engine</a>.',
325+
$acf_link,
326+
$wp_engine_link
327+
);
328+
}
329+
321330
return sprintf(
322331
/* translators: This text is prepended by a link to ACF's website, and appended by a link to WP Engine's website. */
323-
'<a href="%1$s" target="_blank">' . ( acf_is_pro() ? 'ACF PRO' : 'ACF' ) . '</a> ' . __( 'is developed and maintained by', 'acf' ) . ' <a href="%2$s" target="_blank">WP Engine</a>.',
332+
'<a href="%1$s" target="_blank">ACF&#174;</a> ' . __( 'is developed and maintained by', 'acf' ) . ' <a href="%2$s" target="_blank">WP Engine</a>.',
324333
$acf_link,
325334
$wp_engine_link
326335
);

includes/assets.php

+1
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ public function print_footer_scripts() {
476476
'editor' => acf_is_block_editor() ? 'block' : 'classic',
477477
'is_pro' => acf_is_pro(),
478478
'debug' => acf_is_beta() || ( defined( 'ACF_DEVELOPMENT_MODE' ) && ACF_DEVELOPMENT_MODE ),
479+
'StrictMode' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && version_compare( $wp_version, '6.6', '>=' ),
479480
);
480481

481482
acf_localize_data( $data_to_localize );

includes/class-acf-site-health.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function get_site_health_values(): array {
289289

290290
$fields['update_source'] = array(
291291
'label' => __( 'Update Source', 'acf' ),
292-
'value' => __( 'ACF Direct', 'acf' ),
292+
'value' => apply_filters( 'acf/site_health/update_source', __( 'wordpress.org', 'acf' ) ),
293293
);
294294

295295
if ( $is_pro ) {

includes/upgrades.php

-44
Original file line numberDiff line numberDiff line change
@@ -537,47 +537,3 @@ function acf_upgrade_550_taxonomy( $taxonomy ) {
537537
// action for 3rd party
538538
do_action( 'acf/upgrade_550_taxonomy', $taxonomy );
539539
}
540-
541-
/**
542-
* Unsets ACF from reporting back to the WP.org API.
543-
*
544-
* @param array $args An array of HTTP request arguments.
545-
* @param string $url The request URL.
546-
* @return array|mixed
547-
*/
548-
function acf_unset_plugin_from_org_reporting( $args, $url ) {
549-
// Bail if not a plugins request.
550-
if ( empty( $args['body']['plugins'] ) ) {
551-
return $args;
552-
}
553-
554-
// Bail if not a request to the wp.org API.
555-
$parsed_url = wp_parse_url( $url );
556-
if ( empty( $parsed_url['host'] ) || 'api.wordpress.org' !== $parsed_url['host'] ) {
557-
return $args;
558-
}
559-
560-
$plugins = json_decode( $args['body']['plugins'], true );
561-
if ( empty( $plugins ) ) {
562-
return $args;
563-
}
564-
565-
// Remove ACF from reporting.
566-
if ( ! empty( $plugins['plugins'][ ACF_BASENAME ] ) ) {
567-
unset( $plugins['plugins'][ ACF_BASENAME ] );
568-
}
569-
570-
if ( ! empty( $plugins['active'] ) && is_array( $plugins['active'] ) ) {
571-
$is_active = array_search( ACF_BASENAME, $plugins['active'], true );
572-
if ( $is_active !== false ) {
573-
unset( $plugins['active'][ $is_active ] );
574-
$plugins['active'] = array_values( $plugins['active'] );
575-
}
576-
}
577-
578-
// Add the plugins list (minus ACF) back to $args.
579-
$args['body']['plugins'] = wp_json_encode( $plugins );
580-
581-
return $args;
582-
}
583-
add_filter( 'http_request_args', 'acf_unset_plugin_from_org_reporting', 10, 2 );

includes/validation.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,23 @@ function reset_errors() {
127127
*/
128128
public function ajax_validate_save_post() {
129129
if ( ! acf_verify_ajax() ) {
130+
if ( empty( $_REQUEST['nonce'] ) ) {
131+
$nonce_error = __( 'ACF was unable to perform validation because no nonce was received by the server.', 'acf' );
132+
} else {
133+
$nonce_error = __( 'ACF was unable to perform validation because the provided nonce failed verification.', 'acf' );
134+
}
135+
130136
wp_send_json_success(
131137
array(
132138
'valid' => 0,
133139
'errors' => array(
134140
array(
135141
'input' => false,
136-
'message' => __( 'ACF was unable to perform validation due to an invalid security nonce being provided.', 'acf' ),
142+
'message' => $nonce_error,
143+
'action' => array(
144+
'label' => __( 'Learn more', 'acf' ),
145+
'url' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/validation-nonce-errors/', 'docs', 'validation-nonce' ),
146+
),
137147
),
138148
),
139149
)

0 commit comments

Comments
 (0)