plugin install

This commit is contained in:
Tony Volpe
2024-06-18 17:29:05 -04:00
parent e1aaedd1ae
commit 41f50eacc4
5880 changed files with 1057631 additions and 39681 deletions

View File

@@ -453,6 +453,8 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type_List' ) ) :
$duplicate_action_url = wp_nonce_url( admin_url( 'post-new.php?post_type=acf-post-type&use_post_type=' . $post->ID ), 'acfduplicate-' . $post->ID );
} elseif ( 'acf-taxonomy' === $this->post_type ) {
$duplicate_action_url = wp_nonce_url( admin_url( 'post-new.php?post_type=acf-taxonomy&use_taxonomy=' . $post->ID ), 'acfduplicate-' . $post->ID );
} elseif ( 'acf-ui-options-page' === $this->post_type ) {
$duplicate_action_url = wp_nonce_url( admin_url( 'post-new.php?post_type=acf-ui-options-page&use_options_page=' . $post->ID ), 'acfduplicate-' . $post->ID );
}
$actions['acfduplicate'] = '<a href="' . esc_url( $duplicate_action_url ) . '" aria-label="' . esc_attr__( 'Duplicate this item', 'acf' ) . '">' . __( 'Duplicate', 'acf' ) . '</a>';

View File

@@ -28,7 +28,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function __construct() {
// actions
@@ -46,7 +45,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param string $class
* @return n/a
*/
function register_tool( $class ) {
$instance = new $class();
@@ -65,7 +63,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param string $name
* @return n/a
*/
function get_tool( $name ) {
return isset( $this->tools[ $name ] ) ? $this->tools[ $name ] : null;
@@ -83,7 +80,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return array
*/
function get_tools() {
return $this->tools;
@@ -100,7 +96,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function admin_menu() {
// bail early if no show_admin
@@ -127,7 +122,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function load() {
add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );
@@ -169,7 +163,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function include_tools() {
// include
@@ -193,7 +186,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function check_submit() {
// loop
@@ -221,7 +213,6 @@ if ( ! class_exists( 'acf_admin_tools' ) ) :
* @param n/a
* @return n/a
*/
function html() {
// vars

View File

@@ -19,7 +19,8 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );
add_action( 'current_screen', array( $this, 'current_screen' ) );
add_action( 'admin_notices', array( $this, 'maybe_show_escaped_html_notice' ) );
add_action( 'wp_ajax_acf/dismiss_escaped_html_notice', array( $this, 'dismiss_escaped_html_notice' ) );
add_action( 'admin_init', array( $this, 'dismiss_escaped_html_notice' ) );
add_action( 'admin_init', array( $this, 'clear_escaped_html_log' ) );
add_filter( 'parent_file', array( $this, 'ensure_menu_selection' ) );
add_filter( 'submenu_file', array( $this, 'ensure_submenu_selection' ) );
}
@@ -58,7 +59,6 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
'acf-escaped-html-notice',
'acf_escaped_html_notice',
array(
'nonce' => wp_create_nonce( 'acf/dismiss_escaped_html_notice' ),
'show_details' => __( 'Show&nbsp;details', 'acf' ),
'hide_details' => __( 'Hide&nbsp;details', 'acf' ),
)
@@ -220,6 +220,10 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
return;
}
if ( get_option( 'acf_escaped_html_notice_dismissed' ) ) {
return;
}
$escaped = _acf_get_escaped_html_log();
// Notice for when HTML has already been escaped.
@@ -229,18 +233,55 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
}
/**
* Dismisses the escaped unsafe HTML notice by clearing the stored log.
* Dismisses the escaped unsafe HTML notice.
*
* @since 6.2.5
*/
public function dismiss_escaped_html_notice() {
if ( empty( $_GET['acf-dismiss-esc-html-notice'] ) ) {
return;
}
$nonce = sanitize_text_field( wp_unslash( $_GET['acf-dismiss-esc-html-notice'] ) );
if (
! check_admin_referer( 'acf/dismiss_escaped_html_notice', 'nonce' ) ||
! current_user_can( acf_get_setting( 'capability' ) ) ) {
! wp_verify_nonce( $nonce, 'acf/dismiss_escaped_html_notice' ) ||
! current_user_can( acf_get_setting( 'capability' ) )
) {
return;
}
update_option( 'acf_escaped_html_notice_dismissed', true );
_acf_delete_escaped_html_log();
wp_safe_redirect( remove_query_arg( 'acf-dismiss-esc-html-notice' ) );
exit;
}
/**
* Clear the escaped unsafe HTML log.
*
* @since 6.2.5
*/
public function clear_escaped_html_log() {
if ( empty( $_GET['acf-clear-esc-html-log'] ) ) {
return;
}
$nonce = sanitize_text_field( wp_unslash( $_GET['acf-clear-esc-html-log'] ) );
if (
! wp_verify_nonce( $nonce, 'acf/clear_escaped_html_log' ) ||
! current_user_can( acf_get_setting( 'capability' ) )
) {
return;
}
_acf_delete_escaped_html_log();
wp_safe_redirect( remove_query_arg( 'acf-clear-esc-html-log' ) );
exit;
}
/**

View File

@@ -111,6 +111,36 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
'Value is less than' => esc_html__( 'Value is less than', 'acf' ),
'Selection is greater than' => esc_html__( 'Selection is greater than', 'acf' ),
'Selection is less than' => esc_html__( 'Selection is less than', 'acf' ),
'Relationship is equal to' => esc_html__( 'Relationship is equal to', 'acf' ),
'Relationship is not equal to' => esc_html__( 'Relationship is not equal to', 'acf' ),
'Relationships contain' => esc_html__( 'Relationships contain', 'acf' ),
'Relationships do not contain' => esc_html__( 'Relationships do not contain', 'acf' ),
'Post is equal to' => esc_html__( 'Post is equal to', 'acf' ),
'Post is not equal to' => esc_html__( 'Post is not equal to', 'acf' ),
'Posts contain' => esc_html__( 'Posts contain', 'acf' ),
'Posts do not contain' => esc_html__( 'Posts do not contain', 'acf' ),
'Has any post selected' => esc_html__( 'Has any post selected', 'acf' ),
'Has no post selected' => esc_html__( 'Has no post selected', 'acf' ),
'Has any relationship selected' => esc_html__( 'Has any relationship selected', 'acf' ),
'Has no relationship selected' => esc_html__( 'Has no relationship selected', 'acf' ),
'Page is equal to' => esc_html__( 'Page is equal to', 'acf' ),
'Page is not equal to' => esc_html__( 'Page is not equal to', 'acf' ),
'Pages contain' => esc_html__( 'Pages contain', 'acf' ),
'Pages do not contain' => esc_html__( 'Pages do not contain', 'acf' ),
'Has any page selected' => esc_html__( 'Has any page selected', 'acf' ),
'Has no page selected' => esc_html__( 'Has no page selected', 'acf' ),
'User is equal to' => esc_html__( 'User is equal to', 'acf' ),
'User is not equal to' => esc_html__( 'User is not equal to', 'acf' ),
'Users contain' => esc_html__( 'Users contain', 'acf' ),
'Users do not contain' => esc_html__( 'Users do not contain', 'acf' ),
'Has any user selected' => esc_html__( 'Has any user selected', 'acf' ),
'Has no user selected' => esc_html__( 'Has no user selected', 'acf' ),
'Term is equal to' => esc_html__( 'Term is equal to', 'acf' ),
'Term is not equal to' => esc_html__( 'Term is not equal to', 'acf' ),
'Terms contain' => esc_html__( 'Terms contain', 'acf' ),
'Terms do not contain' => esc_html__( 'Terms do not contain', 'acf' ),
'Has any term selected' => esc_html__( 'Has any term selected', 'acf' ),
'Has no term selected' => esc_html__( 'Has no term selected', 'acf' ),
// Custom Select2 templates.
'Type to search...' => esc_html__( 'Type to search...', 'acf' ),
@@ -479,12 +509,14 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
}
/**
* Move field AJAX function
* Moves fields between field groups via AJAX.
*
* @since 5.0.0
*
* @return void
*/
public function ajax_move_field() {
// disable filters to ensure ACF loads raw data from DB.
// Disable filters to ensure ACF loads raw data from DB.
acf_disable_filters();
// phpcs:disable WordPress.Security.NonceVerification.Missing
@@ -499,34 +531,35 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
);
// phpcs:enable WordPress.Security.NonceVerification.Missing
// verify nonce.
// Verify nonce.
if ( ! wp_verify_nonce( $args['nonce'], 'acf_nonce' ) ) {
die();
}
// verify user capability.
// Verify user capability.
if ( ! acf_current_user_can_admin() ) {
die();
}
// confirm?
// Move the field if the user has confirmed.
if ( $args['field_id'] && $args['field_group_id'] ) {
$field = acf_get_field( $args['field_id'] );
$old_field_group = acf_get_field_group( $args['post_id'] );
$new_field_group = acf_get_field_group( $args['field_group_id'] );
// vars.
$field = acf_get_field( $args['field_id'] );
$field_group = acf_get_field_group( $args['field_group_id'] );
// update parent.
$field['parent'] = $field_group['ID'];
// remove conditional logic.
// Update the field parent and remove conditional logic.
$field['parent'] = $new_field_group['ID'];
$field['conditional_logic'] = 0;
// update field.
// Update the field in the database.
acf_update_field( $field );
// Fire `acf/update_field_group` action hook so JSON can sync if necessary.
do_action( 'acf/update_field_group', $old_field_group );
do_action( 'acf/update_field_group', $new_field_group );
// Output HTML.
$link = '<a href="' . admin_url( 'post.php?post=' . $field_group['ID'] . '&action=edit' ) . '" target="_blank">' . esc_html( $field_group['title'] ) . '</a>';
$link = '<a href="' . admin_url( 'post.php?post=' . $new_field_group['ID'] . '&action=edit' ) . '" target="_blank">' . esc_html( $new_field_group['title'] ) . '</a>';
echo '' .
'<p><strong>' . esc_html__( 'Move Complete.', 'acf' ) . '</strong></p>' .
@@ -540,22 +573,18 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
die();
}
// get all field groups.
// Get all field groups.
$field_groups = acf_get_field_groups();
$choices = array();
// check.
if ( ! empty( $field_groups ) ) {
// loop.
foreach ( $field_groups as $field_group ) {
// bail early if no ID.
// Bail early if no ID.
if ( ! $field_group['ID'] ) {
continue;
}
// bail early if is current.
// Bail early if is current.
if ( $field_group['ID'] == $args['post_id'] ) {
continue;
}
@@ -564,7 +593,7 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
}
}
// render options.
// Render options.
$field = acf_get_valid_field(
array(
'type' => 'select',
@@ -575,14 +604,9 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
);
echo '<p>' . esc_html__( 'Please select the destination for this field', 'acf' ) . '</p>';
echo '<form id="acf-move-field-form">';
// render.
acf_render_field_wrap( $field );
echo '<button type="submit" class="acf-btn">' . esc_html__( 'Move Field', 'acf' ) . '</button>';
echo '</form>';
die();

View File

@@ -121,7 +121,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
// Description.
case 'acf-description':
if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
if ( ( is_string( $post['description'] ) || is_numeric( $post['description'] ) ) && ! empty( $post['description'] ) ) {
echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
} else {
echo '<span class="acf-emdash" aria-hidden="true">—</span>';

View File

@@ -140,7 +140,7 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
// Description.
case 'acf-description':
if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
if ( ( is_string( $post['description'] ) || is_numeric( $post['description'] ) ) && ! empty( $post['description'] ) ) {
echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
} else {
echo '<span class="acf-emdash" aria-hidden="true">—</span>';

View File

@@ -139,7 +139,7 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
// Description.
case 'acf-description':
if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
if ( ( is_string( $post['description'] ) || is_numeric( $post['description'] ) ) && ! empty( $post['description'] ) ) {
echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
} else {
echo '<span class="acf-emdash" aria-hidden="true">—</span>';

View File

@@ -19,7 +19,6 @@ if ( ! class_exists( 'ACF_Admin_Tool_Import' ) ) :
* @param n/a
* @return n/a
*/
function initialize() {
// vars
@@ -40,7 +39,6 @@ if ( ! class_exists( 'ACF_Admin_Tool_Import' ) ) :
* @param n/a
* @return n/a
*/
function html() {
?>

View File

@@ -36,7 +36,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function get_name() {
return $this->name;
}
@@ -53,7 +52,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function get_title() {
return $this->title;
}
@@ -70,7 +68,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function get_url() {
return acf_get_admin_tool_url( $this->name );
}
@@ -87,7 +84,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return boolean
*/
function is_active() {
return acf_maybe_get_GET( 'tool' ) === $this->name;
}
@@ -103,7 +99,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function __construct() {
// initialize
@@ -122,7 +117,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function initialize() {
/* do nothing */
@@ -141,7 +135,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function load() {
/* do nothing */
@@ -159,7 +152,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function html() {
}
@@ -175,7 +167,6 @@ if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
* @param n/a
* @return n/a
*/
function submit() {
}
}

View File

@@ -139,8 +139,19 @@ if ( empty( $field['conditional_logic'] ) ) {
</td>
<td class="value">
<?php
$conditional_field = get_field_object( $rule['field'] );
/**
* Filters the choices available for a conditional logic rule.
*
* @since 6.3.0
*
* @param array $choices The available choices.
* @param array $conditional_field The field object for the conditional field.
* @param mixed $value The value of the rule.
*/
$choices = apply_filters( 'acf/conditional_logic/choices', array( $rule['value'] => $rule['value'] ), $conditional_field, $rule['value'] );
// create field
acf_render_field(
array(
'type' => 'select',
@@ -149,12 +160,9 @@ if ( empty( $field['conditional_logic'] ) ) {
'class' => 'condition-rule-value',
'disabled' => $disabled,
'value' => $rule['value'],
'choices' => array(
$rule['value'] => $rule['value'],
),
'choices' => $choices,
)
);
?>
</td>
<td class="add">

View File

@@ -34,7 +34,7 @@ if ( acf_is_pro() && acf_get_field_type_prop( $field['type'], 'pro' ) ) {
}
if ( acf_is_pro() && acf_get_field_type_prop( $field['type'], 'pro' ) && ! acf_pro_is_license_active() ) {
$field_type_label .= '<span class="acf-pro-label acf-pro-label-field-type">PRO</span>';
$field_type_label .= '<span class="acf-pro-label-field-type"><img src="' . esc_url( acf_get_url( 'assets/images/pro-chip.svg' ) ) . '" alt="' . esc_attr__( 'ACF PRO Logo', 'acf' ) . '"></span>';
if ( ! acf_pro_is_license_expired() ) {
$inactive_field_class = ' acf-js-tooltip';
@@ -217,7 +217,7 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic
$field,
array(
'label' => __( 'Instructions', 'acf' ),
'instructions' => __( 'Instructions for authors. Shown when submitting data', 'acf' ),
'instructions' => __( 'Instructions for content editors. Shown when submitting data.', 'acf' ),
'type' => 'textarea',
'name' => 'instructions',
'rows' => 5,

View File

@@ -22,9 +22,9 @@ if ( acf_is_pro() ) {
?>
<div id="tmpl-acf-field-group-pro-features">
<div class="acf-field-group-pro-features-wrapper">
<h1 class="acf-field-group-pro-features-title-sm"><?php echo esc_html( $acf_field_group_pro_features_title ); ?> <div class="acf-pro-label">PRO</div></h1>
<h1 class="acf-field-group-pro-features-title-sm"><?php echo esc_html( $acf_field_group_pro_features_title ); ?> <div class="acf-pro-label"><img src="<?php echo esc_url( acf_get_url( 'assets/images/pro-chip.svg' ) ); ?>" alt="<?php esc_attr_e( 'ACF PRO logo', 'acf' ); ?>"></div></h1>
<div class="acf-field-group-pro-features-content">
<h1 class="acf-field-group-pro-features-title"><?php echo esc_html( $acf_field_group_pro_features_title ); ?> <div class="acf-pro-label">PRO</div></h1>
<h1 class="acf-field-group-pro-features-title"><?php echo esc_html( $acf_field_group_pro_features_title ); ?> <div class="acf-pro-label"><img src="<?php echo esc_url( acf_get_url( 'assets/images/pro-chip.svg' ) ); ?>" alt="<?php esc_attr_e( 'ACF PRO logo', 'acf' ); ?>"></div></h1>
<p class="acf-field-group-pro-features-desc"><?php esc_html_e( 'Speed up your workflow and develop better websites with features like ACF Blocks and Options Pages, and sophisticated field types like Repeater, Flexible Content, Clone, and Gallery.', 'acf' ); ?></p>
<div class="acf-field-group-pro-features-actions">
<a target="<?php echo esc_attr( $acf_learn_more_target ); ?>" href="<?php echo $acf_learn_more_link; ?>" class="acf-btn acf-btn-muted acf-pro-features-learn-more"><?php //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped on generation. ?>

View File

@@ -747,15 +747,6 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
)
);
$acf_dashicon_class_name = __( 'Dashicon class name', 'acf' );
$acf_dashicon_link = '<a href="https://developer.wordpress.org/resource/dashicons/" target="_blank">' . $acf_dashicon_class_name . '</a>';
$acf_menu_icon_instructions = sprintf(
/* translators: %s = "dashicon class name", link to the WordPress dashicon documentation. */
__( 'The icon used for the post type menu item in the admin dashboard. Can be a URL or %s to use for the icon.', 'acf' ),
$acf_dashicon_link
);
acf_render_field_wrap(
array(
'type' => 'text',
@@ -795,20 +786,52 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
'field'
);
// Set the default value for the icon field.
$acf_default_icon_value = array(
'type' => 'dashicons',
'value' => 'dashicons-admin-post',
);
if ( empty( $acf_post_type['menu_icon'] ) ) {
$acf_post_type['menu_icon'] = $acf_default_icon_value;
}
// Backwards compatibility for before the icon picker was introduced.
if ( is_string( $acf_post_type['menu_icon'] ) ) {
// If the old value was a string that starts with dashicons-, assume it's a dashicon.
if ( false !== strpos( $acf_post_type['menu_icon'], 'dashicons-' ) ) {
$acf_post_type['menu_icon'] = array(
'type' => 'dashicons',
'value' => $acf_post_type['menu_icon'],
);
} else {
$acf_post_type['menu_icon'] = array(
'type' => 'url',
'value' => $acf_post_type['menu_icon'],
);
}
}
acf_render_field_wrap(
array(
'type' => 'text',
'name' => 'menu_icon',
'key' => 'menu_icon',
'prefix' => 'acf_post_type',
'value' => $acf_post_type['menu_icon'],
'label' => __( 'Menu Icon', 'acf' ),
'placeholder' => 'dashicons-admin-post',
'instructions' => $acf_menu_icon_instructions,
'conditions' => array(
'field' => 'show_in_menu',
'operator' => '==',
'value' => 1,
'type' => 'icon_picker',
'name' => 'menu_icon',
'key' => 'menu_icon',
'prefix' => 'acf_post_type',
'value' => $acf_post_type['menu_icon'],
'label' => __( 'Menu Icon', 'acf' ),
'placeholder' => 'dashicons-admin-post',
'conditions' => array(
array(
'field' => 'show_in_menu',
'operator' => '==',
'value' => '1',
),
array(
'field' => 'admin_menu_parent',
'operator' => '==',
'value' => '',
),
),
),
'div',

View File

@@ -2,44 +2,67 @@
$acf_plugin_name = acf_is_pro() ? 'ACF PRO' : 'ACF';
$acf_plugin_name = '<strong>' . $acf_plugin_name . ' &mdash;</strong>';
$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 this', 'acf' ) . '</a>';
$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>';
$acf_class = 'notice-error';
$acf_user_can_acf = false;
if ( current_user_can( acf_get_setting( 'capability' ) ) ) {
$acf_user_can_acf = true;
$acf_show_details = ' <a class="acf-show-more-details" href="#">' . __( 'Show&nbsp;details', 'acf' ) . '</a>';
$acf_class .= ' is-dismissible';
$acf_dismiss_url = add_query_arg( array( 'acf-dismiss-esc-html-notice' => wp_create_nonce( 'acf/dismiss_escaped_html_notice' ) ) );
// "Show/Hide Details" is a button for accessibility purposes, because it isn't a link. But since the design shows a link, we need to make it look like a link.
$acf_style_button_as_link = trim(
'display: inline;
padding: 0;
background: none;
border: none;
color: #0073aa;
text-decoration: underline;
cursor: pointer;'
);
$acf_show_details = '<button style="' . esc_attr( $acf_style_button_as_link ) . '" class="acf-show-more-details">' . __( 'Show&nbsp;details', 'acf' ) . '</button>';
$acf_show_details .= ' | <a class="acf-dismiss-permanently-button" href="' . esc_url( $acf_dismiss_url ) . '">' . __( 'Dismiss permanently', 'acf' ) . '</a>';
} else {
$acf_show_details = __( 'Please contact your site administrator or developer for more details.', 'acf' );
}
$acf_error_msg = sprintf(
/* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. %3$s - Link to show more details about the error */
__( '%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' ),
__( '%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.', 'acf' ),
$acf_plugin_name,
$acf_learn_how_to_fix,
$acf_show_details
$acf_learn_how_to_fix
);
?>
<div class="acf-admin-notice notice acf-escaped-html-notice <?php echo esc_attr( $acf_class ); ?>">
<p><?php echo acf_esc_html( $acf_error_msg ); ?></p>
<p style="margin-bottom: 0.5em; padding-bottom: 2px;"><?php echo acf_esc_html( $acf_error_msg ); ?></p>
<p style="margin: 0.5em 0; padding: 2px;"><?php echo acf_esc_html( $acf_show_details ); ?></p>
<?php if ( $acf_user_can_acf && ! empty( $acf_escaped ) ) : ?>
<ul class="acf-error-details" style="display: none; list-style: disc; margin-left: 14px;">
<?php
foreach ( $acf_escaped as $acf_field_key => $acf_data ) {
$acf_error = sprintf(
/* translators: %1$s - The selector used %2$s The field name 3%$s The parent function name */
__( '%1$s (%2$s) - rendered via %3$s', 'acf' ),
$acf_data['selector'],
$acf_data['field'],
$acf_data['function']
);
<div class="acf-error-details" style="display: none; list-style: disc; margin-left: 14px;">
<ul class="acf-error-details" style="display: none; list-style: disc; margin-left: 14px;">
<?php
foreach ( $acf_escaped as $acf_field_key => $acf_data ) {
$acf_error = sprintf(
/* translators: %1$s - The selector used %2$s The field name 3%$s The parent function name */
__( '%1$s (%2$s) - rendered via %3$s', 'acf' ),
$acf_data['selector'],
$acf_data['field'],
$acf_data['function']
);
echo '<li>' . esc_html( $acf_error ) . '</li>';
}
echo '<li>' . esc_html( $acf_error ) . '</li>';
}
?>
</ul>
<p style="margin: 0.5em 0; padding: 2px;">
<?php
$acf_clear_logs_url = add_query_arg( array( 'acf-clear-esc-html-log' => wp_create_nonce( 'acf/clear_escaped_html_log' ) ) );
// translators: %s - The clear log button opening HTML tag. %s - The closing HTML tag.
echo acf_esc_html( '<i>' . sprintf( __( 'This data is logged as we detect values that have been changed during output. %1$sClear log and dismiss%2$s after escaping the values in your code. The notice will reappear if we detect changed values again.', 'acf' ), '<a class="acf-clear-log-button" href="' . esc_url( $acf_clear_logs_url ) . '">', '</a>' ) . '</i>' );
?>
</ul>
</p>
</div>
<?php endif; ?>
</div>

View File

@@ -40,15 +40,18 @@ if ( 'acf-field-group' === $acf_post_type ) {
if ( empty( $acf_title ) && $acf_prefilled_title ) {
$acf_title = $acf_prefilled_title;
}
} elseif ( in_array( $acf_post_type, array( 'acf-post-type', 'acf-taxonomy' ) ) ) {
$acf_duplicate_post_type = acf_get_post_type_from_request_args( 'acfduplicate' );
$acf_duplicate_taxonomy = acf_get_taxonomy_from_request_args( 'acfduplicate' );
$acf_duplicated_from_label = '';
} elseif ( in_array( $acf_post_type, array( 'acf-post-type', 'acf-taxonomy', 'acf-ui-options-page' ), true ) ) {
$acf_duplicate_post_type = acf_get_post_type_from_request_args( 'acfduplicate' );
$acf_duplicate_taxonomy = acf_get_taxonomy_from_request_args( 'acfduplicate' );
$acf_duplicate_ui_options_page = acf_get_ui_options_page_from_request_args( 'acfduplicate' );
$acf_duplicated_from_label = '';
if ( $acf_duplicate_post_type && ! empty( $acf_duplicate_post_type['labels']['singular_name'] ) ) {
$acf_duplicated_from_label = $acf_duplicate_post_type['labels']['singular_name'];
} elseif ( $acf_duplicate_taxonomy && ! empty( $acf_duplicate_taxonomy['labels']['singular_name'] ) ) {
$acf_duplicated_from_label = $acf_duplicate_taxonomy['labels']['singular_name'];
} elseif ( $acf_duplicate_ui_options_page && ! empty( $acf_duplicate_ui_options_page['page_title'] ) ) {
$acf_duplicated_from_label = $acf_duplicate_ui_options_page['page_title'];
}
if ( ! empty( $acf_duplicated_from_label ) ) {

View File

@@ -24,7 +24,7 @@ if ( $page_title ) {
echo esc_html( $page_title );
?>
<?php if ( $acf_is_options_page_preview ) { ?>
<div class="acf-pro-label">PRO</div>
<div class="acf-pro-label"><img src="<?php echo esc_url( acf_get_url( 'assets/images/pro-chip.svg' ) ); ?>" alt="<?php esc_attr_e( 'ACF PRO logo', 'acf' ); ?>"></div>
<?php
}
?>

View File

@@ -172,12 +172,15 @@ function acf_print_menu_section( $menu_items, $section = '' ) {
<div class="acf-admin-toolbar">
<div class="acf-admin-toolbar-inner">
<div class="acf-nav-wrap">
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group' ) ); ?>" class="acf-logo">
<img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-logo.svg' ) ); ?>" alt="<?php esc_attr_e( 'Advanced Custom Fields logo', 'acf' ); ?>">
<?php if ( acf_is_pro() && acf_pro_is_license_active() ) { ?>
<div class="acf-pro-label">PRO</div>
<?php } ?>
</a>
<?php if ( acf_is_pro() && acf_pro_is_license_active() ) { ?>
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group' ) ); ?>" class="acf-logo pro">
<img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-pro-logo.svg' ) ); ?>" alt="<?php esc_attr_e( 'Advanced Custom Fields logo', 'acf' ); ?>">
</a>
<?php } else { ?>
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=acf-field-group' ) ); ?>" class="acf-logo">
<img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-logo.svg' ) ); ?>" alt="<?php esc_attr_e( 'Advanced Custom Fields logo', 'acf' ); ?>">
</a>
<?php } ?>
<h2><?php echo esc_html( acf_get_setting( 'name' ) ); ?></h2>
<?php acf_print_menu_section( $core_tabs, 'core' ); ?>

View File

@@ -22,7 +22,7 @@ if ( ! acf_get_setting( 'pro' ) ) {
<div id="acf-upgrade-notice" class="notice">
<div class="notice-container">
<div class="col-content">
<img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-logo.png' ) ); ?>" />
<img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-logo.svg' ) ); ?>" />
<h2><?php esc_html_e( 'Database Upgrade Required', 'acf' ); ?></h2>
<?php // translators: %1 plugin name, %2 version number ?>
<p><?php echo acf_esc_html( sprintf( __( 'Thank you for updating to %1$s v%2$s!', 'acf' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ) ); ?><br />