Skip to content

Commit d2bbe33

Browse files
committed
Deploying version 6.2.6
1 parent 56687f0 commit d2bbe33

File tree

125 files changed

+8806
-6795
lines changed

Some content is hidden

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

125 files changed

+8806
-6795
lines changed

acf.php

Lines changed: 24 additions & 12 deletions
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.2.5
12+
* Version: 6.2.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.2.5';
38+
public $version = '6.2.6';
3939

4040
/**
4141
* The plugin settings array.
@@ -89,6 +89,9 @@ public function initialize() {
8989
$this->define( 'ACF_FIELD_API_VERSION', 5 );
9090
$this->define( 'ACF_UPGRADE_VERSION', '5.5.0' ); // Highest version with an upgrade routine. See upgrades.php.
9191

92+
// Register activation hook.
93+
register_activation_hook( __FILE__, array( $this, 'acf_plugin_activated' ) );
94+
9295
// Define settings.
9396
$this->settings = array(
9497
'name' => __( 'Advanced Custom Fields', 'acf' ),
@@ -214,12 +217,6 @@ public function initialize() {
214217
acf_include( 'includes/admin/admin-upgrade.php' );
215218
}
216219

217-
// Include polyfill for < PHP7 unserialize.
218-
if ( PHP_VERSION_ID < 70000 ) {
219-
acf_include( 'vendor/polyfill-unserialize/src/Unserialize.php' );
220-
acf_include( 'vendor/polyfill-unserialize/src/DisallowedClassesSubstitutor.php' );
221-
}
222-
223220
// Include legacy.
224221
acf_include( 'includes/legacy/legacy-locations.php' );
225222

@@ -616,7 +613,7 @@ public function posts_where( $where, $wp_query ) {
616613
* @date 3/5/17
617614
* @since 5.5.13
618615
*
619-
* @param string $name The constant name.
616+
* @param string $name The constant name.
620617
* @param mixed $value The constant value.
621618
* @return void
622619
*/
@@ -658,7 +655,7 @@ public function get_setting( $name ) {
658655
* @date 28/09/13
659656
* @since 5.0.0
660657
*
661-
* @param string $name The setting name.
658+
* @param string $name The setting name.
662659
* @param mixed $value The setting value.
663660
* @return true
664661
*/
@@ -686,7 +683,7 @@ public function get_data( $name ) {
686683
* @date 28/09/13
687684
* @since 5.0.0
688685
*
689-
* @param string $name The data name.
686+
* @param string $name The data name.
690687
* @param mixed $value The data value.
691688
* @return void
692689
*/
@@ -731,7 +728,7 @@ public function new_instance( $class ) {
731728
* @since 5.9.0
732729
*
733730
* @param string $key Key name.
734-
* @return bool
731+
* @return boolean
735732
*/
736733
public function __isset( $key ) {
737734
return in_array( $key, array( 'locations', 'json' ), true );
@@ -755,6 +752,21 @@ public function __get( $key ) {
755752
}
756753
return null;
757754
}
755+
756+
/**
757+
* Plugin Activation Hook
758+
*
759+
* @since 6.2.6
760+
*/
761+
public function acf_plugin_activated() {
762+
// Set the first activated version of ACF.
763+
if ( null === get_option( 'acf_first_activated_version', null ) ) {
764+
// If acf_version is set, this isn't the first activated version, so leave it unset so it's legacy.
765+
if ( null === get_option( 'acf_version', null ) ) {
766+
update_option( 'acf_first_activated_version', ACF_VERSION, true );
767+
}
768+
}
769+
}
758770
}
759771

760772
/**

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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/css/acf-global.css

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/js/acf-input.js

Lines changed: 22 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/acf-helper-functions.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,7 @@ function acf_sanitize_files_value_array( $array, $sanitize_function ) {
659659
*/
660660
function acf_maybe_unserialize( $data ) {
661661
if ( is_serialized( $data ) ) { // Don't attempt to unserialize data that wasn't serialized going in.
662-
if ( PHP_VERSION_ID >= 70000 ) {
663-
return @unserialize( trim( $data ), array( 'allowed_classes' => false ) ); //phpcs:ignore -- code only runs on PHP7+
664-
} else {
665-
return @\ACF\Brumann\Polyfill\unserialize::unserialize( trim( $data ), array( 'allowed_classes' => false ) );
666-
}
662+
return @unserialize( trim( $data ), array( 'allowed_classes' => false ) ); //phpcs:ignore -- allowed classes is false.
667663
}
668664

669665
return $data;

includes/acf-value-functions.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,15 @@ function acf_get_value( $post_id, $field ) {
130130
acf_add_filter_variations( 'acf/load_value', array( 'type', 'name', 'key' ), 2 );
131131

132132
/**
133-
* acf_format_value
134-
*
135133
* Returns a formatted version of the provided value.
136134
*
137135
* @since 5.0.0
138136
*
139-
* @param mixed $value The field value.
140-
* @param integer|string $post_id The post id.
141-
* @param array $field The field array.
137+
* @param mixed $value The field value.
138+
* @param integer|string $post_id The post id.
139+
* @param array $field The field array.
142140
* @param boolean $escape_html Ask the field for a HTML safe version of it's output.
141+
*
143142
* @return mixed
144143
*/
145144
function acf_format_value( $value, $post_id, $field, $escape_html = false ) {
@@ -169,7 +168,6 @@ function acf_format_value( $value, $post_id, $field, $escape_html = false ) {
169168
* @param string $post_id The post ID for this value.
170169
* @param array $field The field array.
171170
* @param boolean $escape_html Ask the field for a HTML safe version of it's output.
172-
* This parameter will not guarantee the result is escaped, only if the field type supports it.
173171
*/
174172
$value = apply_filters( 'acf/format_value', $value, $post_id, $field, $escape_html );
175173

includes/admin/admin-internal-post-type-list.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public function admin_menu() {}
9292
* @return string
9393
*/
9494
public function get_admin_url( $params = '' ) {
95+
if ( isset( $_GET['paged'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- used as intval to return a page.
96+
$params .= '&paged=' . intval( $_GET['paged'] ); //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- used as intval to return a page.
97+
}
9598
return admin_url( "edit.php?post_type={$this->post_type}{$params}" );
9699
}
97100

includes/admin/admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function admin_enqueue_scripts() {
6363
'acf_escaped_html_notice',
6464
array(
6565
'nonce' => wp_create_nonce( 'acf/dismiss_escaped_html_notice' ),
66-
'show_details' => __( 'Show details', 'acf' ),
67-
'hide_details' => __( 'Hide details', 'acf' ),
66+
'show_details' => __( 'Show&nbsp;details', 'acf' ),
67+
'hide_details' => __( 'Hide&nbsp;details', 'acf' ),
6868
)
6969
);
7070
}

includes/admin/views/acf-field-group/field.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
$div_attrs['class'] .= ' acf-field-is-endpoint';
2222
}
2323

24+
2425
// Misc template vars.
25-
$field_label = acf_get_field_label( $field, 'admin' );
26-
$field_type_label = acf_get_field_type_label( $field['type'] );
26+
$field_label = acf_get_field_label( $field, 'admin' );
27+
$field_type_label = acf_get_field_type_label( $field['type'] );
28+
$field_type_supports = acf_get_field_type_prop( $field['type'], 'supports' );
2729

2830
if ( acf_is_pro() && acf_get_field_type_prop( $field['type'], 'pro' ) && ! acf_pro_is_license_active() ) {
2931
$field_type_label .= '<span class="acf-pro-label acf-pro-label-field-type">PRO</span>';
@@ -189,20 +191,6 @@
189191
<?php
190192
break;
191193
case 'validation':
192-
// required
193-
acf_render_field_setting(
194-
$field,
195-
array(
196-
'label' => __( 'Required', 'acf' ),
197-
'instructions' => '',
198-
'type' => 'true_false',
199-
'name' => 'required',
200-
'ui' => 1,
201-
'class' => 'field-required',
202-
),
203-
true
204-
);
205-
206194
do_action( "acf/field_group/render_field_settings_tab/{$tab_key}", $field );
207195
?>
208196
<div class="acf-field-type-settings" data-parent-tab="<?php echo esc_attr( $tab_key ); ?>">

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
$acf_plugin_name = acf_is_pro() ? 'ACF PRO' : 'ACF';
44
$acf_plugin_name = '<strong>' . $acf_plugin_name . ' &mdash;</strong>';
5-
$acf_learn_how_to_fix = '<a href="' . acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/escaping-the-field/', 'docs', '6-2-5-security-changes' ) . '" target="_blank">' . __( 'Learn how to fix', 'acf' ) . '</a>';
5+
$acf_learn_how_to_fix = '<a href="' . acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/escaping-the-field/', 'docs', '6-2-5-security-changes' ) . '" target="_blank">' . __( 'Learn&nbsp;more', 'acf' ) . '</a>';
66
$acf_class = '';
77
$acf_user_can_acf = false;
88

99
if ( current_user_can( acf_get_setting( 'capability' ) ) ) {
1010
$acf_user_can_acf = true;
11-
$acf_show_details = ' <a class="acf-show-more-details" href="#">' . __( 'Show details', 'acf' ) . '</a>';
11+
$acf_show_details = ' <a class="acf-show-more-details" href="#">' . __( 'Show&nbsp;details', 'acf' ) . '</a>';
1212
$acf_class = ' is-dismissible';
1313
} else {
14-
$acf_show_details = __( 'Please contact your site admin for more details.', 'acf' );
14+
$acf_show_details = __( 'Please contact your site administrator or developer for more details.', 'acf' );
1515
}
1616

1717
if ( ! empty( $acf_will_escape ) ) {
1818
$acf_escaped = $acf_will_escape;
1919
$acf_class .= ' notice-warning acf-will-escape';
2020
$acf_error_msg = sprintf(
2121
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. %3$s - Link to show more details about the error */
22-
__( '%1$s ACF will soon escape unsafe HTML that is rendered by <code>the_field()</code>. We\'ve detected the output of some of your fields will be modified by this change. %2$s. %3$s', 'acf' ),
22+
__( '%1$s ACF will soon escape unsafe HTML that is rendered by <code>the_field()</code>. We\'ve detected the output of some of your fields will be modified by this change, but this may not be a breaking change. %2$s. %3$s.', 'acf' ),
2323
$acf_plugin_name,
2424
$acf_learn_how_to_fix,
2525
$acf_show_details
@@ -30,15 +30,15 @@
3030
if ( apply_filters( 'acf/the_field/escape_html_optin', false ) ) {
3131
$acf_error_msg = sprintf(
3232
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. %3$s - Link to show more details about the error */
33-
__( '%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 will be modified by this change. %2$s. %3$s', 'acf' ),
33+
__( '%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. %3$s.', 'acf' ),
3434
$acf_plugin_name,
3535
$acf_learn_how_to_fix,
3636
$acf_show_details
3737
);
3838
} else {
3939
$acf_error_msg = sprintf(
4040
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. %3$s - Link to show more details about the error */
41-
__( '%1$s ACF now automatically escapes unsafe HTML when rendered by the ACF shortcode. We\'ve detected the output of some of your fields will be modified by this change. %2$s. %3$s', 'acf' ),
41+
__( '%1$s ACF now automatically escapes unsafe HTML when rendered by 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. %3$s.', 'acf' ),
4242
$acf_plugin_name,
4343
$acf_learn_how_to_fix,
4444
$acf_show_details

includes/api/api-helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3939,7 +3939,7 @@ function acf_is_block_editor() {
39393939
* @return array The WordPress reserved terms list.
39403940
*/
39413941
function acf_get_wp_reserved_terms() {
3942-
return array( 'action', 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in', 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'custom', 'customize_messenger_channel', 'customized', 'cpage', 'day', 'debug', 'embed', 'error', 'exact', 'feed', 'fields', 'hour', 'link_category', 'm', 'minute', 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence', 'showposts', 'static', 'status', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'terms', 'theme', 'title', 'type', 'types', 'w', 'withcomments', 'withoutcomments', 'year' );
3942+
return array( 'action', 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in', 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'custom', 'customize_messenger_channel', 'customized', 'cpage', 'day', 'debug', 'embed', 'error', 'exact', 'feed', 'fields', 'hour', 'link', 'link_category', 'm', 'minute', 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence', 'showposts', 'static', 'status', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'terms', 'theme', 'title', 'type', 'types', 'w', 'withcomments', 'withoutcomments', 'year' );
39433943
}
39443944

39453945
/**

0 commit comments

Comments
 (0)