Skip to content

Commit 7f8261c

Browse files
committed
Update all PHP files and acf min
1 parent 8f752d1 commit 7f8261c

31 files changed

+1043
-447
lines changed

assets/src/js/_acf-notice.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
this.type( this.get( 'type' ) );
3737

3838
// text
39-
this.html( '<p>' + this.get( 'text' ) + '</p>' );
39+
this.html( '<p>' + acf.strEscape( this.get( 'text' ) ) + '</p>' );
4040

4141
// close
4242
if ( this.get( 'dismiss' ) ) {
43-
this.$el.append( '<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>' );
43+
this.$el.append(
44+
'<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>'
45+
);
4446
this.$el.addClass( '-dismiss' );
4547
}
4648

@@ -144,14 +146,29 @@
144146
$( this ).remove();
145147
} else {
146148
$( this ).show();
147-
$( this ).on( 'click', '.notice-dismiss', function ( e ) {
148-
dismissed = acf.getPreference( 'dismissed-notices' );
149-
if ( ! dismissed || typeof dismissed != 'object' ) {
150-
dismissed = [];
149+
$( this ).on(
150+
'click',
151+
'.notice-dismiss',
152+
function ( e ) {
153+
dismissed =
154+
acf.getPreference( 'dismissed-notices' );
155+
if (
156+
! dismissed ||
157+
typeof dismissed != 'object'
158+
) {
159+
dismissed = [];
160+
}
161+
dismissed.push(
162+
$( this )
163+
.closest( '.acf-admin-notice' )
164+
.data( 'persist-id' )
165+
);
166+
acf.setPreference(
167+
'dismissed-notices',
168+
dismissed
169+
);
151170
}
152-
dismissed.push( $( this ).closest( '.acf-admin-notice' ).data( 'persist-id' ) );
153-
acf.setPreference( 'dismissed-notices', dismissed );
154-
} );
171+
);
155172
}
156173
}
157174
} );

assets/src/js/_acf-tooltip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282

283283
showTitle: function ( e, $el ) {
284284
// vars
285-
var title = $el.attr( 'title' );
285+
let title = $el.attr( 'title' );
286286

287287
// bail early if no title
288288
if ( ! title ) {
@@ -293,6 +293,7 @@
293293
$el.attr( 'title', '' );
294294

295295
$el.data( 'acf-js-tooltip-title', title );
296+
title = acf.strEscape( title );
296297

297298
// create
298299
if ( ! this.tooltip ) {

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"psr-4": {
3131
"ACF\\Blocks\\": "includes/Blocks/",
3232
"SCF\\Forms\\": "includes/forms/",
33-
"SCF\\Meta\\": "includes/Meta/"
33+
"SCF\\Meta\\": "includes/Meta/",
34+
"SCF\\Fields\\FlexibleContent\\": "includes/fields/FlexibleContent/"
3435
}
3536
},
3637
"config": {

includes/admin/admin-tools.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
}
55

66
if ( ! class_exists( 'acf_admin_tools' ) ) :
7-
#[AllowDynamicProperties]
87
/**
98
* Class AdminTools
109
*

includes/admin/post-types/admin-field-group.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public function admin_enqueue_scripts() {
8888
'Move field group to trash?' => esc_html__( 'Move field group to trash?', 'secure-custom-fields' ),
8989
'No toggle fields available' => esc_html__( 'No toggle fields available', 'secure-custom-fields' ),
9090
'Move Custom Field' => esc_html__( 'Move Custom Field', 'secure-custom-fields' ),
91-
'Close modal' => esc_html__( 'Close modal', 'secure-custom-fields' ),
9291
'Field moved to other group' => esc_html__( 'Field moved to other group', 'secure-custom-fields' ),
9392
'Field groups linked successfully.' => esc_html__( 'Field groups linked successfully.', 'secure-custom-fields' ),
9493
'Checked' => esc_html__( 'Checked', 'secure-custom-fields' ),

includes/admin/post-types/admin-field-groups.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
}
66

77
if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
8-
#[AllowDynamicProperties]
98
class ACF_Admin_Field_Groups extends ACF_Admin_Internal_Post_Type_List {
109

1110

@@ -81,7 +80,6 @@ public function admin_table_columns( $_columns ) {
8180
// Set the "no found" label to be our custom HTML for no results.
8281
if ( empty( acf_request_arg( 's' ) ) ) {
8382
global $wp_post_types;
84-
$this->not_found_label = $wp_post_types['acf-field-group']->labels->not_found;
8583
$wp_post_types['acf-field-group']->labels->not_found = $this->get_not_found_html();
8684
}
8785

includes/admin/post-types/admin-post-types.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* The ACF Post Types admin controller class
1111
*/
12-
#[AllowDynamicProperties]
1312
class ACF_Admin_Post_Types extends ACF_Admin_Internal_Post_Type_List {
1413

1514

@@ -101,7 +100,6 @@ public function admin_table_columns( $_columns ) {
101100
// Set the "no found" label to be our custom HTML for no results.
102101
if ( empty( acf_request_arg( 's' ) ) ) {
103102
global $wp_post_types;
104-
$this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found;
105103
$wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html();
106104
}
107105

includes/admin/post-types/admin-taxonomies.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/**
1010
* The ACF Post Types admin controller class
1111
*/
12-
#[AllowDynamicProperties]
1312
class ACF_Admin_Taxonomies extends ACF_Admin_Internal_Post_Type_List {
1413

1514

@@ -101,7 +100,6 @@ public function admin_table_columns( $_columns ) {
101100
// Set the "no found" label to be our custom HTML for no results.
102101
if ( empty( acf_request_arg( 's' ) ) ) {
103102
global $wp_post_types;
104-
$this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found;
105103
$wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html();
106104
}
107105

includes/admin/post-types/class-acf-admin-ui-options-pages.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/**
1515
* The ACF Post Types admin controller class
1616
*/
17-
#[AllowDynamicProperties]
1817
class ACF_Admin_UI_Options_Pages extends ACF_Admin_Internal_Post_Type_List {
1918

2019

@@ -113,7 +112,6 @@ public function admin_table_columns( $_columns ) {
113112
// Set the "no found" label to be our custom HTML for no results.
114113
if ( empty( acf_request_arg( 's' ) ) ) {
115114
global $wp_post_types;
116-
$this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found;
117115
$wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html();
118116
}
119117

includes/assets.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -480,59 +480,56 @@ public function enqueue_uploader() {
480480
/**
481481
* Enqueues and localizes scripts.
482482
*
483-
* @date 27/4/20
484483
* @since ACF 5.9.0
485484
*
486485
* @return void
487486
*/
488487
public function enqueue_scripts() {
489-
490488
// Enqueue input scripts.
491-
if ( in_array( 'input', $this->enqueue ) ) {
489+
if ( in_array( 'input', $this->enqueue, true ) ) {
492490
wp_enqueue_script( 'acf-input' );
493491
wp_enqueue_style( 'acf-input' );
494492
}
495493

496494
// Enqueue media scripts.
497-
if ( in_array( 'uploader', $this->enqueue ) ) {
495+
if ( in_array( 'uploader', $this->enqueue, true ) ) {
498496
$this->enqueue_uploader();
499497
}
500498

501499
// Localize text.
502500
acf_localize_text(
503501
array(
504-
505502
// Tooltip
506503
'Are you sure?' => __( 'Are you sure?', 'secure-custom-fields' ),
507504
'Yes' => __( 'Yes', 'secure-custom-fields' ),
508505
'No' => __( 'No', 'secure-custom-fields' ),
509506
'Remove' => __( 'Remove', 'secure-custom-fields' ),
510507
'Cancel' => __( 'Cancel', 'secure-custom-fields' ),
508+
'Close modal' => esc_html__( 'Close modal', 'secure-custom-fields' ),
511509
)
512510
);
513511

514512
// Localize "input" text.
515513
if ( wp_script_is( 'acf-input' ) ) {
516514
acf_localize_text(
517515
array(
518-
519516
// Unload
520-
'The changes you made will be lost if you navigate away from this page' => __( 'The changes you made will be lost if you navigate away from this page', 'secure-custom-fields' ),
517+
'The changes you made will be lost if you navigate away from this page' => esc_html__( 'The changes you made will be lost if you navigate away from this page', 'secure-custom-fields' ),
521518

522519
// Metaboxes
523-
'Toggle panel' => __( 'Toggle panel', 'secure-custom-fields' ),
520+
'Toggle panel' => esc_html__( 'Toggle panel', 'secure-custom-fields' ),
524521
// Validation
525-
'Validation successful' => __( 'Validation successful', 'secure-custom-fields' ),
526-
'Validation failed' => __( 'Validation failed', 'secure-custom-fields' ),
527-
'1 field requires attention' => __( '1 field requires attention', 'secure-custom-fields' ),
522+
'Validation successful' => esc_html__( 'Validation successful', 'secure-custom-fields' ),
523+
'Validation failed' => esc_html__( 'Validation failed', 'secure-custom-fields' ),
524+
'1 field requires attention' => esc_html__( '1 field requires attention', 'secure-custom-fields' ),
528525
/* translators: %d: number of fields */
529-
'%d fields require attention' => __( '%d fields require attention', 'secure-custom-fields' ),
526+
'%d fields require attention' => esc_html__( '%d fields require attention', 'secure-custom-fields' ),
530527

531528
// Block Validation
532-
'An ACF Block on this page requires attention before you can save.' => __( 'An ACF Block on this page requires attention before you can save.', 'secure-custom-fields' ),
529+
'An ACF Block on this page requires attention before you can save.' => esc_html__( 'An ACF Block on this page requires attention before you can save.', 'secure-custom-fields' ),
533530

534531
// Other
535-
'Edit field group' => __( 'Edit field group', 'secure-custom-fields' ),
532+
'Edit field group' => esc_html__( 'Edit field group', 'secure-custom-fields' ),
536533
)
537534
);
538535

@@ -565,6 +562,7 @@ public function enqueue_scripts() {
565562
$text[ $k ] = $v;
566563
}
567564
}
565+
568566
if ( $text ) {
569567
wp_localize_script( 'acf', 'acfL10n', $text );
570568
}

0 commit comments

Comments
 (0)