Sync plugins from current page

Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
2019-09-11 19:08:46 +02:00
parent 85d41e4216
commit 8515ff9587
1847 changed files with 505469 additions and 0 deletions

View File

@@ -0,0 +1,158 @@
<?php
// vars
$disabled = false;
// empty
if( empty($field['conditional_logic']) ) {
$disabled = true;
$field['conditional_logic'] = array(
// group 0
array(
// rule 0
array()
)
);
}
?>
<tr class="acf-field acf-field-true-false acf-field-setting-conditional_logic" data-type="true_false" data-name="conditional_logic">
<td class="acf-label">
<label><?php _e("Conditional Logic",'acf'); ?></label>
</td>
<td class="acf-input">
<?php
acf_render_field(array(
'type' => 'true_false',
'name' => 'conditional_logic',
'prefix' => $field['prefix'],
'value' => $disabled ? 0 : 1,
'ui' => 1,
'class' => 'conditions-toggle',
));
?>
<div class="rule-groups" <?php if($disabled): ?>style="display:none;"<?php endif; ?>>
<?php foreach( $field['conditional_logic'] as $group_id => $group ):
// validate
if( empty($group) ) continue;
// vars
// $group_id must be completely different to $rule_id to avoid JS issues
$group_id = "group_{$group_id}";
$h4 = ($group_id == "group_0") ? __("Show this field if",'acf') : __("or",'acf');
?>
<div class="rule-group" data-id="<?php echo $group_id; ?>">
<h4><?php echo $h4; ?></h4>
<table class="acf-table -clear">
<tbody>
<?php foreach( $group as $rule_id => $rule ):
// valid rule
$rule = wp_parse_args( $rule, array(
'field' => '',
'operator' => '',
'value' => '',
));
// vars
// $group_id must be completely different to $rule_id to avoid JS issues
$rule_id = "rule_{$rule_id}";
$prefix = "{$field['prefix']}[conditional_logic][{$group_id}][{$rule_id}]";
// data attributes
$attributes = array(
'data-id' => $rule_id,
'data-field' => $rule['field'],
'data-operator' => $rule['operator'],
'data-value' => $rule['value']
);
?>
<tr class="rule" <?php acf_esc_attr_e($attributes); ?>>
<td class="param">
<?php
acf_render_field(array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'field',
'class' => 'condition-rule-field',
'disabled' => $disabled,
'value' => $rule['field'],
'choices' => array(
$rule['field'] => $rule['field']
)
));
?>
</td>
<td class="operator">
<?php
acf_render_field(array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'operator',
'class' => 'condition-rule-operator',
'disabled' => $disabled,
'value' => $rule['operator'],
'choices' => array(
$rule['operator'] => $rule['operator']
)
));
?>
</td>
<td class="value">
<?php
// create field
acf_render_field(array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'value',
'class' => 'condition-rule-value',
'disabled' => $disabled,
'value' => $rule['value'],
'choices' => array(
$rule['value'] => $rule['value']
)
));
?>
</td>
<td class="add">
<a href="#" class="button add-conditional-rule"><?php _e("and",'acf'); ?></a>
</td>
<td class="remove">
<a href="#" class="acf-icon -minus remove-conditional-rule"></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endforeach; ?>
<h4><?php _e("or",'acf'); ?></h4>
<a href="#" class="button add-conditional-group"><?php _e("Add rule group",'acf'); ?></a>
</div>
</td>
</tr>

View File

@@ -0,0 +1,184 @@
<?php
// vars
$prefix = 'acf_fields[' . $field['ID'] . ']';
$id = acf_idify( $prefix );
// add prefix
$field['prefix'] = $prefix;
// div
$div = array(
'class' => 'acf-field-object acf-field-object-' . acf_slugify($field['type']),
'data-id' => $field['ID'],
'data-key' => $field['key'],
'data-type' => $field['type'],
);
$meta = array(
'ID' => $field['ID'],
'key' => $field['key'],
'parent' => $field['parent'],
'menu_order' => $i,
'save' => ''
);
?>
<div <?php echo acf_esc_attr( $div ); ?>>
<div class="meta">
<?php foreach( $meta as $k => $v ):
acf_hidden_input(array( 'name' => $prefix . '[' . $k . ']', 'value' => $v, 'id' => $id . '-' . $k ));
endforeach; ?>
</div>
<div class="handle">
<ul class="acf-hl acf-tbody">
<li class="li-field-order">
<span class="acf-icon acf-sortable-handle" title="<?php _e('Drag to reorder','acf'); ?>"><?php echo ($i + 1); ?></span>
</li>
<li class="li-field-label">
<strong>
<a class="edit-field" title="<?php _e("Edit field",'acf'); ?>" href="#"><?php echo acf_get_field_label($field, 'admin'); ?></a>
</strong>
<div class="row-options">
<a class="edit-field" title="<?php _e("Edit field",'acf'); ?>" href="#"><?php _e("Edit",'acf'); ?></a>
<a class="duplicate-field" title="<?php _e("Duplicate field",'acf'); ?>" href="#"><?php _e("Duplicate",'acf'); ?></a>
<a class="move-field" title="<?php _e("Move field to another group",'acf'); ?>" href="#"><?php _e("Move",'acf'); ?></a>
<a class="delete-field" title="<?php _e("Delete field",'acf'); ?>" href="#"><?php _e("Delete",'acf'); ?></a>
</div>
</li>
<?php // whitespace before field name looks odd but fixes chrome bug selecting all text in row ?>
<li class="li-field-name"> <?php echo $field['name']; ?></li>
<li class="li-field-key"> <?php echo $field['key']; ?></li>
<li class="li-field-type"> <?php echo acf_get_field_type_label($field['type']); ?></li>
</ul>
</div>
<div class="settings">
<table class="acf-table">
<tbody class="acf-field-settings">
<?php
// label
acf_render_field_setting($field, array(
'label' => __('Field Label','acf'),
'instructions' => __('This is the name which will appear on the EDIT page','acf'),
'name' => 'label',
'type' => 'text',
'class' => 'field-label'
), true);
// name
acf_render_field_setting($field, array(
'label' => __('Field Name','acf'),
'instructions' => __('Single word, no spaces. Underscores and dashes allowed','acf'),
'name' => 'name',
'type' => 'text',
'class' => 'field-name'
), true);
// type
acf_render_field_setting($field, array(
'label' => __('Field Type','acf'),
'instructions' => '',
'type' => 'select',
'name' => 'type',
'choices' => acf_get_grouped_field_types(),
'class' => 'field-type'
), true);
// instructions
acf_render_field_setting($field, array(
'label' => __('Instructions','acf'),
'instructions' => __('Instructions for authors. Shown when submitting data','acf'),
'type' => 'textarea',
'name' => 'instructions',
'rows' => 5
), true);
// required
acf_render_field_setting($field, array(
'label' => __('Required?','acf'),
'instructions' => '',
'type' => 'true_false',
'name' => 'required',
'ui' => 1,
'class' => 'field-required'
), true);
// 3rd party settings
do_action('acf/render_field_settings', $field);
// type specific settings
do_action("acf/render_field_settings/type={$field['type']}", $field);
// conditional logic
acf_get_view('field-group-field-conditional-logic', array( 'field' => $field ));
// wrapper
acf_render_field_wrap(array(
'label' => __('Wrapper Attributes','acf'),
'instructions' => '',
'type' => 'number',
'name' => 'width',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['width'],
'prepend' => __('width', 'acf'),
'append' => '%',
'wrapper' => array(
'data-name' => 'wrapper',
'class' => 'acf-field-setting-wrapper'
)
), 'tr');
acf_render_field_wrap(array(
'label' => '',
'instructions' => '',
'type' => 'text',
'name' => 'class',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['class'],
'prepend' => __('class', 'acf'),
'wrapper' => array(
'data-append' => 'wrapper'
)
), 'tr');
acf_render_field_wrap(array(
'label' => '',
'instructions' => '',
'type' => 'text',
'name' => 'id',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['id'],
'prepend' => __('id', 'acf'),
'wrapper' => array(
'data-append' => 'wrapper'
)
), 'tr');
?>
<tr class="acf-field acf-field-save">
<td class="acf-label"></td>
<td class="acf-input">
<ul class="acf-hl">
<li>
<a class="button edit-field" title="<?php _e("Close Field",'acf'); ?>" href="#"><?php _e("Close Field",'acf'); ?></a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,52 @@
<div class="acf-field-list-wrap">
<ul class="acf-hl acf-thead">
<li class="li-field-order"><?php _e('Order','acf'); ?></li>
<li class="li-field-label"><?php _e('Label','acf'); ?></li>
<li class="li-field-name"><?php _e('Name','acf'); ?></li>
<li class="li-field-key"><?php _e('Key','acf'); ?></li>
<li class="li-field-type"><?php _e('Type','acf'); ?></li>
</ul>
<div class="acf-field-list<?php if( !$fields ){ echo ' -empty'; } ?>">
<div class="no-fields-message">
<?php _e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.",'acf'); ?>
</div>
<?php if( $fields ):
foreach( $fields as $i => $field ):
acf_get_view('field-group-field', array( 'field' => $field, 'i' => $i ));
endforeach;
endif; ?>
</div>
<ul class="acf-hl acf-tfoot">
<li class="acf-fr">
<a href="#" class="button button-primary button-large add-field"><?php _e('+ Add Field','acf'); ?></a>
</li>
</ul>
<?php if( !$parent ):
// get clone
$clone = acf_get_valid_field(array(
'ID' => 'acfcloneindex',
'key' => 'acfcloneindex',
'label' => __('New Field','acf'),
'name' => 'new_field',
'type' => 'text'
));
?>
<script type="text/html" id="tmpl-acf-field">
<?php acf_get_view('field-group-field', array( 'field' => $clone, 'i' => 0 )); ?>
</script>
<?php endif;?>
</div>

View File

@@ -0,0 +1,45 @@
<?php
// global
global $field_group;
?>
<div class="acf-field">
<div class="acf-label">
<label><?php _e("Rules",'acf'); ?></label>
<p class="description"><?php _e("Create a set of rules to determine which edit screens will use these advanced custom fields",'acf'); ?></p>
</div>
<div class="acf-input">
<div class="rule-groups">
<?php foreach( $field_group['location'] as $i => $group ):
// bail ealry if no group
if( empty($group) ) return;
// view
acf_get_view('html-location-group', array(
'group' => $group,
'group_id' => "group_{$i}"
));
endforeach; ?>
<h4><?php _e("or",'acf'); ?></h4>
<a href="#" class="button add-location-group"><?php _e("Add rule group",'acf'); ?></a>
</div>
</div>
</div>
<script type="text/javascript">
if( typeof acf !== 'undefined' ) {
acf.newPostbox({
'id': 'acf-field-group-locations',
'label': 'left'
});
}
</script>

View File

@@ -0,0 +1,155 @@
<?php
// global
global $field_group;
// active
acf_render_field_wrap(array(
'label' => __('Active','acf'),
'instructions' => '',
'type' => 'true_false',
'name' => 'active',
'prefix' => 'acf_field_group',
'value' => $field_group['active'],
'ui' => 1,
//'ui_on_text' => __('Active', 'acf'),
//'ui_off_text' => __('Inactive', 'acf'),
));
// style
acf_render_field_wrap(array(
'label' => __('Style','acf'),
'instructions' => '',
'type' => 'select',
'name' => 'style',
'prefix' => 'acf_field_group',
'value' => $field_group['style'],
'choices' => array(
'default' => __("Standard (WP metabox)",'acf'),
'seamless' => __("Seamless (no metabox)",'acf'),
)
));
// position
acf_render_field_wrap(array(
'label' => __('Position','acf'),
'instructions' => '',
'type' => 'select',
'name' => 'position',
'prefix' => 'acf_field_group',
'value' => $field_group['position'],
'choices' => array(
'acf_after_title' => __("High (after title)",'acf'),
'normal' => __("Normal (after content)",'acf'),
'side' => __("Side",'acf'),
),
'default_value' => 'normal'
));
// label_placement
acf_render_field_wrap(array(
'label' => __('Label placement','acf'),
'instructions' => '',
'type' => 'select',
'name' => 'label_placement',
'prefix' => 'acf_field_group',
'value' => $field_group['label_placement'],
'choices' => array(
'top' => __("Top aligned",'acf'),
'left' => __("Left aligned",'acf'),
)
));
// instruction_placement
acf_render_field_wrap(array(
'label' => __('Instruction placement','acf'),
'instructions' => '',
'type' => 'select',
'name' => 'instruction_placement',
'prefix' => 'acf_field_group',
'value' => $field_group['instruction_placement'],
'choices' => array(
'label' => __("Below labels",'acf'),
'field' => __("Below fields",'acf'),
)
));
// menu_order
acf_render_field_wrap(array(
'label' => __('Order No.','acf'),
'instructions' => __('Field groups with a lower order will appear first','acf'),
'type' => 'number',
'name' => 'menu_order',
'prefix' => 'acf_field_group',
'value' => $field_group['menu_order'],
));
// description
acf_render_field_wrap(array(
'label' => __('Description','acf'),
'instructions' => __('Shown in field group list','acf'),
'type' => 'text',
'name' => 'description',
'prefix' => 'acf_field_group',
'value' => $field_group['description'],
));
// hide on screen
$choices = array(
'permalink' => __("Permalink", 'acf'),
'the_content' => __("Content Editor",'acf'),
'excerpt' => __("Excerpt", 'acf'),
'custom_fields' => __("Custom Fields", 'acf'),
'discussion' => __("Discussion", 'acf'),
'comments' => __("Comments", 'acf'),
'revisions' => __("Revisions", 'acf'),
'slug' => __("Slug", 'acf'),
'author' => __("Author", 'acf'),
'format' => __("Format", 'acf'),
'page_attributes' => __("Page Attributes", 'acf'),
'featured_image' => __("Featured Image", 'acf'),
'categories' => __("Categories", 'acf'),
'tags' => __("Tags", 'acf'),
'send-trackbacks' => __("Send Trackbacks", 'acf'),
);
if( acf_get_setting('remove_wp_meta_box') ) {
unset( $choices['custom_fields'] );
}
acf_render_field_wrap(array(
'label' => __('Hide on screen','acf'),
'instructions' => __('<b>Select</b> items to <b>hide</b> them from the edit screen.','acf') . '<br /><br />' . __("If multiple field groups appear on an edit screen, the first field group's options will be used (the one with the lowest order number)",'acf'),
'type' => 'checkbox',
'name' => 'hide_on_screen',
'prefix' => 'acf_field_group',
'value' => $field_group['hide_on_screen'],
'toggle' => true,
'choices' => $choices
));
// 3rd party settings
do_action('acf/render_field_group_settings', $field_group);
?>
<div class="acf-hidden">
<input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" />
</div>
<script type="text/javascript">
if( typeof acf !== 'undefined' ) {
acf.newPostbox({
'id': 'acf-field-group-options',
'label': 'left'
});
}
</script>

View File

@@ -0,0 +1,216 @@
<?php
/**
* Network Admin Database Upgrade
*
* Shows the databse upgrade process.
*
* @date 24/8/18
* @since 5.7.4
* @param void
*/
?>
<style type="text/css">
/* hide steps */
.show-on-complete {
display: none;
}
</style>
<div id="acf-upgrade-wrap" class="wrap">
<h1><?php _e("Upgrade Database", 'acf'); ?></h1>
<p><?php echo sprintf( __("The following sites require a DB upgrade. Check the ones you want to update and then click %s.", 'acf'), '"' . __('Upgrade Sites', 'acf') . '"'); ?></p>
<p><input type="submit" name="upgrade" value="<?php _e('Upgrade Sites', 'acf'); ?>" class="button" id="upgrade-sites"></p>
<table class="wp-list-table widefat">
<thead>
<tr>
<td class="manage-column check-column" scope="col">
<input type="checkbox" id="sites-select-all">
</td>
<th class="manage-column" scope="col" style="width:33%;">
<label for="sites-select-all"><?php _e("Site", 'acf'); ?></label>
</th>
<th><?php _e("Description", 'acf'); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td class="manage-column check-column" scope="col">
<input type="checkbox" id="sites-select-all-2">
</td>
<th class="manage-column" scope="col">
<label for="sites-select-all-2"><?php _e("Site", 'acf'); ?></label>
</th>
<th><?php _e("Description", 'acf'); ?></th>
</tr>
</tfoot>
<tbody id="the-list">
<?php
$sites = acf_get_sites();
if( $sites ):
foreach( $sites as $i => $site ):
// switch blog
switch_to_blog( $site['blog_id'] );
?>
<tr<?php if( $i % 2 == 0 ): ?> class="alternate"<?php endif; ?>>
<th class="check-column" scope="row">
<?php if( acf_has_upgrade() ): ?>
<input type="checkbox" value="<?php echo $site['blog_id']; ?>" name="checked[]">
<?php endif; ?>
</th>
<td>
<strong><?php echo get_bloginfo('name'); ?></strong><br /><?php echo home_url(); ?>
</td>
<td>
<?php if( acf_has_upgrade() ): ?>
<span class="response"><?php printf(__('Site requires database upgrade from %s to %s', 'acf'), acf_get_db_version(), ACF_VERSION); ?></span>
<?php else: ?>
<?php _e("Site is up to date", 'acf'); ?>
<?php endif; ?>
</td>
</tr>
<?php
// restore
restore_current_blog();
endforeach;
endif;
?>
</tbody>
</table>
<p><input type="submit" name="upgrade" value="<?php _e('Upgrade Sites', 'acf'); ?>" class="button" id="upgrade-sites-2"></p>
<p class="show-on-complete"><?php echo sprintf( __('Database Upgrade complete. <a href="%s">Return to network dashboard</a>', 'acf'), network_admin_url() ); ?></p>
<script type="text/javascript">
(function($) {
var upgrader = new acf.Model({
events: {
'click #upgrade-sites': 'onClick',
'click #upgrade-sites-2': 'onClick'
},
$inputs: function(){
return $('#the-list input:checked');
},
onClick: function( e, $el ){
// prevent default
e.preventDefault();
// bail early if no selection
if( !this.$inputs().length ) {
return alert('<?php _e('Please select at least one site to upgrade.', 'acf'); ?>');
}
// confirm action
if( !confirm("<?php _e('It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf'); ?>") ) {
return;
}
// upgrade
this.upgrade();
},
upgrade: function(){
// vars
var $inputs = this.$inputs();
// bail early if no sites selected
if( !$inputs.length ) {
return this.complete();
}
// disable buttons
$('.button').prop('disabled', true);
// vars
var $input = $inputs.first();
var $row = $input.closest('tr');
var text = '';
var success = false;
// show loading
$row.find('.response').html('<i class="acf-loading"></i></span> <?php printf(__('Upgrading data to version %s', 'acf'), ACF_VERSION); ?>');
// send ajax request to upgrade DB
$.ajax({
url: acf.get('ajaxurl'),
dataType: 'json',
type: 'post',
data: acf.prepareForAjax({
action: 'acf/ajax/upgrade',
blog_id: $input.val()
}),
success: function( json ){
// success
if( acf.isAjaxSuccess(json) ) {
// update
success = true;
// remove input
$input.remove();
// set response text
text = '<?php _e('Upgrade complete.', 'acf'); ?>';
if( jsonText = acf.getAjaxMessage(json) ) {
text = jsonText;
}
// error
} else {
// set response text
text = '<?php _e('Upgrade failed.', 'acf'); ?>';
if( jsonText = acf.getAjaxError(json) ) {
text += ' <pre>' + jsonText + '</pre>';
}
}
},
error: function( jqXHR, textStatus, errorThrown ){
// set response text
text = '<?php _e('Upgrade failed.', 'acf'); ?>';
if( errorThrown) {
text += ' <pre>' + errorThrown + '</pre>';
}
},
complete: this.proxy(function(){
// display text
$row.find('.response').html( text );
// if successful upgrade, proceed to next site. Otherwise, skip to complete.
if( success ) {
this.upgrade();
} else {
this.complete();
}
})
});
},
complete: function(){
// enable buttons
$('.button').prop('disabled', false);
// show message
$('.show-on-complete').show();
}
});
})(jQuery);
</script>
</div>

View File

@@ -0,0 +1,119 @@
<?php
/**
* Admin Database Upgrade
*
* Shows the databse upgrade process.
*
* @date 24/8/18
* @since 5.7.4
* @param void
*/
?>
<style type="text/css">
/* hide steps */
.step-1,
.step-2,
.step-3 {
display: none;
}
</style>
<div id="acf-upgrade-wrap" class="wrap">
<h1><?php _e("Upgrade Database", 'acf'); ?></h1>
<?php if( acf_has_upgrade() ): ?>
<p><?php _e('Reading upgrade tasks...', 'acf'); ?></p>
<p class="step-1"><i class="acf-loading"></i> <?php printf(__('Upgrading data to version %s', 'acf'), ACF_VERSION); ?></p>
<p class="step-2"></p>
<p class="step-3"><?php echo sprintf( __('Database upgrade complete. <a href="%s">See what\'s new</a>', 'acf' ), admin_url('edit.php?post_type=acf-field-group&page=acf-settings-info') ); ?></p>
<script type="text/javascript">
(function($) {
var upgrader = new acf.Model({
initialize: function(){
// allow user to read message for 1 second
this.setTimeout( this.upgrade, 1000 );
},
upgrade: function(){
// show step 1
$('.step-1').show();
// vars
var response = '';
var success = false;
// send ajax request to upgrade DB
$.ajax({
url: acf.get('ajaxurl'),
dataType: 'json',
type: 'post',
data: acf.prepareForAjax({
action: 'acf/ajax/upgrade'
}),
success: function( json ){
// success
if( acf.isAjaxSuccess(json) ) {
// update
success = true;
// set response text
if( jsonText = acf.getAjaxMessage(json) ) {
response = jsonText;
}
// error
} else {
// set response text
response = '<?php _e('Upgrade failed.', 'acf'); ?>';
if( jsonText = acf.getAjaxError(json) ) {
response += ' <pre>' + jsonText + '</pre>';
}
}
},
error: function( jqXHR, textStatus, errorThrown ){
// set response text
response = '<?php _e('Upgrade failed.', 'acf'); ?>';
if( errorThrown) {
response += ' <pre>' + errorThrown + '</pre>';
}
},
complete: this.proxy(function(){
// remove spinner
$('.acf-loading').hide();
// display response
if( response ) {
$('.step-2').show().html( response );
}
// display success
if( success ) {
$('.step-3').show();
}
})
});
}
});
})(jQuery);
</script>
<?php else: ?>
<p><?php _e('No updates available.', 'acf'); ?></p>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,27 @@
<?php
/**
* html-admin-tools
*
* View to output admin tools for both archive and single
*
* @date 20/10/17
* @since 5.6.3
*
* @param string $screen_id The screen ID used to display metaboxes
* @param string $active The active Tool
* @return n/a
*/
$class = $active ? 'single' : 'grid';
?>
<div class="wrap" id="acf-admin-tools">
<h1><?php _e('Tools', 'acf'); ?> <?php if( $active ): ?><a class="page-title-action" href="<?php echo acf_get_admin_tools_url(); ?>"><?php _e('Back to all tools', 'acf'); ?></a><?php endif; ?></h1>
<div class="acf-meta-box-wrap -<?php echo $class; ?>">
<?php do_meta_boxes( $screen_id, 'normal', '' ); ?>
</div>
</div>

View File

@@ -0,0 +1,25 @@
<div class="rule-group" data-id="<?php echo $group_id; ?>">
<h4><?php echo ($group_id == 'group_0') ? __("Show this field group if",'acf') : __("or",'acf'); ?></h4>
<table class="acf-table -clear">
<tbody>
<?php foreach( $group as $i => $rule ):
// validate rule
$rule = acf_validate_location_rule($rule);
// append id and group
$rule['id'] = "rule_{$i}";
$rule['group'] = $group_id;
// view
acf_get_view('html-location-rule', array(
'rule' => $rule
));
endforeach; ?>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,91 @@
<?php
// vars
$prefix = 'acf_field_group[location]['.$rule['group'].']['.$rule['id'].']';
?>
<tr data-id="<?php echo $rule['id']; ?>">
<td class="param">
<?php
// vars
$choices = acf_get_location_rule_types();
// array
if( is_array($choices) ) {
acf_render_field(array(
'type' => 'select',
'name' => 'param',
'prefix' => $prefix,
'value' => $rule['param'],
'choices' => $choices,
'class' => 'refresh-location-rule'
));
}
?>
</td>
<td class="operator">
<?php
// vars
$choices = acf_get_location_rule_operators( $rule );
// array
if( is_array($choices) ) {
acf_render_field(array(
'type' => 'select',
'name' => 'operator',
'prefix' => $prefix,
'value' => $rule['operator'],
'choices' => $choices
));
// custom
} else {
echo $choices;
}
?>
</td>
<td class="value">
<?php
// vars
$choices = acf_get_location_rule_values( $rule );
// array
if( is_array($choices) ) {
acf_render_field(array(
'type' => 'select',
'name' => 'value',
'prefix' => $prefix,
'value' => $rule['value'],
'choices' => $choices
));
// custom
} else {
echo $choices;
}
?>
</td>
<td class="add">
<a href="#" class="button add-location-rule"><?php _e("and",'acf'); ?></a>
</td>
<td class="remove">
<a href="#" class="acf-icon -minus remove-location-rule"></a>
</td>
</tr>

View File

@@ -0,0 +1,43 @@
<?php
// calculate add-ons (non pro only)
$plugins = array();
if( !acf_get_setting('pro') ) {
if( is_plugin_active('acf-repeater/acf-repeater.php') ) $plugins[] = __("Repeater",'acf');
if( is_plugin_active('acf-flexible-content/acf-flexible-content.php') ) $plugins[] = __("Flexible Content",'acf');
if( is_plugin_active('acf-gallery/acf-gallery.php') ) $plugins[] = __("Gallery",'acf');
if( is_plugin_active('acf-options-page/acf-options-page.php') ) $plugins[] = __("Options Page",'acf');
}
?>
<div id="acf-upgrade-notice" class="notice">
<div class="col-content">
<img src="<?php echo acf_get_url('assets/images/acf-logo.png'); ?>" />
<h2><?php _e("Database Upgrade Required",'acf'); ?></h2>
<p><?php printf(__("Thank you for updating to %s v%s!", 'acf'), acf_get_setting('name'), acf_get_setting('version') ); ?><br /><?php _e("This version contains improvements to your database and requires an upgrade.", 'acf'); ?></p>
<?php if( !empty($plugins) ): ?>
<p><?php printf(__("Please also check all premium add-ons (%s) are updated to the latest version.", 'acf'), implode(', ', $plugins) ); ?></p>
<?php endif; ?>
</div>
<div class="col-actions">
<a id="acf-upgrade-button" href="<?php echo $button_url; ?>" class="button button-primary button-hero"><?php echo $button_text; ?></a>
</div>
</div>
<?php if( $confirm ): ?>
<script type="text/javascript">
(function($) {
$("#acf-upgrade-button").on("click", function(){
return confirm("<?php _e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf' ); ?>");
});
})(jQuery);
</script>
<?php endif; ?>

View File

@@ -0,0 +1,54 @@
<div class="wrap acf-settings-wrap">
<h1><?php _e("Add-ons",'acf'); ?></h1>
<div class="add-ons-list">
<?php if( !empty($json) ): ?>
<?php foreach( $json as $addon ):
$addon = wp_parse_args($addon, array(
"title" => "",
"slug" => "",
"description" => "",
"thumbnail" => "",
"url" => "",
"btn" => __("Download & Install",'acf'),
"btn_color" => ""
));
?>
<div class="acf-box add-on add-on-<?php echo $addon['slug']; ?>">
<div class="thumbnail">
<a target="_blank" href="<?php echo $addon['url']; ?>">
<img src="<?php echo $addon['thumbnail']; ?>" />
</a>
</div>
<div class="inner">
<h3><a target="_blank" href="<?php echo $addon['url']; ?>"><?php echo $addon['title']; ?></a></h3>
<p><?php echo $addon['description']; ?></p>
</div>
<div class="footer">
<?php if( apply_filters("acf/is_add_on_active/slug={$addon['slug']}", false ) ): ?>
<a class="button" disabled="disabled"><?php _e("Installed",'acf'); ?></a>
<?php else: ?>
<a class="button <?php echo $addon['btn_color']; ?>" target="_blank" href="<?php echo $addon['url']; ?>" ><?php _e($addon['btn']); ?></a>
<?php endif; ?>
<?php if( !empty($addon['footer']) ): ?>
<p><?php echo $addon['footer']; ?></p>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,160 @@
<div class="wrap about-wrap acf-wrap">
<h1><?php _e("Welcome to Advanced Custom Fields",'acf'); ?> <?php echo $version; ?></h1>
<div class="about-text"><?php printf(__("Thank you for updating! ACF %s is bigger and better than ever before. We hope you like it.", 'acf'), $version); ?></div>
<h2 class="nav-tab-wrapper">
<?php foreach( $tabs as $tab_slug => $tab_title ): ?>
<a class="nav-tab<?php if( $active == $tab_slug ): ?> nav-tab-active<?php endif; ?>" href="<?php echo admin_url("edit.php?post_type=acf-field-group&page=acf-settings-info&tab={$tab_slug}"); ?>"><?php echo $tab_title; ?></a>
<?php endforeach; ?>
</h2>
<?php if( $active == 'new' ): ?>
<div class="feature-section">
<h2><?php _e("A Smoother Experience", 'acf'); ?> </h2>
<div class="acf-three-col">
<div>
<p><img src="https://assets.advancedcustomfields.com/info/5.0.0/select2.png" /></p>
<h3><?php _e("Improved Usability", 'acf'); ?></h3>
<p><?php _e("Including the popular Select2 library has improved both usability and speed across a number of field types including post object, page link, taxonomy and select.", 'acf'); ?></p>
</div>
<div>
<p><img src="https://assets.advancedcustomfields.com/info/5.0.0/design.png" /></p>
<h3><?php _e("Improved Design", 'acf'); ?></h3>
<p><?php _e("Many fields have undergone a visual refresh to make ACF look better than ever! Noticeable changes are seen on the gallery, relationship and oEmbed (new) fields!", 'acf'); ?></p>
</div>
<div>
<p><img src="https://assets.advancedcustomfields.com/info/5.0.0/sub-fields.png" /></p>
<h3><?php _e("Improved Data", 'acf'); ?></h3>
<p><?php _e("Redesigning the data architecture has allowed sub fields to live independently from their parents. This allows you to drag and drop fields in and out of parent fields!", 'acf'); ?></p>
</div>
</div>
</div>
<hr />
<div class="feature-section">
<h2><?php _e("Goodbye Add-ons. Hello PRO", 'acf'); ?> 👋</h2>
<div class="acf-three-col">
<div>
<h3><?php _e("Introducing ACF PRO", 'acf'); ?></h3>
<p><?php _e("We're changing the way premium functionality is delivered in an exciting way!", 'acf'); ?></p>
<p><?php printf(__('All 4 premium add-ons have been combined into a new <a href="%s">Pro version of ACF</a>. With both personal and developer licenses available, premium functionality is more affordable and accessible than ever before!', 'acf'), esc_url('https://www.advancedcustomfields.com/pro')); ?></p>
</div>
<div>
<h3><?php _e("Powerful Features", 'acf'); ?></h3>
<p><?php _e("ACF PRO contains powerful features such as repeatable data, flexible content layouts, a beautiful gallery field and the ability to create extra admin options pages!", 'acf'); ?></p>
<p><?php printf(__('Read more about <a href="%s">ACF PRO features</a>.', 'acf'), esc_url('https://www.advancedcustomfields.com/pro')); ?></p>
</div>
<div>
<h3><?php _e("Easy Upgrading", 'acf'); ?></h3>
<p><?php _e('Upgrading to ACF PRO is easy. Simply purchase a license online and download the plugin!', 'acf'); ?></p>
<p><?php printf(__('We also wrote an <a href="%s">upgrade guide</a> to answer any questions, but if you do have one, please contact our support team via the <a href="%s">help desk</a>.', 'acf'), esc_url('https://www.advancedcustomfields.com/resources/upgrade-guide-acf-pro/'), esc_url('https://www.advancedcustomfields.com/support/')); ?></p>
</div>
</div>
</div>
<hr />
<div class="feature-section">
<h2><?php _e("New Features", 'acf'); ?> 🎉</h2>
<div class="acf-three-col">
<div>
<h3><?php _e("Link Field", 'acf'); ?></h3>
<p><?php _e("The Link field provides a simple way to select or define a link (url, title, target).", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Group Field", 'acf'); ?></h3>
<p><?php _e("The Group field provides a simple way to create a group of fields.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("oEmbed Field", 'acf'); ?></h3>
<p><?php _e("The oEmbed field allows an easy way to embed videos, images, tweets, audio, and other content.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Clone Field", 'acf'); ?> <span class="badge"><?php _e('Pro', 'acf'); ?></span></h3>
<p><?php _e("The clone field allows you to select and display existing fields.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("More AJAX", 'acf'); ?></h3>
<p><?php _e("More fields use AJAX powered search to speed up page loading.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Local JSON", 'acf'); ?></h3>
<p><?php _e("New auto export to JSON feature improves speed and allows for syncronisation.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Easy Import / Export", 'acf'); ?></h3>
<p><?php _e("Both import and export can easily be done through a new tools page.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("New Form Locations", 'acf'); ?></h3>
<p><?php _e("Fields can now be mapped to menus, menu items, comments, widgets and all user forms!", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("More Customization", 'acf'); ?></h3>
<p><?php _e("New PHP (and JS) actions and filters have been added to allow for more customization.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Fresh UI", 'acf'); ?></h3>
<p><?php _e("The entire plugin has had a design refresh including new field types, settings and design!", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("New Settings", 'acf'); ?></h3>
<p><?php _e("Field group settings have been added for Active, Label Placement, Instructions Placement and Description.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Better Front End Forms", 'acf'); ?></h3>
<p><?php _e("acf_form() can now create a new post on submission with lots of new settings.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Better Validation", 'acf'); ?></h3>
<p><?php _e("Form validation is now done via PHP + AJAX in favour of only JS.", 'acf'); ?></p>
</div>
<div>
<h3><?php _e("Moving Fields", 'acf'); ?></h3>
<p><?php _e("New field group functionality allows you to move a field between groups & parents.", 'acf'); ?></p>
</div>
<div><?php // intentional empty div for flex alignment ?></div>
</div>
</div>
<?php elseif( $active == 'changelog' ): ?>
<p class="about-description"><?php printf(__("We think you'll love the changes in %s.", 'acf'), $version); ?></p>
<?php
// extract changelog and parse markdown
$readme = file_get_contents( acf_get_path('readme.txt') );
$changelog = '';
if( preg_match( '/(= '.$version.' =)(.+?)(=|$)/s', $readme, $match ) && $match[2] ) {
$changelog = acf_parse_markdown( $match[2] );
}
echo acf_parse_markdown($changelog);
endif; ?>
</div>