Skip to content

Commit d86e3ba

Browse files
authored
The Escaped HTML warning notice is disabled by default (#180)
1 parent a4c771c commit d86e3ba

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function __construct() {
4545
add_action( 'current_screen', array( $this, 'current_screen' ) );
4646
add_action( 'save_post_' . $this->post_type, array( $this, 'save_post' ), 10, 2 );
4747
add_action( 'wp_ajax_acf/link_field_groups', array( $this, 'ajax_link_field_groups' ) );
48-
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
4948
add_filter( 'use_block_editor_for_post_type', array( $this, 'use_block_editor_for_post_type' ), 10, 2 );
5049
}
5150

@@ -92,6 +91,7 @@ public function current_screen() {
9291
acf_enqueue_scripts();
9392

9493
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
94+
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
9595
add_action( 'acf/input/admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
9696
add_action( 'acf/input/admin_head', array( $this, 'admin_head' ) );
9797
add_action( 'acf/input/form_data', array( $this, 'form_data' ) );

includes/admin/views/global/navigation.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,18 @@ function acf_print_menu_section( $menu_items, $section = '' ) {
108108
$section_html = '';
109109

110110
foreach ( $menu_items as $menu_item ) {
111-
$class = ! empty( $menu_item['class'] ) ? $menu_item['class'] : $menu_item['text'];
112-
$target = ! empty( $menu_item['target'] ) ? ' target="' . esc_attr( $menu_item['target'] ) . '"' : '';
113-
$li_class = ! empty( $menu_item['li_class'] ) ? esc_attr( $menu_item['li_class'] ) : '';
111+
$class = ! empty( $menu_item['class'] ) ? $menu_item['class'] : $menu_item['text'];
112+
$target = ! empty( $menu_item['target'] ) ? ' target="' . esc_attr( $menu_item['target'] ) . '"' : '';
113+
$aria_label = ! empty( $menu_item['aria-label'] ) ? ' aria-label="' . esc_attr( $menu_item['aria-label'] ) . '"' : '';
114+
$li_class = ! empty( $menu_item['li_class'] ) ? esc_attr( $menu_item['li_class'] ) : '';
114115

115116
$html = sprintf(
116-
'<a class="acf-tab%s %s" href="%s"%s><i class="acf-icon"></i>%s</a>',
117+
'<a class="acf-tab%s %s" href="%s"%s%s><i class="acf-icon"></i>%s</a>',
117118
! empty( $menu_item['is_active'] ) ? ' is-active' : '',
118119
'acf-header-tab-' . esc_attr( acf_slugify( $class ) ),
119120
esc_url( $menu_item['url'] ),
120121
$target,
122+
$aria_label,
121123
acf_esc_html( $menu_item['text'] )
122124
);
123125

@@ -138,7 +140,7 @@ function acf_print_menu_section( $menu_items, $section = '' ) {
138140
<div class="acf-admin-toolbar">
139141
<div class="acf-admin-toolbar-inner">
140142
<div class="acf-nav-wrap">
141-
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group' ) ); ?>" class="acf-logo">
143+
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group' ) ); ?>" class="acf-logo" aria-label="<?php esc_attr_e( 'Edit SCF Field Groups', 'secure-custom-fields' ); ?>">
142144
<img src="<?php echo esc_url( acf_get_url( 'assets/images/scf-logo.svg' ) ); ?>" alt="<?php esc_attr_e( 'Secure Custom Fields logo', 'secure-custom-fields' ); ?>">
143145
</a>
144146

includes/api/api-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function the_field( $selector, $post_id = false, $format_value = true ) {
142142
*/
143143
function _acf_log_escaped_html( $function, $selector, $field, $post_id ) {
144144
// If the notice isn't shown, no use in logging the errors.
145-
if ( apply_filters( 'acf/admin/prevent_escaped_html_notice', false ) ) {
145+
if ( apply_filters( 'acf/admin/prevent_escaped_html_notice', true ) ) {
146146
return;
147147
}
148148

0 commit comments

Comments
 (0)