plugin updates
This commit is contained in:
@@ -319,6 +319,7 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic
|
||||
?>
|
||||
<div class="acf-field-settings-footer">
|
||||
<a class="button close-field edit-field" title="<?php esc_attr_e( 'Close Field', 'acf' ); ?>" href="#"><?php esc_html_e( 'Close Field', 'acf' ); ?></a>
|
||||
<a class="acf-btn acf-btn-secondary close-add-field" title="<?php esc_attr_e( 'Close and Add Field', 'acf' ); ?>" href="#"><?php esc_html_e( 'Close and Add Field', 'acf' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -98,7 +98,7 @@ if ( $is_subfield ) {
|
||||
|
||||
<ul class="acf-hl acf-tfoot">
|
||||
<li class="acf-fr">
|
||||
<a href="#" class="acf-btn acf-btn-secondary add-field"><i class="acf-icon acf-icon-plus"></i><?php esc_html_e( 'Add Field', 'acf' ); ?></a>
|
||||
<a href="#" class="acf-btn acf-btn-sm add-field"><i class="acf-icon acf-icon-plus"></i><?php esc_html_e( 'Add Field', 'acf' ); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -838,24 +838,39 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
|
||||
'field'
|
||||
);
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'register_meta_box_cb',
|
||||
'key' => 'register_meta_box_cb',
|
||||
'prefix' => 'acf_post_type',
|
||||
'value' => $acf_post_type['register_meta_box_cb'],
|
||||
'label' => __( 'Custom Meta Box Callback', 'acf' ),
|
||||
'instructions' => __( 'A PHP function name to be called when setting up the meta boxes for the edit screen. For security, this callback will be executed in a special context without access to any superglobals like $_POST or $_GET.', 'acf' ),
|
||||
'conditions' => array(
|
||||
'field' => 'show_ui',
|
||||
'operator' => '==',
|
||||
'value' => '1',
|
||||
$acf_enable_meta_box_cb_edit = acf_get_setting( 'enable_meta_box_cb_edit' );
|
||||
$acf_meta_box_cb_instructions = __( 'A PHP function name to be called when setting up the meta boxes for the edit screen. For security, this callback will be executed in a special context without access to any superglobals like $_POST or $_GET.', 'acf' );
|
||||
|
||||
// Only show if user is allowed to update, or if it already has a value.
|
||||
if ( $acf_enable_meta_box_cb_edit || ! empty( $acf_post_type['register_meta_box_cb'] ) ) {
|
||||
if ( ! $acf_enable_meta_box_cb_edit ) {
|
||||
if ( is_multisite() ) {
|
||||
$acf_meta_box_cb_instructions .= ' ' . __( 'By default only super admin users can edit this setting.', 'acf' );
|
||||
} else {
|
||||
$acf_meta_box_cb_instructions .= ' ' . __( 'By default only admin users can edit this setting.', 'acf' );
|
||||
}
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'register_meta_box_cb',
|
||||
'key' => 'register_meta_box_cb',
|
||||
'prefix' => 'acf_post_type',
|
||||
'value' => $acf_post_type['register_meta_box_cb'],
|
||||
'label' => __( 'Custom Meta Box Callback', 'acf' ),
|
||||
'instructions' => $acf_meta_box_cb_instructions,
|
||||
'readonly' => ! $acf_enable_meta_box_cb_edit,
|
||||
'conditions' => array(
|
||||
'field' => 'show_ui',
|
||||
'operator' => '==',
|
||||
'value' => '1',
|
||||
),
|
||||
),
|
||||
),
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
|
||||
@@ -745,6 +745,16 @@ foreach ( acf_get_combined_taxonomy_settings_tabs() as $tab_key => $tab_label )
|
||||
$acf_tags_meta_box_text = __( 'Tags Meta Box', 'acf' );
|
||||
$acf_categories_meta_box_text = __( 'Categories Meta Box', 'acf' );
|
||||
$acf_default_meta_box_text = empty( $acf_taxonomy['hierarchical'] ) ? $acf_tags_meta_box_text : $acf_categories_meta_box_text;
|
||||
$acf_enable_meta_box_cb_edit = acf_get_setting( 'enable_meta_box_cb_edit' );
|
||||
$acf_meta_box_choices = array(
|
||||
'default' => $acf_default_meta_box_text,
|
||||
'custom' => __( 'Custom Meta Box', 'acf' ),
|
||||
'disabled' => __( 'No Meta Box', 'acf' ),
|
||||
);
|
||||
|
||||
if ( ! $acf_enable_meta_box_cb_edit && 'custom' !== $acf_taxonomy['meta_box'] ) {
|
||||
unset( $acf_meta_box_choices['custom'] );
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
@@ -757,11 +767,7 @@ foreach ( acf_get_combined_taxonomy_settings_tabs() as $tab_key => $tab_label )
|
||||
'label' => __( 'Meta Box', 'acf' ),
|
||||
'instructions' => __( 'Controls the meta box on the content editor screen. By default, the Categories meta box is shown for hierarchical taxonomies, and the Tags meta box is shown for non-hierarchical taxonomies.', 'acf' ),
|
||||
'hide_search' => true,
|
||||
'choices' => array(
|
||||
'default' => $acf_default_meta_box_text,
|
||||
'custom' => __( 'Custom Meta Box', 'acf' ),
|
||||
'disabled' => __( 'No Meta Box', 'acf' ),
|
||||
),
|
||||
'choices' => $acf_meta_box_choices,
|
||||
'data' => array(
|
||||
'tags_meta_box' => __( 'Tags Meta Box', 'acf' ),
|
||||
'categories_meta_box' => __( 'Categories Meta Box', 'acf' ),
|
||||
@@ -794,54 +800,68 @@ foreach ( acf_get_combined_taxonomy_settings_tabs() as $tab_key => $tab_label )
|
||||
)
|
||||
);
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'meta_box_cb',
|
||||
'key' => 'meta_box_cb',
|
||||
'prefix' => 'acf_taxonomy',
|
||||
'value' => $acf_taxonomy['meta_box_cb'],
|
||||
'label' => __( 'Register Meta Box Callback', 'acf' ),
|
||||
'instructions' => __( 'A PHP function name to be called to handle the content of a meta box on your taxonomy. For security, this callback will be executed in a special context without access to any superglobals like $_POST or $_GET.', 'acf' ),
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
if ( $acf_enable_meta_box_cb_edit || 'custom' === $acf_taxonomy['meta_box'] ) {
|
||||
$acf_meta_box_cb_instructions = __( 'A PHP function name to be called to handle the content of a meta box on your taxonomy. For security, this callback will be executed in a special context without access to any superglobals like $_POST or $_GET.', 'acf' );
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'meta_box_sanitize_cb',
|
||||
'key' => 'meta_box_sanitize_cb',
|
||||
'prefix' => 'acf_taxonomy',
|
||||
'value' => $acf_taxonomy['meta_box_sanitize_cb'],
|
||||
'label' => __( 'Meta Box Sanitization Callback', 'acf' ),
|
||||
'instructions' => __( 'A PHP function name to be called for sanitizing taxonomy data saved from a meta box.', 'acf' ),
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
if ( ! $acf_enable_meta_box_cb_edit ) {
|
||||
if ( is_multisite() ) {
|
||||
$acf_meta_box_cb_instructions .= ' ' . __( 'By default only super admin users can edit this setting.', 'acf' );
|
||||
} else {
|
||||
$acf_meta_box_cb_instructions .= ' ' . __( 'By default only admin users can edit this setting.', 'acf' );
|
||||
}
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'seperator',
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'meta_box_cb',
|
||||
'key' => 'meta_box_cb',
|
||||
'prefix' => 'acf_taxonomy',
|
||||
'value' => $acf_taxonomy['meta_box_cb'],
|
||||
'label' => __( 'Register Meta Box Callback', 'acf' ),
|
||||
'instructions' => $acf_meta_box_cb_instructions,
|
||||
'readonly' => ! $acf_enable_meta_box_cb_edit,
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'meta_box_sanitize_cb',
|
||||
'key' => 'meta_box_sanitize_cb',
|
||||
'prefix' => 'acf_taxonomy',
|
||||
'value' => $acf_taxonomy['meta_box_sanitize_cb'],
|
||||
'label' => __( 'Meta Box Sanitization Callback', 'acf' ),
|
||||
'instructions' => __( 'A PHP function name to be called for sanitizing taxonomy data saved from a meta box.', 'acf' ),
|
||||
'readonly' => ! $acf_enable_meta_box_cb_edit,
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'div',
|
||||
'field'
|
||||
);
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
'type' => 'seperator',
|
||||
'conditions' => array(
|
||||
'field' => 'meta_box',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
acf_render_field_wrap(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user