5.3.8.1
This commit is contained in:
parent
cb662fef2b
commit
f377c0d080
6
acf.php
6
acf.php
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Advanced Custom Fields PRO
|
||||
Plugin URI: http://www.advancedcustomfields.com/
|
||||
Plugin URI: https://www.advancedcustomfields.com/
|
||||
Description: Customise WordPress with powerful, professional and intuitive fields
|
||||
Version: 5.3.7
|
||||
Version: 5.3.8.1
|
||||
Author: Elliot Condon
|
||||
Author URI: http://www.elliotcondon.com/
|
||||
Copyright: Elliot Condon
|
||||
|
|
@ -58,7 +58,7 @@ class acf {
|
|||
|
||||
// basic
|
||||
'name' => __('Advanced Custom Fields', 'acf'),
|
||||
'version' => '5.3.7',
|
||||
'version' => '5.3.8.1',
|
||||
|
||||
// urls
|
||||
'basename' => plugin_basename( __FILE__ ),
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ class acf_admin_field_groups {
|
|||
<h2><?php echo acf_get_setting('name'); ?></h2>
|
||||
|
||||
<h3><?php _e("Changelog",'acf'); ?></h3>
|
||||
<p><?php _e("See what's new in",'acf'); ?> <a href="<?php echo admin_url('edit.php?post_type=acf-field-group&page=acf-settings-info&tab=changelog'); ?>"><?php _e("version",'acf'); ?> <?php echo acf_get_setting('version'); ?></a>
|
||||
<p><?php printf(__('See what\'s new in <a href="%s">version %s</a>.','acf'), admin_url('edit.php?post_type=acf-field-group&page=acf-settings-info&tab=changelog'), acf_get_setting('version')); ?></p>
|
||||
|
||||
<h3><?php _e("Resources",'acf'); ?></h3>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class acf_settings_addons {
|
|||
|
||||
|
||||
// load json
|
||||
$request = wp_remote_post( 'http://assets.advancedcustomfields.com/add-ons/add-ons.json' );
|
||||
$request = wp_remote_post( 'https://assets.advancedcustomfields.com/add-ons/add-ons.json' );
|
||||
|
||||
// validate
|
||||
if( is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200)
|
||||
|
|
|
|||
|
|
@ -110,11 +110,42 @@ class acf_admin_update {
|
|||
|
||||
|
||||
// add page
|
||||
add_submenu_page('update-core.php', __('Upgrade ACF','acf'), __('Upgrade ACF','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'network_html'));
|
||||
$page = add_submenu_page('update-core.php', __('Upgrade ACF','acf'), __('Upgrade ACF','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'network_html'));
|
||||
|
||||
|
||||
// actions
|
||||
add_action('load-' . $page, array($this,'network_load'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* load
|
||||
*
|
||||
* This function will look at the $_POST data and run any functions if needed
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function network_load() {
|
||||
|
||||
// hide upgrade
|
||||
remove_action('network_admin_notices', array($this, 'network_admin_notices'), 1);
|
||||
|
||||
|
||||
// load acf scripts
|
||||
acf_enqueue_scripts();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* network_admin_notices
|
||||
*
|
||||
|
|
@ -130,14 +161,6 @@ class acf_admin_update {
|
|||
|
||||
function network_admin_notices() {
|
||||
|
||||
// bail ealry if already on update page
|
||||
if( acf_is_screen('admin_page_acf-upgrade-network') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'button_text' => __("Review sites & upgrade", 'acf'),
|
||||
|
|
@ -222,10 +245,6 @@ class acf_admin_update {
|
|||
);
|
||||
|
||||
|
||||
// enqueue
|
||||
acf_enqueue_scripts();
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update-network', $view);
|
||||
|
||||
|
|
@ -295,7 +314,36 @@ class acf_admin_update {
|
|||
|
||||
|
||||
// add page
|
||||
add_submenu_page('edit.php?post_type=acf-field-group', __('Upgrade','acf'), __('Upgrade','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'html') );
|
||||
$page = add_submenu_page('edit.php?post_type=acf-field-group', __('Upgrade','acf'), __('Upgrade','acf'), acf_get_setting('capability'),'acf-upgrade', array($this,'html') );
|
||||
|
||||
|
||||
// actions
|
||||
add_action('load-' . $page, array($this,'load'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* load
|
||||
*
|
||||
* This function will look at the $_POST data and run any functions if needed
|
||||
*
|
||||
* @type function
|
||||
* @date 7/01/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
*/
|
||||
|
||||
function load() {
|
||||
|
||||
// hide upgrade
|
||||
remove_action('admin_notices', array($this, 'admin_notices'), 1);
|
||||
|
||||
|
||||
// load acf scripts
|
||||
acf_enqueue_scripts();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -315,14 +363,6 @@ class acf_admin_update {
|
|||
|
||||
function admin_notices() {
|
||||
|
||||
// bail ealry if already on update page
|
||||
if( acf_is_screen('custom-fields_page_acf-upgrade') ) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// view
|
||||
$view = array(
|
||||
'button_text' => __("Upgrade Database", 'acf'),
|
||||
|
|
@ -358,10 +398,6 @@ class acf_admin_update {
|
|||
);
|
||||
|
||||
|
||||
// enqueue
|
||||
acf_enqueue_scripts();
|
||||
|
||||
|
||||
// load view
|
||||
acf_get_view('update', $view);
|
||||
|
||||
|
|
@ -393,7 +429,9 @@ class acf_admin_update {
|
|||
// validate
|
||||
if( !wp_verify_nonce($options['nonce'], 'acf_upgrade') ) {
|
||||
|
||||
wp_send_json_error();
|
||||
wp_send_json_error(array(
|
||||
'message' => __('Error validating request', 'acf')
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -415,7 +453,7 @@ class acf_admin_update {
|
|||
if( empty($updates) ) {
|
||||
|
||||
wp_send_json_error(array(
|
||||
'message' => 'No updates available'
|
||||
'message' => __('No updates available', 'acf')
|
||||
));
|
||||
|
||||
}
|
||||
|
|
@ -432,7 +470,7 @@ class acf_admin_update {
|
|||
if( !file_exists($path) ) {
|
||||
|
||||
wp_send_json_error(array(
|
||||
'message' => 'Error loading update'
|
||||
'message' => __('Error loading update', 'acf')
|
||||
));
|
||||
|
||||
}
|
||||
|
|
@ -525,7 +563,7 @@ class acf_admin_update {
|
|||
$obj->slug = $_GET['plugin'];
|
||||
$obj->new_version = $rollback;
|
||||
$obj->url = 'https://wordpress.org/plugins/advanced-custom-fields';
|
||||
$obj->package = 'http://downloads.wordpress.org/plugin/advanced-custom-fields.' . $rollback . '.zip';;
|
||||
$obj->package = 'https://downloads.wordpress.org/plugin/advanced-custom-fields.' . $rollback . '.zip';;
|
||||
|
||||
|
||||
// add to transient
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ $atts['class'] = str_replace('_', '-', $atts['class']);
|
|||
<div class="handle">
|
||||
<ul class="acf-hl acf-tbody">
|
||||
<li class="li-field-order">
|
||||
<span class="acf-icon acf-sortable-handle"><?php echo ($i + 1); ?></span>
|
||||
<span class="acf-icon acf-sortable-handle" title="<?php _e('Drag to reorder','acf'); ?>"><?php echo ($i + 1); ?></span>
|
||||
<pre class="pre-field-key"><?php echo $field['key']; ?></pre>
|
||||
</li>
|
||||
<li class="li-field-label">
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@ extract( $args );
|
|||
|
||||
<div class="feature-section acf-three-col">
|
||||
<div>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/select2.png">
|
||||
<img src="https://assets.advancedcustomfields.com/info/5.0.0/select2.png">
|
||||
<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>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/design.png">
|
||||
<img src="https://assets.advancedcustomfields.com/info/5.0.0/design.png">
|
||||
<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>
|
||||
<img src="http://assets.advancedcustomfields.com/info/5.0.0/sub-fields.png">
|
||||
<img src="https://assets.advancedcustomfields.com/info/5.0.0/sub-fields.png">
|
||||
<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>
|
||||
|
|
@ -49,19 +49,19 @@ extract( $args );
|
|||
<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('http://www.advancedcustomfields.com/pro')); ?></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('http://www.advancedcustomfields.com/pro')); ?></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 printf(__('To help make upgrading easy, <a href="%s">login to your store account</a> and claim a free copy of ACF PRO!', 'acf'), esc_url('http://www.advancedcustomfields.com/my-account/')); ?></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('http://www.advancedcustomfields.com/resources/updates/upgrading-v4-v5/'), esc_url('http://support.advancedcustomfields.com')); ?>
|
||||
<p><?php printf(__('To help make upgrading easy, <a href="%s">login to your store account</a> and claim a free copy of ACF PRO!', 'acf'), esc_url('https://www.advancedcustomfields.com/my-account/')); ?></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/updates/upgrading-v4-v5/'), esc_url('https://support.advancedcustomfields.com')); ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -928,10 +928,6 @@ function acf_get_admin_notices()
|
|||
|
||||
function acf_get_image_sizes() {
|
||||
|
||||
// global
|
||||
global $_wp_additional_image_sizes;
|
||||
|
||||
|
||||
// vars
|
||||
$sizes = array(
|
||||
'thumbnail' => __("Thumbnail",'acf'),
|
||||
|
|
@ -971,12 +967,13 @@ function acf_get_image_sizes() {
|
|||
foreach( array_keys($sizes) as $s ) {
|
||||
|
||||
// vars
|
||||
$w = isset($_wp_additional_image_sizes[$s]['width']) ? $_wp_additional_image_sizes[$s]['width'] : get_option( "{$s}_size_w" );
|
||||
$h = isset($_wp_additional_image_sizes[$s]['height']) ? $_wp_additional_image_sizes[$s]['height'] : get_option( "{$s}_size_h" );
|
||||
$data = acf_get_image_size($s);
|
||||
|
||||
if( $w && $h ) {
|
||||
|
||||
$sizes[ $s ] .= " ({$w} x {$h})";
|
||||
// append
|
||||
if( $data['width'] && $data['height'] ) {
|
||||
|
||||
$sizes[ $s ] .= ' (' . $data['width'] . ' x ' . $data['height'] . ')';
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -996,6 +993,28 @@ function acf_get_image_sizes() {
|
|||
|
||||
}
|
||||
|
||||
function acf_get_image_size( $s = '' ) {
|
||||
|
||||
// global
|
||||
global $_wp_additional_image_sizes;
|
||||
|
||||
|
||||
// rename for nicer code
|
||||
$_sizes = $_wp_additional_image_sizes;
|
||||
|
||||
|
||||
// vars
|
||||
$data = array(
|
||||
'width' => isset($_sizes[$s]['width']) ? $_sizes[$s]['width'] : get_option("{$s}_size_w"),
|
||||
'height' => isset($_sizes[$s]['height']) ? $_sizes[$s]['height'] : get_option("{$s}_size_h")
|
||||
);
|
||||
|
||||
|
||||
// return
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_get_taxonomies
|
||||
|
|
@ -2894,6 +2913,7 @@ function acf_upload_file( $uploaded_file ) {
|
|||
|
||||
// required
|
||||
require_once( ABSPATH . "/wp-load.php" );
|
||||
require_once( ABSPATH . "/wp-admin/includes/media.php" ); // video functions
|
||||
require_once( ABSPATH . "/wp-admin/includes/file.php" );
|
||||
require_once( ABSPATH . "/wp-admin/includes/image.php" );
|
||||
|
||||
|
|
@ -3008,6 +3028,10 @@ function acf_is_screen( $id = '' ) {
|
|||
$current_screen = get_current_screen();
|
||||
|
||||
|
||||
// bail early if no screen
|
||||
if( !$current_screen ) return false;
|
||||
|
||||
|
||||
// return
|
||||
return ($id === $current_screen->id);
|
||||
|
||||
|
|
@ -3073,12 +3097,12 @@ function acf_maybe_get( $array, $key, $default = null ) {
|
|||
|
||||
function acf_get_attachment( $post ) {
|
||||
|
||||
// get post
|
||||
if ( !$post = get_post( $post ) ) {
|
||||
// post
|
||||
$post = get_post($post);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
// bail early if no post
|
||||
if( !$post ) return false;
|
||||
|
||||
|
||||
// vars
|
||||
|
|
@ -3867,6 +3891,85 @@ function acf_is_row_collapsed( $field_key = '', $row_index = 0 ) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_get_post_thumbnail
|
||||
*
|
||||
* This function will return a thumbail image url for a given post
|
||||
*
|
||||
* @type function
|
||||
* @date 3/05/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param $post (obj)
|
||||
* @param $size (mixed)
|
||||
* @return (string)
|
||||
*/
|
||||
|
||||
function acf_get_post_thumbnail( $post = null, $size = 'thumbnail' ) {
|
||||
|
||||
// vars
|
||||
$data = array(
|
||||
'url' => '',
|
||||
'type' => '',
|
||||
'html' => ''
|
||||
);
|
||||
|
||||
|
||||
// post
|
||||
$post = get_post($post);
|
||||
|
||||
|
||||
// bail early if no post
|
||||
if( !$post ) return $data;
|
||||
|
||||
|
||||
// vars
|
||||
$thumb_id = $post->ID;
|
||||
$mime_type = acf_maybe_get(explode('/', $post->post_mime_type), 0);
|
||||
|
||||
|
||||
// attachment
|
||||
if( $post->post_type === 'attachment' ) {
|
||||
|
||||
// change $thumb_id
|
||||
if( $mime_type === 'audio' || $mime_type === 'video' ) {
|
||||
|
||||
$thumb_id = get_post_thumbnail_id($post->ID);
|
||||
|
||||
}
|
||||
|
||||
// post
|
||||
} else {
|
||||
|
||||
$thumb_id = get_post_thumbnail_id($post->ID);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// try url
|
||||
$data['url'] = wp_get_attachment_image_src($thumb_id, $size);
|
||||
$data['url'] = acf_maybe_get($data['url'], 0);
|
||||
|
||||
|
||||
// default icon
|
||||
if( !$data['url'] && $post->post_type === 'attachment' ) {
|
||||
|
||||
$data['url'] = wp_mime_type_icon($post->ID);
|
||||
$data['type'] = 'icon';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// html
|
||||
$data['html'] = '<img src="' . $data['url'] . '" alt="" />';
|
||||
|
||||
|
||||
// return
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Hacks
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,16 @@
|
|||
|
||||
function acf_get_field_reference( $field_name, $post_id ) {
|
||||
|
||||
return acf_get_metadata( $post_id, $field_name, true );
|
||||
// vars
|
||||
$field_key = acf_get_metadata( $post_id, $field_name, true );
|
||||
|
||||
|
||||
// filter
|
||||
$field_key = apply_filters('acf/get_field_reference', $field_key, $field_name, $post_id);
|
||||
|
||||
|
||||
// return
|
||||
return $field_key;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -482,7 +491,7 @@ function have_rows( $selector, $post_id = false ) {
|
|||
// add loop
|
||||
acf_add_loop(array(
|
||||
'selector' => $selector,
|
||||
'name' => $active_loop['name'] . '_' . $active_loop['i'], // used by update_sub_field
|
||||
'name' => $active_loop['name'] . '_' . $active_loop['i'] . '_' . $sub_field['name'], // used by update_sub_field
|
||||
'value' => $value,
|
||||
'field' => $sub_field,
|
||||
'i' => -1,
|
||||
|
|
@ -594,6 +603,84 @@ function get_row_index() {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_row_sub_field
|
||||
*
|
||||
* This function is used inside a 'has_sub_field' while loop to return a sub field object
|
||||
*
|
||||
* @type function
|
||||
* @date 16/05/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param $selector (string)
|
||||
* @return (array)
|
||||
*/
|
||||
|
||||
function get_row_sub_field( $selector ) {
|
||||
|
||||
// vars
|
||||
$row = acf_get_loop('active');
|
||||
|
||||
|
||||
// bail early if no row
|
||||
if( !$row ) return false;
|
||||
|
||||
|
||||
// attempt to find sub field
|
||||
$sub_field = acf_get_sub_field($selector, $row['field']);
|
||||
|
||||
|
||||
// bail early if no field
|
||||
if( !$sub_field ) return false;
|
||||
|
||||
|
||||
// update field's name based on row data
|
||||
$sub_field['name'] = "{$row['name']}_{$row['i']}_{$sub_field['name']}";
|
||||
|
||||
|
||||
// return
|
||||
return $sub_field;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_row_sub_value
|
||||
*
|
||||
* This function is used inside a 'has_sub_field' while loop to return a sub field value
|
||||
*
|
||||
* @type function
|
||||
* @date 16/05/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param $selector (string)
|
||||
* @return (mixed)
|
||||
*/
|
||||
|
||||
function get_row_sub_value( $selector ) {
|
||||
|
||||
// vars
|
||||
$row = acf_get_loop('active');
|
||||
|
||||
|
||||
// bail early if no row
|
||||
if( !$row ) return null;
|
||||
|
||||
|
||||
// return value
|
||||
if( isset($row['value'][ $row['i'] ][ $selector ]) ) {
|
||||
|
||||
return $row['value'][ $row['i'] ][ $selector ];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* reset_rows
|
||||
*
|
||||
|
|
@ -682,15 +769,11 @@ function get_sub_field( $selector, $format_value = true ) {
|
|||
|
||||
|
||||
// bail early if no row
|
||||
if( !$row ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !$row ) return null;
|
||||
|
||||
|
||||
// attempt to find sub field
|
||||
$sub_field = acf_get_sub_field($selector, $row['field']);
|
||||
$sub_field = get_row_sub_field( $selector );
|
||||
|
||||
|
||||
// update selector
|
||||
|
|
@ -705,16 +788,14 @@ function get_sub_field( $selector, $format_value = true ) {
|
|||
}
|
||||
|
||||
|
||||
// return value
|
||||
if( isset($row['value'][ $row['i'] ][ $selector ]) ) {
|
||||
|
||||
// get
|
||||
$value = $row['value'][ $row['i'] ][ $selector ];
|
||||
// load value
|
||||
$value = get_row_sub_value( $selector );
|
||||
|
||||
|
||||
// format
|
||||
// format value
|
||||
if( $format_value ) {
|
||||
|
||||
// get value for field
|
||||
$value = acf_format_value( $value, $row['post_id'], $sub_field );
|
||||
|
||||
}
|
||||
|
|
@ -726,11 +807,6 @@ function get_sub_field( $selector, $format_value = true ) {
|
|||
}
|
||||
|
||||
|
||||
// return false
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* the_sub_field()
|
||||
*
|
||||
|
|
@ -778,33 +854,26 @@ function get_sub_field_object( $selector, $format_value = true, $load_value = tr
|
|||
|
||||
|
||||
// bail early if no row
|
||||
if( !$row ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !$row ) return false;
|
||||
|
||||
|
||||
// vars
|
||||
$parent = $row['field'];
|
||||
|
||||
|
||||
// get sub field
|
||||
$sub_field = acf_get_sub_field( $selector, $parent );
|
||||
// attempt to find sub field
|
||||
$sub_field = get_row_sub_field($selector);
|
||||
|
||||
|
||||
// bail early if no sub field
|
||||
if( !$sub_field ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !$sub_field ) return false;
|
||||
|
||||
|
||||
// load value
|
||||
if( $load_value ) {
|
||||
$sub_field['value'] = get_row_sub_value( $sub_field['key'] );
|
||||
|
||||
$sub_field['value'] = get_sub_field( $sub_field['name'], $format_value );
|
||||
|
||||
// format value
|
||||
if( $format_value ) {
|
||||
|
||||
// get value for field
|
||||
$sub_field['value'] = acf_format_value( $sub_field['value'], $row['post_id'], $sub_field );
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1431,26 +1500,21 @@ function update_sub_field( $selector, $value, $post_id = false ) {
|
|||
$post_id = $row['post_id'];
|
||||
|
||||
|
||||
// get sub field
|
||||
$field = get_sub_field_object( $selector, false, false );
|
||||
// attempt to find sub field
|
||||
$field = get_row_sub_field($selector);
|
||||
|
||||
|
||||
// create dummy field
|
||||
if( !$field ) {
|
||||
|
||||
$field = acf_get_valid_field(array(
|
||||
'name' => $selector,
|
||||
'name' => "{$row['name']}_{$row['i']}_{$selector}",
|
||||
'key' => '',
|
||||
'type' => '',
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update name
|
||||
$field['name'] = "{$row['name']}_{$row['i']}_{$field['name']}";
|
||||
|
||||
|
||||
} elseif( is_array($selector) ) {
|
||||
|
||||
// validate
|
||||
|
|
|
|||
|
|
@ -263,8 +263,8 @@ function acf_update_option( $option = '', $value = '', $autoload = null ) {
|
|||
|
||||
|
||||
// for some reason, update_option does not use stripslashes_deep.
|
||||
// update_metadata -> http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/meta.php#L82: line 101 (does use stripslashes_deep)
|
||||
// update_option -> http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/option.php#L0: line 215 (does not use stripslashes_deep)
|
||||
// update_metadata -> https://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/meta.php#L82: line 101 (does use stripslashes_deep)
|
||||
// update_option -> https://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/option.php#L0: line 215 (does not use stripslashes_deep)
|
||||
$value = stripslashes_deep($value);
|
||||
|
||||
|
||||
|
|
@ -302,15 +302,14 @@ function acf_update_option( $option = '', $value = '', $autoload = null ) {
|
|||
|
||||
function acf_get_value( $post_id = 0, $field ) {
|
||||
|
||||
// try cache
|
||||
// cache
|
||||
$found = false;
|
||||
$cache = wp_cache_get( "load_value/post_id={$post_id}/name={$field['name']}", 'acf', false, $found );
|
||||
$cache_slug = "load_value/post_id={$post_id}/name={$field['name']}";
|
||||
$cache = wp_cache_get($cache_slug, 'acf', false, $found);
|
||||
|
||||
if( $found ) {
|
||||
|
||||
return $cache;
|
||||
|
||||
}
|
||||
// return cache if found
|
||||
if( $found ) return $cache;
|
||||
|
||||
|
||||
// load value
|
||||
|
|
@ -332,12 +331,12 @@ function acf_get_value( $post_id = 0, $field ) {
|
|||
// filter for 3rd party customization
|
||||
$value = apply_filters( "acf/load_value", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/type={$field['type']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/name={$field['name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/name={$field['_name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/load_value/key={$field['key']}", $value, $post_id, $field );
|
||||
|
||||
|
||||
// update cache
|
||||
wp_cache_set( "load_value/post_id={$post_id}/name={$field['name']}", $value, 'acf' );
|
||||
wp_cache_set($cache_slug, $value, 'acf');
|
||||
|
||||
|
||||
// return
|
||||
|
|
@ -363,13 +362,27 @@ function acf_get_value( $post_id = 0, $field ) {
|
|||
|
||||
function acf_format_value( $value, $post_id, $field ) {
|
||||
|
||||
// try cache
|
||||
$found = false;
|
||||
$cache_slug = "format_value/post_id={$post_id}/name={$field['name']}";
|
||||
$cache = wp_cache_get($cache_slug, 'acf', false, $found);
|
||||
|
||||
|
||||
// return cache if found
|
||||
if( $found ) return $cache;
|
||||
|
||||
|
||||
// apply filters
|
||||
$value = apply_filters( "acf/format_value", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/type={$field['type']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/name={$field['name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/name={$field['_name']}", $value, $post_id, $field );
|
||||
$value = apply_filters( "acf/format_value/key={$field['key']}", $value, $post_id, $field );
|
||||
|
||||
|
||||
// update cache
|
||||
wp_cache_set($cache_slug, $value, 'acf');
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ img.acf-fw {
|
|||
color: #fff;
|
||||
padding: 5px 15px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
z-index: 999999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.acf-tooltip.top {
|
||||
|
|
@ -757,15 +757,31 @@ a.acf-icon.-cancel.grey:hover {
|
|||
/* columns (replicate post edit layout) */
|
||||
.acf-columns-2 {
|
||||
margin-right: 300px;
|
||||
clear: both;
|
||||
/* rtl */
|
||||
}
|
||||
html[dir="rtl"] .acf-columns-2 {
|
||||
margin-right: 0;
|
||||
margin-left: 300px;
|
||||
}
|
||||
.acf-columns-2 .acf-column-1 {
|
||||
float: left;
|
||||
width: 100%;
|
||||
/* rtl */
|
||||
}
|
||||
html[dir="rtl"] .acf-columns-2 .acf-column-1 {
|
||||
float: right;
|
||||
}
|
||||
.acf-columns-2 .acf-column-2 {
|
||||
float: right;
|
||||
margin-right: -300px;
|
||||
width: 280px;
|
||||
/* rtl */
|
||||
}
|
||||
html[dir="rtl"] .acf-columns-2 .acf-column-2 {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: -300px;
|
||||
}
|
||||
.acf-clear {
|
||||
clear: both;
|
||||
|
|
@ -1111,7 +1127,7 @@ html[dir="rtl"] .acf-table > tbody > tr > td.order + td {
|
|||
[class^="acf-sprite-"],
|
||||
[class*=" acf-sprite-"] {
|
||||
background-image: url(../images/sprite@2x.png);
|
||||
background-size: 500px 500px;
|
||||
background-size: 250px 250px;
|
||||
}
|
||||
.acf-loading,
|
||||
.acf-spinner {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -999,35 +999,21 @@ class acf_location {
|
|||
|
||||
|
||||
// validate
|
||||
if( ! $attachment ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !$attachment ) return false;
|
||||
|
||||
|
||||
// compare
|
||||
if( $rule['operator'] == "==" ) {
|
||||
// match
|
||||
$match = ( $attachment === $rule['value'] );
|
||||
|
||||
$match = ( $attachment == $rule['value'] );
|
||||
|
||||
// override for "all"
|
||||
if( $rule['value'] == "all" ) {
|
||||
if( $rule['value'] == "all" ) $match = true;
|
||||
|
||||
$match = true;
|
||||
|
||||
}
|
||||
// reverse if 'not equal to'
|
||||
if( $rule['operator'] === '!=' ) {
|
||||
|
||||
} elseif( $rule['operator'] == "!=" ) {
|
||||
|
||||
$match = ( $attachment != $rule['value'] );
|
||||
|
||||
// override for "all"
|
||||
if( $rule['value'] == "all" ) {
|
||||
|
||||
$match = false;
|
||||
|
||||
}
|
||||
$match = !$match;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1106,35 +1092,21 @@ class acf_location {
|
|||
|
||||
|
||||
// validate
|
||||
if( ! $widget ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !$widget ) return false;
|
||||
|
||||
|
||||
// compare
|
||||
if( $rule['operator'] == "==" ) {
|
||||
// match
|
||||
$match = ( $widget === $rule['value'] );
|
||||
|
||||
$match = ( $widget == $rule['value'] );
|
||||
|
||||
// override for "all"
|
||||
if( $rule['value'] == "all" ) {
|
||||
if( $rule['value'] == "all" ) $match = true;
|
||||
|
||||
$match = true;
|
||||
|
||||
}
|
||||
// reverse if 'not equal to'
|
||||
if( $rule['operator'] === '!=' ) {
|
||||
|
||||
} elseif( $rule['operator'] == "!=" ) {
|
||||
|
||||
$match = ( $widget != $rule['value'] );
|
||||
|
||||
// override for "all"
|
||||
if( $rule['value'] == "all" ) {
|
||||
|
||||
$match = false;
|
||||
|
||||
}
|
||||
$match = !$match;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class acf_media {
|
|||
|
||||
// filters
|
||||
add_filter('wp_handle_upload_prefilter', array($this, 'handle_upload_prefilter'), 10, 1);
|
||||
add_filter('acf/input/admin_l10n', array($this, 'acf_input_admin_l10n'), 10, 1);
|
||||
|
||||
|
||||
// ajax
|
||||
|
|
@ -33,6 +34,37 @@ class acf_media {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* acf_input_admin_l10n
|
||||
*
|
||||
* This function will append l10n strings for JS use
|
||||
*
|
||||
* @type function
|
||||
* @date 11/04/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function acf_input_admin_l10n( $l10n ) {
|
||||
|
||||
// append
|
||||
$l10n['media'] = array(
|
||||
'select' => __("Select",'acf'),
|
||||
'edit' => __("Edit",'acf'),
|
||||
'update' => __("Update",'acf'),
|
||||
'uploadedTo' => __("Uploaded to this post",'acf'),
|
||||
'default_icon' => wp_mime_type_icon()
|
||||
);
|
||||
|
||||
|
||||
// return
|
||||
return $l10n;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* handle_upload_prefilter
|
||||
*
|
||||
|
|
|
|||
|
|
@ -70,10 +70,7 @@ class acf_field_checkbox extends acf_field {
|
|||
|
||||
|
||||
// hiden input
|
||||
acf_hidden_input(array(
|
||||
'type' => 'hidden',
|
||||
'name' => $field['name'],
|
||||
));
|
||||
acf_hidden_input( array('name' => $field['name']) );
|
||||
|
||||
|
||||
// vars
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ class acf_field_file extends acf_field {
|
|||
$o = array(
|
||||
'icon' => '',
|
||||
'title' => '',
|
||||
'size' => '',
|
||||
'url' => '',
|
||||
'name' => '',
|
||||
'filesize' => '',
|
||||
'filename' => '',
|
||||
);
|
||||
|
||||
$div = array(
|
||||
|
|
@ -104,22 +104,28 @@ class acf_field_file extends acf_field {
|
|||
);
|
||||
|
||||
|
||||
// has value
|
||||
if( $field['value'] && is_numeric($field['value']) ) {
|
||||
// has value?
|
||||
if( $field['value'] ) {
|
||||
|
||||
$file = get_post( $field['value'] );
|
||||
|
||||
if( $file ) {
|
||||
|
||||
$div['class'] .= ' has-value';
|
||||
|
||||
$o['icon'] = wp_mime_type_icon( $file->ID );
|
||||
$o['title'] = $file->post_title;
|
||||
$o['size'] = @size_format(filesize( get_attached_file( $file->ID ) ));
|
||||
$o['filesize'] = @size_format(filesize( get_attached_file( $file->ID ) ));
|
||||
$o['url'] = wp_get_attachment_url( $file->ID );
|
||||
|
||||
$explode = explode('/', $o['url']);
|
||||
$o['name'] = end( $explode );
|
||||
$o['filename'] = end( $explode );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// url exists
|
||||
if( $o['url'] ) {
|
||||
|
||||
$div['class'] .= ' has-value';
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -140,11 +146,11 @@ class acf_field_file extends acf_field {
|
|||
</p>
|
||||
<p>
|
||||
<strong><?php _e('File name', 'acf'); ?>:</strong>
|
||||
<a data-name="name" href="<?php echo $o['url']; ?>" target="_blank"><?php echo $o['name']; ?></a>
|
||||
<a data-name="filename" href="<?php echo $o['url']; ?>" target="_blank"><?php echo $o['filename']; ?></a>
|
||||
</p>
|
||||
<p>
|
||||
<strong><?php _e('File size', 'acf'); ?>:</strong>
|
||||
<span data-name="size"><?php echo $o['size']; ?></span>
|
||||
<span data-name="filesize"><?php echo $o['filesize']; ?></span>
|
||||
</p>
|
||||
|
||||
<ul class="acf-hl acf-soh-target">
|
||||
|
|
@ -290,19 +296,11 @@ class acf_field_file extends acf_field {
|
|||
function format_value( $value, $post_id, $field ) {
|
||||
|
||||
// bail early if no value
|
||||
if( empty($value) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( empty($value) ) return false;
|
||||
|
||||
|
||||
// bail early if not numeric (error message)
|
||||
if( !is_numeric($value) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !is_numeric($value) ) return false;
|
||||
|
||||
|
||||
// convert to int
|
||||
|
|
@ -364,24 +362,21 @@ class acf_field_file extends acf_field {
|
|||
|
||||
function update_value( $value, $post_id, $field ) {
|
||||
|
||||
// numeric
|
||||
if( is_numeric($value) ) return $value;
|
||||
|
||||
|
||||
// array?
|
||||
if( is_array($value) && isset($value['ID']) ) {
|
||||
|
||||
return $value['ID'];
|
||||
|
||||
}
|
||||
if( is_array($value) && isset($value['ID']) ) return $value['ID'];
|
||||
|
||||
|
||||
// object?
|
||||
if( is_object($value) && isset($value->ID) ) {
|
||||
|
||||
return $value->ID;
|
||||
|
||||
}
|
||||
if( is_object($value) && isset($value->ID) ) return $value->ID;
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class acf_field_image extends acf_field {
|
|||
|
||||
|
||||
// has value?
|
||||
if( $field['value'] && is_numeric($field['value']) ) {
|
||||
if( $field['value'] ) {
|
||||
|
||||
// update vars
|
||||
$url = wp_get_attachment_image_src($field['value'], $field['preview_size']);
|
||||
|
|
@ -114,9 +114,11 @@ class acf_field_image extends acf_field {
|
|||
|
||||
|
||||
// url exists
|
||||
if( $url ) {
|
||||
if( $url ) $url = $url[0];
|
||||
|
||||
$url = $url[0];
|
||||
|
||||
// url exists
|
||||
if( $url ) {
|
||||
|
||||
$div['class'] .= ' has-value';
|
||||
|
||||
|
|
@ -124,18 +126,22 @@ class acf_field_image extends acf_field {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// get size of preview value
|
||||
$size = acf_get_image_size($field['preview_size']);
|
||||
|
||||
?>
|
||||
<div <?php acf_esc_attr_e( $div ); ?>>
|
||||
<div class="acf-hidden">
|
||||
<?php acf_hidden_input(array( 'name' => $field['name'], 'value' => $field['value'], 'data-name' => 'id' )); ?>
|
||||
<?php acf_hidden_input(array( 'name' => $field['name'], 'value' => $field['value'] )); ?>
|
||||
</div>
|
||||
<div class="view show-if-value acf-soh">
|
||||
<div class="view show-if-value acf-soh" <?php if( $size['width'] ) echo 'style="max-width: '.$size['width'].'px"'; ?>>
|
||||
<img data-name="image" src="<?php echo $url; ?>" alt="<?php echo $alt; ?>"/>
|
||||
<ul class="acf-hl acf-soh-target">
|
||||
<?php if( $uploader != 'basic' ): ?>
|
||||
<li><a class="acf-icon -pencil dark" data-name="edit" href="#"></a></li>
|
||||
<li><a class="acf-icon -pencil dark" data-name="edit" href="#" title="<?php _e('Edit', 'acf'); ?>"></a></li>
|
||||
<?php endif; ?>
|
||||
<li><a class="acf-icon -cancel dark" data-name="remove" href="#"></a></li>
|
||||
<li><a class="acf-icon -cancel dark" data-name="remove" href="#" title="<?php _e('Remove', 'acf'); ?>"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="view hide-if-value">
|
||||
|
|
@ -330,19 +336,11 @@ class acf_field_image extends acf_field {
|
|||
function format_value( $value, $post_id, $field ) {
|
||||
|
||||
// bail early if no value
|
||||
if( empty($value) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( empty($value) ) return false;
|
||||
|
||||
|
||||
// bail early if not numeric (error message)
|
||||
if( !is_numeric($value) ) {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
if( !is_numeric($value) ) return false;
|
||||
|
||||
|
||||
// convert to int
|
||||
|
|
@ -388,38 +386,6 @@ class acf_field_image extends acf_field {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* image_size_names_choose
|
||||
*
|
||||
* @description:
|
||||
* @since: 3.5.7
|
||||
* @created: 13/01/13
|
||||
*/
|
||||
|
||||
/*
|
||||
function image_size_names_choose( $sizes )
|
||||
{
|
||||
global $_wp_additional_image_sizes;
|
||||
|
||||
if( $_wp_additional_image_sizes )
|
||||
{
|
||||
foreach( $_wp_additional_image_sizes as $k => $v )
|
||||
{
|
||||
$title = $k;
|
||||
$title = str_replace('-', ' ', $title);
|
||||
$title = str_replace('_', ' ', $title);
|
||||
$title = ucwords( $title );
|
||||
|
||||
$sizes[ $k ] = $title;
|
||||
}
|
||||
// foreach( $image_sizes as $image_size )
|
||||
}
|
||||
|
||||
return $sizes;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* wp_prepare_attachment_for_js
|
||||
*
|
||||
|
|
@ -497,26 +463,22 @@ function image_size_names_choose( $sizes )
|
|||
|
||||
function update_value( $value, $post_id, $field ) {
|
||||
|
||||
// numeric
|
||||
if( is_numeric($value) ) return $value;
|
||||
|
||||
|
||||
// array?
|
||||
if( is_array($value) && isset($value['ID']) ) {
|
||||
|
||||
return $value['ID'];
|
||||
|
||||
}
|
||||
if( is_array($value) && isset($value['ID']) ) return $value['ID'];
|
||||
|
||||
|
||||
// object?
|
||||
if( is_object($value) && isset($value->ID) ) {
|
||||
|
||||
return $value->ID;
|
||||
|
||||
}
|
||||
if( is_object($value) && isset($value->ID) ) return $value->ID;
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
123
fields/radio.php
123
fields/radio.php
|
|
@ -41,6 +41,7 @@ class acf_field_radio extends acf_field {
|
|||
'default_value' => '',
|
||||
'other_choice' => 0,
|
||||
'save_other_choice' => 0,
|
||||
'allow_null' => 0
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -69,16 +70,49 @@ class acf_field_radio extends acf_field {
|
|||
|
||||
// vars
|
||||
$i = 0;
|
||||
$checked = false;
|
||||
$e = '';
|
||||
$ul = array(
|
||||
'class' => 'acf-radio-list',
|
||||
'data-allow_null' => $field['allow_null'],
|
||||
'data-other_choice' => $field['other_choice']
|
||||
);
|
||||
|
||||
|
||||
// class
|
||||
$field['class'] .= ' acf-radio-list';
|
||||
$field['class'] .= ($field['layout'] == 'horizontal') ? ' acf-hl' : ' acf-bl';
|
||||
// append to class
|
||||
$ul['class'] .= ' ' . ($field['layout'] == 'horizontal' ? 'acf-hl' : 'acf-bl');
|
||||
$ul['class'] .= ' ' . $field['class'];
|
||||
|
||||
|
||||
// e
|
||||
$e = '<ul ' . acf_esc_attr(array( 'class' => $field['class'] )) . '>';
|
||||
// select value
|
||||
$checked = '';
|
||||
$value = strval($field['value']);
|
||||
|
||||
|
||||
// selected choice
|
||||
if( isset($field['choices'][ $value ]) ) {
|
||||
|
||||
$checked = $value;
|
||||
|
||||
// custom choice
|
||||
} elseif( $field['other_choice'] && $value !== '' ) {
|
||||
|
||||
$checked = 'other';
|
||||
|
||||
// allow null
|
||||
} elseif( $field['allow_null'] ) {
|
||||
|
||||
// do nothing
|
||||
|
||||
// select first input by default
|
||||
} else {
|
||||
|
||||
$checked = key($field['choices']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ensure $checked is a string (could be an int)
|
||||
$checked = strval($checked);
|
||||
|
||||
|
||||
// other choice
|
||||
|
|
@ -94,34 +128,40 @@ class acf_field_radio extends acf_field {
|
|||
|
||||
|
||||
// select other choice if value is not a valid choice
|
||||
if( !isset($field['choices'][ $field['value'] ]) ) {
|
||||
if( $checked === 'other' ) {
|
||||
|
||||
unset($input['disabled']);
|
||||
$input['value'] = $field['value'];
|
||||
$field['value'] = 'other';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// append other choice
|
||||
$field['choices']['other'] = '</label><input type="text" ' . acf_esc_attr($input) . ' /><label>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// require choices
|
||||
if( !empty($field['choices']) ) {
|
||||
// bail early if no choices
|
||||
if( empty($field['choices']) ) return;
|
||||
|
||||
// select first choice if value is not a valid choice
|
||||
if( !isset($field['choices'][ $field['value'] ]) ) {
|
||||
|
||||
$field['value'] = key($field['choices']);
|
||||
// hiden input
|
||||
$e .= acf_get_hidden_input( array('name' => $field['name']) );
|
||||
|
||||
}
|
||||
|
||||
// open
|
||||
$e .= '<ul ' . acf_esc_attr($ul) . '>';
|
||||
|
||||
|
||||
// foreach choices
|
||||
foreach( $field['choices'] as $value => $label ) {
|
||||
|
||||
// ensure value is a string
|
||||
$value = strval($value);
|
||||
$class = '';
|
||||
|
||||
|
||||
// increase counter
|
||||
$i++;
|
||||
|
||||
|
|
@ -131,17 +171,20 @@ class acf_field_radio extends acf_field {
|
|||
'type' => 'radio',
|
||||
'id' => $field['id'],
|
||||
'name' => $field['name'],
|
||||
'value' => $value,
|
||||
'value' => $value
|
||||
);
|
||||
|
||||
|
||||
if( strval($value) === strval($field['value']) ) {
|
||||
// checked
|
||||
if( $value === $checked ) {
|
||||
|
||||
$atts['checked'] = 'checked';
|
||||
$checked = true;
|
||||
$class = ' class="selected"';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// deisabled
|
||||
if( isset($field['disabled']) && acf_in_array($value, $field['disabled']) ) {
|
||||
|
||||
$atts['disabled'] = 'disabled';
|
||||
|
|
@ -149,21 +192,25 @@ class acf_field_radio extends acf_field {
|
|||
}
|
||||
|
||||
|
||||
// each input ID is generated with the $key, however, the first input must not use $key so that it matches the field's label for attribute
|
||||
// id (use crounter for each input)
|
||||
if( $i > 1 ) {
|
||||
|
||||
$atts['id'] .= '-' . $value;
|
||||
|
||||
}
|
||||
|
||||
$e .= '<li><label><input ' . acf_esc_attr( $atts ) . '/>' . $label . '</label></li>';
|
||||
}
|
||||
|
||||
// append
|
||||
$e .= '<li><label' . $class . '><input ' . acf_esc_attr( $atts ) . '/>' . $label . '</label></li>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// close
|
||||
$e .= '</ul>';
|
||||
|
||||
|
||||
// return
|
||||
echo $e;
|
||||
|
||||
}
|
||||
|
|
@ -197,6 +244,20 @@ class acf_field_radio extends acf_field {
|
|||
));
|
||||
|
||||
|
||||
// allow_null
|
||||
acf_render_field_setting( $field, array(
|
||||
'label' => __('Allow Null?','acf'),
|
||||
'instructions' => '',
|
||||
'type' => 'radio',
|
||||
'name' => 'allow_null',
|
||||
'choices' => array(
|
||||
1 => __("Yes",'acf'),
|
||||
0 => __("No",'acf'),
|
||||
),
|
||||
'layout' => 'horizontal',
|
||||
));
|
||||
|
||||
|
||||
// other_choice
|
||||
acf_render_field_setting( $field, array(
|
||||
'label' => __('Other','acf'),
|
||||
|
|
@ -288,26 +349,24 @@ class acf_field_radio extends acf_field {
|
|||
|
||||
function update_value( $value, $post_id, $field ) {
|
||||
|
||||
// bail early if no value (allow 0 to be saved)
|
||||
if( !$value && !is_numeric($value) ) return $value;
|
||||
|
||||
|
||||
// save_other_choice
|
||||
if( $field['save_other_choice'] ) {
|
||||
|
||||
// value isn't in choices yet
|
||||
if( !isset($field['choices'][ $value ]) ) {
|
||||
|
||||
// get ID if local
|
||||
if( !$field['ID'] ) {
|
||||
|
||||
$field = acf_get_field( $field['key'], true );
|
||||
|
||||
}
|
||||
// get raw $field (may have been changed via repeater field)
|
||||
// if field is local, it won't have an ID
|
||||
$selector = $field['ID'] ? $field['ID'] : $field['key'];
|
||||
$field = acf_get_field( $selector, true );
|
||||
|
||||
|
||||
// bail early if no ID
|
||||
if( !$field['ID'] ) {
|
||||
|
||||
return $value;
|
||||
|
||||
}
|
||||
// bail early if no ID (JSON only)
|
||||
if( !$field['ID'] ) return $value;
|
||||
|
||||
|
||||
// update $field
|
||||
|
|
|
|||
|
|
@ -322,22 +322,25 @@ class acf_field_relationship extends acf_field {
|
|||
// elements
|
||||
if( !empty($field['elements']) ) {
|
||||
|
||||
// featured_image
|
||||
if( in_array('featured_image', $field['elements']) ) {
|
||||
|
||||
$image = '';
|
||||
// vars
|
||||
$class = 'thumbnail';
|
||||
$thumbnail = acf_get_post_thumbnail($post->ID, array(17, 17));
|
||||
|
||||
if( $post->post_type == 'attachment' ) {
|
||||
|
||||
$image = wp_get_attachment_image( $post->ID, array(17, 17) );
|
||||
// icon
|
||||
if( $thumbnail['type'] == 'icon' ) {
|
||||
|
||||
} else {
|
||||
|
||||
$image = get_the_post_thumbnail( $post->ID, array(17, 17) );
|
||||
$class .= ' -' . $thumbnail['type'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
$title = '<div class="thumbnail">' . $image . '</div>' . $title;
|
||||
// append
|
||||
$title = '<div class="' . $class . '">' . $thumbnail['html'] . '</div>' . $title;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,16 @@ class acf_form_attachment {
|
|||
'ajax' => 1
|
||||
));
|
||||
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
// WP saves attachment on any input change, so unload is not needed
|
||||
acf.unload.active = 0;
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -160,7 +170,7 @@ class acf_form_attachment {
|
|||
$el = 'tr';
|
||||
$post_id = $post->ID;
|
||||
$args = array(
|
||||
'attachment' => 'All'
|
||||
'attachment' => $post_id
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,10 @@ class acf_form_comment {
|
|||
|
||||
|
||||
// render
|
||||
add_action( 'comment_form_logged_in_after', array( $this, 'add_comment') );
|
||||
add_action( 'comment_form_after_fields', array( $this, 'add_comment') );
|
||||
add_filter('comment_form_field_comment', array($this, 'comment_form_field_comment'), 999, 1);
|
||||
|
||||
//add_action( 'comment_form_logged_in_after', array( $this, 'add_comment') );
|
||||
//add_action( 'comment_form', array( $this, 'add_comment') );
|
||||
|
||||
|
||||
// save
|
||||
|
|
@ -158,9 +160,21 @@ class acf_form_comment {
|
|||
$o = array(
|
||||
'id' => 'acf-'.$field_group['ID'],
|
||||
'key' => $field_group['key'],
|
||||
'label' => $field_group['label_placement']
|
||||
//'style' => $field_group['style'],
|
||||
'label' => $field_group['label_placement'],
|
||||
'edit_url' => '',
|
||||
'edit_title' => __('Edit field group', 'acf'),
|
||||
//'visibility' => $visibility
|
||||
);
|
||||
|
||||
|
||||
// edit_url
|
||||
if( $field_group['ID'] && acf_current_user_can_admin() ) {
|
||||
|
||||
$o['edit_url'] = admin_url('post.php?post=' . $field_group['ID'] . '&action=edit');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="acf-<?php echo $field_group['ID']; ?>" class="stuffbox">
|
||||
<h3 class="hndle"><?php echo $field_group['title']; ?></h3>
|
||||
|
|
@ -185,26 +199,26 @@ class acf_form_comment {
|
|||
|
||||
|
||||
/*
|
||||
* add_comment
|
||||
* comment_form_field_comment
|
||||
*
|
||||
* This function will add fields to the front end comment form
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 19/10/13
|
||||
* @since 5.0.0
|
||||
* @date 18/04/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param n/a
|
||||
* @return n/a
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function add_comment() {
|
||||
function comment_form_field_comment( $html ) {
|
||||
|
||||
// global
|
||||
global $post;
|
||||
|
||||
|
||||
// vars
|
||||
$post_id = "comment_0";
|
||||
$post_id = false;
|
||||
|
||||
|
||||
// get field groups
|
||||
|
|
@ -213,7 +227,12 @@ class acf_form_comment {
|
|||
));
|
||||
|
||||
|
||||
if( !empty($field_groups) ) {
|
||||
// bail early if no field groups
|
||||
if( !$field_groups ) return $html;
|
||||
|
||||
|
||||
// ob
|
||||
ob_start();
|
||||
|
||||
// render post data
|
||||
acf_form_data(array(
|
||||
|
|
@ -226,15 +245,18 @@ class acf_form_comment {
|
|||
|
||||
$fields = acf_get_fields( $field_group );
|
||||
|
||||
?>
|
||||
<div class="acf-fields -<?php echo $field_group['label_placement']; ?>">
|
||||
<?php acf_render_fields( $post_id, $fields, 'div', $field_group['instruction_placement'] ); ?>
|
||||
</div>
|
||||
<?php
|
||||
acf_render_fields( $post_id, $fields, 'p', $field_group['instruction_placement'] );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// append
|
||||
$html .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
// return
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class acf_form_taxonomy {
|
|||
|
||||
?>
|
||||
<?php if( $field_group['style'] == 'default' ): ?>
|
||||
<h3><?php echo $field_group['title']; ?></h3>
|
||||
<h2><?php echo $field_group['title']; ?></h2>
|
||||
<?php endif; ?>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ class acf_form_user {
|
|||
// title
|
||||
if( $show_title && $field_group['style'] === 'default' ) {
|
||||
|
||||
echo '<h3>' . $field_group['title'] . '</h3>';
|
||||
echo '<h2>' . $field_group['title'] . '</h2>';
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
127
forms/widget.php
127
forms/widget.php
|
|
@ -32,6 +32,7 @@ class acf_form_widget {
|
|||
|
||||
// vars
|
||||
$this->preview_values = array();
|
||||
$this->preview_reference = array();
|
||||
$this->preview_errors = array();
|
||||
|
||||
|
||||
|
|
@ -173,11 +174,15 @@ class acf_form_widget {
|
|||
|
||||
function widget_update_callback( $instance, $new_instance, $old_instance, $widget ) {
|
||||
|
||||
// bail early if empty
|
||||
if( empty($_POST['acf']) ) return $instance;
|
||||
|
||||
|
||||
// bail early if no nonce
|
||||
if( !acf_verify_nonce('widget') ) return $instance;
|
||||
|
||||
|
||||
// customizer
|
||||
// customizer autosave preview
|
||||
if( !empty($_POST['wp_customize']) ) {
|
||||
|
||||
return $this->customizer_widget_update_callback($instance, $new_instance, $old_instance, $widget);
|
||||
|
|
@ -217,15 +222,6 @@ class acf_form_widget {
|
|||
|
||||
function customizer_widget_update_callback( $instance, $new_instance, $old_instance, $widget ) {
|
||||
|
||||
// add preview_values reference for later use in load_value filter
|
||||
// WP will re-generate the widget form HTML, and we need to load the $_POST data, not the DB data
|
||||
$this->preview_values[ "widget_{$widget->id}" ] = $_POST['acf'];
|
||||
|
||||
|
||||
// add filter
|
||||
add_filter('acf/load_value', array($this, 'load_value'), 10, 3);
|
||||
|
||||
|
||||
// bail early if not valid
|
||||
if( !acf_validate_save_post() ) {
|
||||
|
||||
|
|
@ -256,9 +252,34 @@ class acf_form_widget {
|
|||
|
||||
} else {
|
||||
|
||||
$instance['acf'] = array(
|
||||
'ID' => 'widget_' . $widget->id,
|
||||
'values' => false,
|
||||
'reference' => array()
|
||||
);
|
||||
|
||||
|
||||
// append acf $_POST data to instance
|
||||
// this allows preview JS data to contain acf values
|
||||
$instance['acf'] = $_POST['acf'];
|
||||
$instance['acf']['values'] = $_POST['acf'];
|
||||
|
||||
|
||||
// backup name => key reference
|
||||
// this will allow the customizer preview to correctly load the field when attempting to run acf_load_value and acf_format_value functions on newly added widgets
|
||||
foreach( $_POST['acf'] as $k => $v ) {
|
||||
|
||||
// get field
|
||||
$field = acf_get_field( $k );
|
||||
|
||||
|
||||
// continue if no field
|
||||
if( !$field ) continue;
|
||||
|
||||
|
||||
// update
|
||||
$instance['acf']['reference'][ $field['name'] ] = $field['key'];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -308,12 +329,8 @@ class acf_form_widget {
|
|||
$value = $setting->post_value();
|
||||
|
||||
|
||||
// get id from widget_text[2] to widget_text-2
|
||||
$setting->acf_id = str_replace(array('[', ']'), array('-', ''), $setting->id);
|
||||
|
||||
|
||||
// get acf value
|
||||
$setting->acf_value = acf_maybe_get($value, 'acf');
|
||||
// set data
|
||||
$setting->acf = acf_maybe_get($value, 'acf');
|
||||
|
||||
|
||||
// append
|
||||
|
|
@ -358,12 +375,13 @@ class acf_form_widget {
|
|||
// append values
|
||||
foreach( $widgets as $widget ) {
|
||||
|
||||
// bail early if no acf_value
|
||||
if( !$widget->acf_value ) continue;
|
||||
// bail early if no acf
|
||||
if( empty($widget->acf) ) continue;
|
||||
|
||||
|
||||
// append acf_value to preview_values
|
||||
$this->preview_values[ $widget->acf_id ] = $widget->acf_value;
|
||||
$this->preview_values[ $widget->acf['ID'] ] = $widget->acf['values'];
|
||||
$this->preview_reference[ $widget->acf['ID'] ] = $widget->acf['reference'];
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -374,6 +392,39 @@ class acf_form_widget {
|
|||
|
||||
// add filter
|
||||
add_filter('acf/load_value', array($this, 'load_value'), 10, 3);
|
||||
add_filter('acf/get_field_reference', array($this, 'get_field_reference'), 10, 3);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_field_reference
|
||||
*
|
||||
* This function will return a field_key for a given field name + post_id
|
||||
* Normally, ACF would lookup the DB fro this connection, but a new preview widget has not yet saved anything to the DB
|
||||
*
|
||||
* @type function
|
||||
* @date 12/05/2016
|
||||
* @since 5.3.8
|
||||
*
|
||||
* @param $field_key (string)
|
||||
* @param $field_name (string)
|
||||
* @param $post_id (mixed)
|
||||
* @return $field_key
|
||||
*/
|
||||
|
||||
function get_field_reference( $field_key, $field_name, $post_id ) {
|
||||
|
||||
// look for reference
|
||||
if( isset($this->preview_reference[ $post_id ][ $field_name ]) ) {
|
||||
|
||||
$field_key = $this->preview_reference[ $post_id ][ $field_name ];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $field_key;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -393,10 +444,21 @@ class acf_form_widget {
|
|||
|
||||
function load_value( $value, $post_id, $field ) {
|
||||
|
||||
// acf/load_value filter is run first (before type, name, key)
|
||||
// use this filter to append to the key filter and ensure this is run last
|
||||
// could use set_cache in the future to remove this load_filter completley
|
||||
// but don't want to clog up cache with multiple widget's values
|
||||
|
||||
|
||||
// look for value
|
||||
if( isset($this->preview_values[ $post_id ][ $field['key'] ]) ) {
|
||||
|
||||
$value = $this->preview_values[ $post_id ][ $field['key'] ];
|
||||
// add filter to override the $value
|
||||
add_filter('acf/load_value/key='.$field['key'], array($this, 'load_value_2'), 99, 3);
|
||||
|
||||
|
||||
// return null and prevent any DB logic from field type functions
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -407,6 +469,23 @@ class acf_form_widget {
|
|||
}
|
||||
|
||||
|
||||
function load_value_2( $value, $post_id, $field ) {
|
||||
|
||||
// look for value
|
||||
$value = $this->preview_values[ $post_id ][ $field['key'] ];
|
||||
|
||||
|
||||
// remove this filter (only run once)
|
||||
remove_filter('acf/load_value/key='.$field['key'], array($this, 'load_value_2'), 99, 3);
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* customize_save
|
||||
*
|
||||
|
|
@ -436,14 +515,14 @@ class acf_form_widget {
|
|||
foreach( $widgets as $widget ) {
|
||||
|
||||
// bail early if no acf_value
|
||||
if( !$widget->acf_value ) continue;
|
||||
if( !$widget->acf ) continue;
|
||||
|
||||
// fake post data
|
||||
$_POST['acf'] = $widget->acf_value;
|
||||
$_POST['acf'] = $widget->acf['values'];
|
||||
|
||||
|
||||
// save
|
||||
acf_save_post( $widget->acf_id );
|
||||
acf_save_post( $widget->acf['ID'] );
|
||||
|
||||
|
||||
// get widget base
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -3,15 +3,15 @@ msgstr ""
|
|||
"Project-Id-Version: Advanced Custom Fields Pro v5.2.9\n"
|
||||
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
||||
"POT-Creation-Date: 2016-04-07 10:33+1000\n"
|
||||
"PO-Revision-Date: 2016-04-07 10:33+1000\n"
|
||||
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
||||
"PO-Revision-Date: 2016-04-19 18:32+0200\n"
|
||||
"Last-Translator: Maxime BERNARD-JACQUET <maxime@smoothie-creative.com>\n"
|
||||
"Language-Team: Dysign <maxime@dysign.fr>\n"
|
||||
"Language: fr_FR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
"X-Generator: Poedit 1.8.1\n"
|
||||
"X-Generator: Poedit 1.8.6\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
|
|
@ -448,7 +448,7 @@ msgstr "Tutoriels"
|
|||
|
||||
#: admin/field-groups.php:637
|
||||
msgid "FAQ"
|
||||
msgstr ""
|
||||
msgstr "FAQ"
|
||||
|
||||
# @ acf
|
||||
#: admin/field-groups.php:642
|
||||
|
|
@ -922,7 +922,7 @@ msgstr "Sous les champs"
|
|||
# @ acf
|
||||
#: admin/views/field-group-options.php:82
|
||||
msgid "Order No."
|
||||
msgstr "Commande"
|
||||
msgstr "Numéro d’ordre"
|
||||
|
||||
#: admin/views/field-group-options.php:83
|
||||
msgid "Field groups with a lower order will appear first"
|
||||
|
|
@ -1552,9 +1552,8 @@ msgid "Content"
|
|||
msgstr "Contenu"
|
||||
|
||||
#: api/api-template.php:1281
|
||||
#, fuzzy
|
||||
msgid "Validate Email"
|
||||
msgstr "Echec de la validation"
|
||||
msgstr "Valider l’email"
|
||||
|
||||
#: core/field.php:132
|
||||
msgid "Basic"
|
||||
|
|
@ -1714,7 +1713,6 @@ msgstr "Montrer un mois différent"
|
|||
|
||||
# @ acf
|
||||
#: fields/date_picker.php:174
|
||||
#, fuzzy
|
||||
msgid "Display Format"
|
||||
msgstr "Format d'affichage"
|
||||
|
||||
|
|
@ -1801,7 +1799,6 @@ msgstr "Liés à cette publication"
|
|||
|
||||
# @ acf
|
||||
#: fields/file.php:142
|
||||
#, fuzzy
|
||||
msgid "File name"
|
||||
msgstr "Nom du fichier"
|
||||
|
||||
|
|
@ -2533,9 +2530,8 @@ msgstr "Activer votre licence"
|
|||
|
||||
# @ acf
|
||||
#: pro/admin/views/settings-updates.php:21
|
||||
#, fuzzy
|
||||
msgid "License Information"
|
||||
msgstr "Informations de mise à jour"
|
||||
msgstr "Informations sur la licence"
|
||||
|
||||
#: pro/admin/views/settings-updates.php:24
|
||||
msgid ""
|
||||
|
|
@ -2864,9 +2860,8 @@ msgstr ""
|
|||
"professionnels"
|
||||
|
||||
#. Author of the plugin/theme
|
||||
#, fuzzy
|
||||
msgid "Elliot Condon"
|
||||
msgstr "elliot condon"
|
||||
msgstr "Elliot Condon"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://www.elliotcondon.com/"
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
1380
lang/acf-pl_PL.po
1380
lang/acf-pl_PL.po
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
361
lang/acf.pot
361
lang/acf.pot
|
|
@ -3,7 +3,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Advanced Custom Fields\n"
|
||||
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
||||
"POT-Creation-Date: 2016-04-07 10:31+1000\n"
|
||||
"POT-Creation-Date: 2016-05-16 14:13+1000\n"
|
||||
"PO-Revision-Date: 2015-06-11 13:00+1000\n"
|
||||
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
||||
"Language-Team: Elliot Condon <e@elliotcondon.com>\n"
|
||||
|
|
@ -181,7 +181,7 @@ msgstr ""
|
|||
#: admin/views/field-group-field-conditional-logic.php:62
|
||||
#: admin/views/field-group-field-conditional-logic.php:162
|
||||
#: admin/views/field-group-locations.php:59
|
||||
#: admin/views/field-group-locations.php:135 api/api-helpers.php:3649
|
||||
#: admin/views/field-group-locations.php:135 api/api-helpers.php:3673
|
||||
msgid "or"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -263,8 +263,8 @@ msgstr ""
|
|||
|
||||
#: admin/field-group.php:864 admin/field-group.php:872
|
||||
#: admin/field-group.php:886 admin/field-group.php:893
|
||||
#: admin/field-group.php:910 admin/field-group.php:927 fields/file.php:235
|
||||
#: fields/image.php:231 pro/fields/gallery.php:661
|
||||
#: admin/field-group.php:910 admin/field-group.php:927 fields/file.php:241
|
||||
#: fields/image.php:237 pro/fields/gallery.php:684
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -332,14 +332,14 @@ msgstr[1] ""
|
|||
msgid "Sync available"
|
||||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:525 api/api-template.php:989
|
||||
#: api/api-template.php:1202 pro/fields/gallery.php:374
|
||||
#: admin/field-groups.php:525 api/api-template.php:1058
|
||||
#: api/api-template.php:1271 pro/fields/gallery.php:371
|
||||
msgid "Title"
|
||||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:526 admin/views/field-group-options.php:93
|
||||
#: admin/views/update-network.php:20 admin/views/update-network.php:28
|
||||
#: pro/fields/gallery.php:401
|
||||
#: pro/fields/gallery.php:398
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -353,11 +353,8 @@ msgid "Changelog"
|
|||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:625
|
||||
msgid "See what's new in"
|
||||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:625
|
||||
msgid "version"
|
||||
#, php-format
|
||||
msgid "See what's new in <a href=\"%s\">version %s</a>."
|
||||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:627
|
||||
|
|
@ -385,7 +382,7 @@ msgstr ""
|
|||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: admin/field-groups.php:634 fields/relationship.php:717
|
||||
#: admin/field-groups.php:634 fields/relationship.php:720
|
||||
msgid "Filters"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -452,7 +449,7 @@ msgstr ""
|
|||
msgid "No field groups selected"
|
||||
msgstr ""
|
||||
|
||||
#: admin/settings-tools.php:188 fields/file.php:169
|
||||
#: admin/settings-tools.php:188 fields/file.php:175
|
||||
msgid "No file selected"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -492,35 +489,47 @@ msgstr ""
|
|||
msgid "Upgrade"
|
||||
msgstr ""
|
||||
|
||||
#: admin/update.php:328
|
||||
#: admin/update.php:349
|
||||
msgid "Upgrade Database"
|
||||
msgstr ""
|
||||
|
||||
#: admin/update.php:414
|
||||
msgid "Error validating request"
|
||||
msgstr ""
|
||||
|
||||
#: admin/update.php:437 admin/views/update.php:110
|
||||
msgid "No updates available"
|
||||
msgstr ""
|
||||
|
||||
#: admin/update.php:454
|
||||
msgid "Error loading update"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field-conditional-logic.php:29
|
||||
msgid "Conditional Logic"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field-conditional-logic.php:40
|
||||
#: admin/views/field-group-field.php:140 fields/checkbox.php:246
|
||||
#: admin/views/field-group-field.php:140 fields/checkbox.php:243
|
||||
#: fields/message.php:144 fields/page_link.php:539 fields/page_link.php:553
|
||||
#: fields/post_object.php:403 fields/post_object.php:417 fields/select.php:377
|
||||
#: fields/select.php:391 fields/select.php:405 fields/select.php:419
|
||||
#: fields/tab.php:130 fields/taxonomy.php:784 fields/taxonomy.php:798
|
||||
#: fields/taxonomy.php:812 fields/taxonomy.php:826 fields/user.php:416
|
||||
#: fields/user.php:430 fields/wysiwyg.php:418
|
||||
#: fields/post_object.php:403 fields/post_object.php:417 fields/radio.php:250
|
||||
#: fields/select.php:377 fields/select.php:391 fields/select.php:405
|
||||
#: fields/select.php:419 fields/tab.php:130 fields/taxonomy.php:784
|
||||
#: fields/taxonomy.php:798 fields/taxonomy.php:812 fields/taxonomy.php:826
|
||||
#: fields/user.php:416 fields/user.php:430 fields/wysiwyg.php:418
|
||||
#: pro/admin/views/settings-updates.php:93
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field-conditional-logic.php:41
|
||||
#: admin/views/field-group-field.php:141 fields/checkbox.php:247
|
||||
#: admin/views/field-group-field.php:141 fields/checkbox.php:244
|
||||
#: fields/message.php:145 fields/page_link.php:540 fields/page_link.php:554
|
||||
#: fields/post_object.php:404 fields/post_object.php:418 fields/select.php:378
|
||||
#: fields/select.php:392 fields/select.php:406 fields/select.php:420
|
||||
#: fields/tab.php:131 fields/taxonomy.php:699 fields/taxonomy.php:785
|
||||
#: fields/taxonomy.php:799 fields/taxonomy.php:813 fields/taxonomy.php:827
|
||||
#: fields/user.php:417 fields/user.php:431 fields/wysiwyg.php:419
|
||||
#: pro/admin/views/settings-updates.php:103
|
||||
#: fields/post_object.php:404 fields/post_object.php:418 fields/radio.php:251
|
||||
#: fields/select.php:378 fields/select.php:392 fields/select.php:406
|
||||
#: fields/select.php:420 fields/tab.php:131 fields/taxonomy.php:699
|
||||
#: fields/taxonomy.php:785 fields/taxonomy.php:799 fields/taxonomy.php:813
|
||||
#: fields/taxonomy.php:827 fields/user.php:417 fields/user.php:431
|
||||
#: fields/wysiwyg.php:419 pro/admin/views/settings-updates.php:103
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -548,11 +557,17 @@ msgstr ""
|
|||
msgid "Add rule group"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field.php:49 pro/fields/flexible-content.php:342
|
||||
#: pro/fields/repeater.php:302
|
||||
msgid "Drag to reorder"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field.php:54 admin/views/field-group-field.php:57
|
||||
msgid "Edit field"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-field.php:57 pro/fields/gallery.php:363
|
||||
#: admin/views/field-group-field.php:57 core/media.php:55 fields/image.php:142
|
||||
#: pro/fields/gallery.php:358
|
||||
msgid "Edit"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -669,7 +684,7 @@ msgstr ""
|
|||
msgid "Post"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-locations.php:6 fields/relationship.php:723
|
||||
#: admin/views/field-group-locations.php:6 fields/relationship.php:726
|
||||
msgid "Post Type"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -878,7 +893,7 @@ msgstr ""
|
|||
msgid "Page Attributes"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/field-group-options.php:123 fields/relationship.php:736
|
||||
#: admin/views/field-group-options.php:123 fields/relationship.php:739
|
||||
msgid "Featured Image"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1236,8 +1251,9 @@ msgstr ""
|
|||
msgid "Upgrade complete"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/update-network.php:161
|
||||
msgid "Upgrading data to"
|
||||
#: admin/views/update-network.php:161 admin/views/update.php:14
|
||||
#, php-format
|
||||
msgid "Upgrading data to version %s"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/update-notice.php:23
|
||||
|
|
@ -1259,92 +1275,83 @@ msgstr ""
|
|||
msgid "Reading upgrade tasks..."
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/update.php:14
|
||||
#, php-format
|
||||
msgid "Upgrading data to version %s"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/update.php:16
|
||||
msgid "See what's new"
|
||||
msgstr ""
|
||||
|
||||
#: admin/views/update.php:110
|
||||
msgid "No updates available"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:937
|
||||
#: api/api-helpers.php:933
|
||||
msgid "Thumbnail"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:938
|
||||
#: api/api-helpers.php:934
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:939
|
||||
#: api/api-helpers.php:935
|
||||
msgid "Large"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:987
|
||||
#: api/api-helpers.php:984
|
||||
msgid "Full Size"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:1177 api/api-helpers.php:1740
|
||||
#: api/api-helpers.php:1196 api/api-helpers.php:1759
|
||||
msgid "(no title)"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3570
|
||||
#: api/api-helpers.php:3594
|
||||
#, php-format
|
||||
msgid "Image width must be at least %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3575
|
||||
#: api/api-helpers.php:3599
|
||||
#, php-format
|
||||
msgid "Image width must not exceed %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3591
|
||||
#: api/api-helpers.php:3615
|
||||
#, php-format
|
||||
msgid "Image height must be at least %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3596
|
||||
#: api/api-helpers.php:3620
|
||||
#, php-format
|
||||
msgid "Image height must not exceed %dpx."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3614
|
||||
#: api/api-helpers.php:3638
|
||||
#, php-format
|
||||
msgid "File size must be at least %s."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3619
|
||||
#: api/api-helpers.php:3643
|
||||
#, php-format
|
||||
msgid "File size must must not exceed %s."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-helpers.php:3653
|
||||
#: api/api-helpers.php:3677
|
||||
#, php-format
|
||||
msgid "File type must be %s."
|
||||
msgstr ""
|
||||
|
||||
#: api/api-template.php:1004
|
||||
#: api/api-template.php:1073
|
||||
msgid "Spam Detected"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-template.php:1147 pro/api/api-options-page.php:50
|
||||
#: pro/fields/gallery.php:572
|
||||
#: api/api-template.php:1216 core/media.php:56 pro/api/api-options-page.php:50
|
||||
#: pro/fields/gallery.php:586
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-template.php:1148
|
||||
#: api/api-template.php:1217
|
||||
msgid "Post updated"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-template.php:1216 core/field.php:133
|
||||
#: api/api-template.php:1285 core/field.php:133
|
||||
msgid "Content"
|
||||
msgstr ""
|
||||
|
||||
#: api/api-template.php:1281
|
||||
#: api/api-template.php:1350
|
||||
msgid "Validate Email"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1364,7 +1371,7 @@ msgstr ""
|
|||
msgid "jQuery"
|
||||
msgstr ""
|
||||
|
||||
#: core/field.php:137 fields/checkbox.php:226 fields/radio.php:231
|
||||
#: core/field.php:137 fields/checkbox.php:223 fields/radio.php:288
|
||||
#: pro/fields/flexible-content.php:491 pro/fields/flexible-content.php:540
|
||||
#: pro/fields/repeater.php:459
|
||||
msgid "Layout"
|
||||
|
|
@ -1382,7 +1389,7 @@ msgstr ""
|
|||
msgid "Validation successful"
|
||||
msgstr ""
|
||||
|
||||
#: core/input.php:258 core/validation.php:306 forms/widget.php:238
|
||||
#: core/input.php:258 core/validation.php:306 forms/widget.php:234
|
||||
msgid "Validation failed"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1399,6 +1406,16 @@ msgstr ""
|
|||
msgid "Restricted"
|
||||
msgstr ""
|
||||
|
||||
#: core/media.php:54 fields/select.php:36 fields/select.php:167
|
||||
#: fields/taxonomy.php:771
|
||||
msgid "Select"
|
||||
msgstr ""
|
||||
|
||||
#: core/media.php:57 fields/file.php:49 fields/image.php:54
|
||||
#: pro/fields/gallery.php:56
|
||||
msgid "Uploaded to this post"
|
||||
msgstr ""
|
||||
|
||||
#: core/validation.php:207
|
||||
#, php-format
|
||||
msgid "%s value is required"
|
||||
|
|
@ -1408,50 +1425,50 @@ msgstr ""
|
|||
msgid "Checkbox"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:144
|
||||
#: fields/checkbox.php:141
|
||||
msgid "Toggle All"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:208 fields/radio.php:193 fields/select.php:354
|
||||
#: fields/checkbox.php:205 fields/radio.php:236 fields/select.php:354
|
||||
msgid "Choices"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:209 fields/radio.php:194 fields/select.php:355
|
||||
#: fields/checkbox.php:206 fields/radio.php:237 fields/select.php:355
|
||||
msgid "Enter each choice on a new line."
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:209 fields/radio.php:194 fields/select.php:355
|
||||
#: fields/checkbox.php:206 fields/radio.php:237 fields/select.php:355
|
||||
msgid "For more control, you may specify both a value and label like this:"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:209 fields/radio.php:194 fields/select.php:355
|
||||
#: fields/checkbox.php:206 fields/radio.php:237 fields/select.php:355
|
||||
msgid "red : Red"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:217 fields/color_picker.php:147 fields/email.php:124
|
||||
#: fields/number.php:150 fields/radio.php:222 fields/select.php:363
|
||||
#: fields/checkbox.php:214 fields/color_picker.php:147 fields/email.php:124
|
||||
#: fields/number.php:150 fields/radio.php:279 fields/select.php:363
|
||||
#: fields/text.php:148 fields/textarea.php:145 fields/true_false.php:115
|
||||
#: fields/url.php:117 fields/wysiwyg.php:379
|
||||
msgid "Default Value"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:218 fields/select.php:364
|
||||
#: fields/checkbox.php:215 fields/select.php:364
|
||||
msgid "Enter each default value on a new line"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:232 fields/radio.php:237
|
||||
#: fields/checkbox.php:229 fields/radio.php:294
|
||||
msgid "Vertical"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:233 fields/radio.php:238
|
||||
#: fields/checkbox.php:230 fields/radio.php:295
|
||||
msgid "Horizontal"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:240
|
||||
#: fields/checkbox.php:237
|
||||
msgid "Toggle"
|
||||
msgstr ""
|
||||
|
||||
#: fields/checkbox.php:241
|
||||
#: fields/checkbox.php:238
|
||||
msgid "Prepend an extra checkbox to toggle all choices"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1500,7 +1517,7 @@ msgid "The format displayed when editing a post"
|
|||
msgstr ""
|
||||
|
||||
#: fields/date_picker.php:189 fields/post_object.php:426
|
||||
#: fields/relationship.php:763
|
||||
#: fields/relationship.php:766
|
||||
msgid "Return Format"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1516,7 +1533,7 @@ msgstr ""
|
|||
msgid "Email"
|
||||
msgstr ""
|
||||
|
||||
#: fields/email.php:125 fields/number.php:151 fields/radio.php:223
|
||||
#: fields/email.php:125 fields/number.php:151 fields/radio.php:280
|
||||
#: fields/text.php:149 fields/textarea.php:146 fields/url.php:118
|
||||
#: fields/wysiwyg.php:380
|
||||
msgid "Appears when creating a new post"
|
||||
|
|
@ -1564,73 +1581,69 @@ msgstr ""
|
|||
msgid "Update File"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:49 fields/image.php:54 pro/fields/gallery.php:55
|
||||
msgid "Uploaded to this post"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:142
|
||||
#: fields/file.php:148
|
||||
msgid "File name"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:146 fields/file.php:247 fields/file.php:258
|
||||
#: fields/image.php:262 fields/image.php:295 pro/fields/gallery.php:692
|
||||
#: pro/fields/gallery.php:725
|
||||
#: fields/file.php:152 fields/file.php:253 fields/file.php:264
|
||||
#: fields/image.php:268 fields/image.php:301 pro/fields/gallery.php:715
|
||||
#: pro/fields/gallery.php:748
|
||||
msgid "File size"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:169
|
||||
#: fields/file.php:175
|
||||
msgid "Add File"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:214 fields/image.php:200 fields/taxonomy.php:835
|
||||
#: fields/file.php:220 fields/image.php:206 fields/taxonomy.php:835
|
||||
msgid "Return Value"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:215 fields/image.php:201
|
||||
#: fields/file.php:221 fields/image.php:207
|
||||
msgid "Specify the returned value on front end"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:220
|
||||
#: fields/file.php:226
|
||||
msgid "File Array"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:221
|
||||
#: fields/file.php:227
|
||||
msgid "File URL"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:222
|
||||
#: fields/file.php:228
|
||||
msgid "File ID"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:229 fields/image.php:225 pro/fields/gallery.php:655
|
||||
#: fields/file.php:235 fields/image.php:231 pro/fields/gallery.php:678
|
||||
msgid "Library"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:230 fields/image.php:226 pro/fields/gallery.php:656
|
||||
#: fields/file.php:236 fields/image.php:232 pro/fields/gallery.php:679
|
||||
msgid "Limit the media library choice"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:236 fields/image.php:232 pro/fields/gallery.php:662
|
||||
#: fields/file.php:242 fields/image.php:238 pro/fields/gallery.php:685
|
||||
msgid "Uploaded to post"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:243 fields/image.php:239 pro/fields/gallery.php:669
|
||||
#: fields/file.php:249 fields/image.php:245 pro/fields/gallery.php:692
|
||||
msgid "Minimum"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:244 fields/file.php:255
|
||||
#: fields/file.php:250 fields/file.php:261
|
||||
msgid "Restrict which files can be uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:254 fields/image.php:272 pro/fields/gallery.php:702
|
||||
#: fields/file.php:260 fields/image.php:278 pro/fields/gallery.php:725
|
||||
msgid "Maximum"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:265 fields/image.php:305 pro/fields/gallery.php:735
|
||||
#: fields/file.php:271 fields/image.php:311 pro/fields/gallery.php:758
|
||||
msgid "Allowed file types"
|
||||
msgstr ""
|
||||
|
||||
#: fields/file.php:266 fields/image.php:306 pro/fields/gallery.php:736
|
||||
#: fields/file.php:272 fields/image.php:312 pro/fields/gallery.php:759
|
||||
msgid "Comma separated list. Leave blank for all types"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1646,7 +1659,7 @@ msgstr ""
|
|||
msgid "Sorry, this browser does not support geolocation"
|
||||
msgstr ""
|
||||
|
||||
#: fields/google-map.php:133 fields/relationship.php:722
|
||||
#: fields/google-map.php:133 fields/relationship.php:725
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1678,8 +1691,8 @@ msgstr ""
|
|||
msgid "Set the initial zoom level"
|
||||
msgstr ""
|
||||
|
||||
#: fields/google-map.php:203 fields/image.php:251 fields/image.php:284
|
||||
#: fields/oembed.php:275 pro/fields/gallery.php:681 pro/fields/gallery.php:714
|
||||
#: fields/google-map.php:203 fields/image.php:257 fields/image.php:290
|
||||
#: fields/oembed.php:275 pro/fields/gallery.php:704 pro/fields/gallery.php:737
|
||||
msgid "Height"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1695,11 +1708,11 @@ msgstr ""
|
|||
msgid "Select Image"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:52 pro/fields/gallery.php:53
|
||||
#: fields/image.php:52 pro/fields/gallery.php:54
|
||||
msgid "Edit Image"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:53 pro/fields/gallery.php:54
|
||||
#: fields/image.php:53 pro/fields/gallery.php:55
|
||||
msgid "Update Image"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1707,41 +1720,45 @@ msgstr ""
|
|||
msgid "All images"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:152
|
||||
#: fields/image.php:144 pro/fields/gallery.php:359 pro/fields/gallery.php:542
|
||||
msgid "Remove"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:158
|
||||
msgid "No image selected"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:152
|
||||
#: fields/image.php:158
|
||||
msgid "Add Image"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:206
|
||||
#: fields/image.php:212
|
||||
msgid "Image Array"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:207
|
||||
#: fields/image.php:213
|
||||
msgid "Image URL"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:208
|
||||
#: fields/image.php:214
|
||||
msgid "Image ID"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:215 pro/fields/gallery.php:645
|
||||
#: fields/image.php:221 pro/fields/gallery.php:655
|
||||
msgid "Preview Size"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:216 pro/fields/gallery.php:646
|
||||
#: fields/image.php:222 pro/fields/gallery.php:656
|
||||
msgid "Shown when entering data"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:240 fields/image.php:273 pro/fields/gallery.php:670
|
||||
#: pro/fields/gallery.php:703
|
||||
#: fields/image.php:246 fields/image.php:279 pro/fields/gallery.php:693
|
||||
#: pro/fields/gallery.php:726
|
||||
msgid "Restrict which images can be uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: fields/image.php:243 fields/image.php:276 fields/oembed.php:264
|
||||
#: pro/fields/gallery.php:673 pro/fields/gallery.php:706
|
||||
#: fields/image.php:249 fields/image.php:282 fields/oembed.php:264
|
||||
#: pro/fields/gallery.php:696 pro/fields/gallery.php:729
|
||||
msgid "Width"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1828,27 +1845,27 @@ msgid "Archives"
|
|||
msgstr ""
|
||||
|
||||
#: fields/page_link.php:506 fields/post_object.php:370
|
||||
#: fields/relationship.php:689
|
||||
#: fields/relationship.php:692
|
||||
msgid "Filter by Post Type"
|
||||
msgstr ""
|
||||
|
||||
#: fields/page_link.php:514 fields/post_object.php:378
|
||||
#: fields/relationship.php:697
|
||||
#: fields/relationship.php:700
|
||||
msgid "All post types"
|
||||
msgstr ""
|
||||
|
||||
#: fields/page_link.php:520 fields/post_object.php:384
|
||||
#: fields/relationship.php:703
|
||||
#: fields/relationship.php:706
|
||||
msgid "Filter by Taxonomy"
|
||||
msgstr ""
|
||||
|
||||
#: fields/page_link.php:528 fields/post_object.php:392
|
||||
#: fields/relationship.php:711
|
||||
#: fields/relationship.php:714
|
||||
msgid "All taxonomies"
|
||||
msgstr ""
|
||||
|
||||
#: fields/page_link.php:534 fields/post_object.php:398 fields/select.php:372
|
||||
#: fields/taxonomy.php:779 fields/user.php:411
|
||||
#: fields/page_link.php:534 fields/post_object.php:398 fields/radio.php:245
|
||||
#: fields/select.php:372 fields/taxonomy.php:779 fields/user.php:411
|
||||
msgid "Allow Null?"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1862,11 +1879,11 @@ msgid "Password"
|
|||
msgstr ""
|
||||
|
||||
#: fields/post_object.php:36 fields/post_object.php:431
|
||||
#: fields/relationship.php:768
|
||||
#: fields/relationship.php:771
|
||||
msgid "Post Object"
|
||||
msgstr ""
|
||||
|
||||
#: fields/post_object.php:432 fields/relationship.php:769
|
||||
#: fields/post_object.php:432 fields/relationship.php:772
|
||||
msgid "Post ID"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1874,19 +1891,19 @@ msgstr ""
|
|||
msgid "Radio Button"
|
||||
msgstr ""
|
||||
|
||||
#: fields/radio.php:202
|
||||
#: fields/radio.php:259
|
||||
msgid "Other"
|
||||
msgstr ""
|
||||
|
||||
#: fields/radio.php:206
|
||||
#: fields/radio.php:263
|
||||
msgid "Add 'other' choice to allow for custom values"
|
||||
msgstr ""
|
||||
|
||||
#: fields/radio.php:212
|
||||
#: fields/radio.php:269
|
||||
msgid "Save Other"
|
||||
msgstr ""
|
||||
|
||||
#: fields/radio.php:216
|
||||
#: fields/radio.php:273
|
||||
msgid "Save 'other' values to the field's choices"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1910,49 +1927,45 @@ msgstr ""
|
|||
msgid "No matches found"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:570
|
||||
#: fields/relationship.php:573
|
||||
msgid "Search..."
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:579
|
||||
#: fields/relationship.php:582
|
||||
msgid "Select post type"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:592
|
||||
#: fields/relationship.php:595
|
||||
msgid "Select taxonomy"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:724 fields/taxonomy.php:36 fields/taxonomy.php:749
|
||||
#: fields/relationship.php:727 fields/taxonomy.php:36 fields/taxonomy.php:749
|
||||
msgid "Taxonomy"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:731
|
||||
#: fields/relationship.php:734
|
||||
msgid "Elements"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:732
|
||||
#: fields/relationship.php:735
|
||||
msgid "Selected elements will be displayed in each result"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:743
|
||||
#: fields/relationship.php:746
|
||||
msgid "Minimum posts"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:752
|
||||
#: fields/relationship.php:755
|
||||
msgid "Maximum posts"
|
||||
msgstr ""
|
||||
|
||||
#: fields/relationship.php:856 pro/fields/gallery.php:817
|
||||
#: fields/relationship.php:859 pro/fields/gallery.php:831
|
||||
#, php-format
|
||||
msgid "%s requires at least %s selection"
|
||||
msgid_plural "%s requires at least %s selections"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: fields/select.php:36 fields/select.php:167 fields/taxonomy.php:771
|
||||
msgid "Select"
|
||||
msgstr ""
|
||||
|
||||
#: fields/select.php:400
|
||||
msgid "Stylised UI"
|
||||
msgstr ""
|
||||
|
|
@ -2168,11 +2181,11 @@ msgstr ""
|
|||
msgid "Show Media Upload Buttons?"
|
||||
msgstr ""
|
||||
|
||||
#: forms/post.php:294 pro/admin/options-page.php:416
|
||||
#: forms/comment.php:166 forms/post.php:294 pro/admin/options-page.php:416
|
||||
msgid "Edit field group"
|
||||
msgstr ""
|
||||
|
||||
#: forms/widget.php:239
|
||||
#: forms/widget.php:235
|
||||
#, php-format
|
||||
msgid "1 field requires attention."
|
||||
msgid_plural "%d fields require attention."
|
||||
|
|
@ -2233,13 +2246,11 @@ msgid "License Information"
|
|||
msgstr ""
|
||||
|
||||
#: pro/admin/views/settings-updates.php:24
|
||||
#, php-format
|
||||
msgid ""
|
||||
"To unlock updates, please enter your license key below. If you don't have a "
|
||||
"licence key, please see"
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/settings-updates.php:24
|
||||
msgid "details & pricing"
|
||||
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
||||
"a>."
|
||||
msgstr ""
|
||||
|
||||
#: pro/admin/views/settings-updates.php:33
|
||||
|
|
@ -2282,12 +2293,12 @@ msgstr ""
|
|||
msgid "Options"
|
||||
msgstr ""
|
||||
|
||||
#: pro/core/updates.php:198
|
||||
#: pro/core/updates.php:194
|
||||
#, php-format
|
||||
msgid ""
|
||||
"To enable updates, please enter your license key on the <a href=\"%s"
|
||||
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
||||
"\">details & pricing</a>"
|
||||
"\">details & pricing</a>."
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/flexible-content.php:36
|
||||
|
|
@ -2407,66 +2418,78 @@ msgstr ""
|
|||
msgid "Gallery"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:52
|
||||
#: pro/fields/gallery.php:53
|
||||
msgid "Add Image to Gallery"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:56
|
||||
#: pro/fields/gallery.php:57
|
||||
msgid "Maximum selection reached"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:343
|
||||
#: pro/fields/gallery.php:337
|
||||
msgid "Length"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:363
|
||||
msgid "Remove"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:383
|
||||
#: pro/fields/gallery.php:380
|
||||
msgid "Caption"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:392
|
||||
#: pro/fields/gallery.php:389
|
||||
msgid "Alt Text"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:543
|
||||
#: pro/fields/gallery.php:557
|
||||
msgid "Add to gallery"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:547
|
||||
#: pro/fields/gallery.php:561
|
||||
msgid "Bulk actions"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:548
|
||||
#: pro/fields/gallery.php:562
|
||||
msgid "Sort by date uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:549
|
||||
#: pro/fields/gallery.php:563
|
||||
msgid "Sort by date modified"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:550
|
||||
#: pro/fields/gallery.php:564
|
||||
msgid "Sort by title"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:551
|
||||
#: pro/fields/gallery.php:565
|
||||
msgid "Reverse current order"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:569
|
||||
#: pro/fields/gallery.php:583
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:627
|
||||
#: pro/fields/gallery.php:637
|
||||
msgid "Minimum Selection"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:636
|
||||
#: pro/fields/gallery.php:646
|
||||
msgid "Maximum Selection"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:665
|
||||
msgid "Insert"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:666
|
||||
msgid "Specify where new attachments are added"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:670
|
||||
msgid "Append to the end"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/gallery.php:671
|
||||
msgid "Prepend to the beginning"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/repeater.php:36
|
||||
msgid "Repeater"
|
||||
msgstr ""
|
||||
|
|
@ -2479,10 +2502,6 @@ msgstr ""
|
|||
msgid "Maximum rows reached ({max} rows)"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/repeater.php:302
|
||||
msgid "Drag to reorder"
|
||||
msgstr ""
|
||||
|
||||
#: pro/fields/repeater.php:349
|
||||
msgid "Add row"
|
||||
msgstr ""
|
||||
|
|
@ -2512,7 +2531,7 @@ msgid "Maximum Rows"
|
|||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "http://www.advancedcustomfields.com/"
|
||||
msgid "https://www.advancedcustomfields.com/"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ extract($args);
|
|||
?>
|
||||
<div class="wrap acf-settings-wrap">
|
||||
|
||||
<h2><?php echo $page['page_title']; ?></h2>
|
||||
<h1><?php echo $page['page_title']; ?></h1>
|
||||
|
||||
<form id="post" method="post" name="post">
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ $readonly = $active ? 1 : 0;
|
|||
<h3><?php _e('License Information', 'acf'); ?></h3>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<p><?php _e("To unlock updates, please enter your license key below. If you don't have a licence key, please see",'acf'); ?> <a href="https://www.advancedcustomfields.com/pro" target="_blank"><?php _e('details & pricing', 'acf'); ?></a></p>
|
||||
<p><?php printf(__('To unlock updates, please enter your license key below. If you don\'t have a licence key, please see <a href="%s" target="_blank">details & pricing</a>.','acf'), esc_url('https://www.advancedcustomfields.com/pro')); ?></p>
|
||||
<form action="" method="post">
|
||||
<div class="acf-hidden">
|
||||
<input type="hidden" name="_acfnonce" value="<?php echo wp_create_nonce( $nonce ); ?>" />
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ function acf_pro_get_remote_url( $action = '', $args = array() ) {
|
|||
|
||||
|
||||
// vars
|
||||
$url = "http://connect.advancedcustomfields.com/index.php?" . build_query($args);
|
||||
$url = "https://connect.advancedcustomfields.com/index.php?" . build_query($args);
|
||||
|
||||
|
||||
// return
|
||||
|
|
|
|||
|
|
@ -329,6 +329,17 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
border: #DFDFDF solid 1px;
|
||||
height: 400px;
|
||||
position: relative;
|
||||
/* main */
|
||||
/* attachments */
|
||||
/* attachment */
|
||||
/* hide attachment actions when sidebar is open */
|
||||
/* toolbar */
|
||||
/* sidebar */
|
||||
/* side info */
|
||||
/* side data */
|
||||
/* column widths */
|
||||
/* column widths clear */
|
||||
/* resizable */
|
||||
}
|
||||
.acf-gallery .acf-gallery-main {
|
||||
position: absolute;
|
||||
|
|
@ -339,84 +350,101 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
background: #fff;
|
||||
z-index: 2;
|
||||
}
|
||||
.acf-gallery-attachments {
|
||||
.acf-gallery .acf-gallery-attachments {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 45px;
|
||||
bottom: 48px;
|
||||
left: 0;
|
||||
padding: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
/* attachment */
|
||||
.acf-gallery-attachment {
|
||||
.acf-gallery .acf-gallery-attachment {
|
||||
width: 25%;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
/* sortable */
|
||||
/* active */
|
||||
/* audio, video */
|
||||
/* icon */
|
||||
/* rtl */
|
||||
}
|
||||
.acf-gallery-attachment.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #F1F1F1;
|
||||
}
|
||||
.acf-gallery-attachment.ui-sortable-placeholder .margin {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.acf-gallery-attachment .margin {
|
||||
.acf-gallery .acf-gallery-attachment .margin {
|
||||
margin: 5px;
|
||||
border: #DFDFDF solid 1px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.acf-gallery-attachment.active .margin {
|
||||
box-shadow: 0 0 0 1px #FFFFFF, 0 0 0 5px #1E8CBE;
|
||||
}
|
||||
.acf-gallery-attachment img {
|
||||
.acf-gallery .acf-gallery-attachment img {
|
||||
display: block;
|
||||
height: auto;
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.acf-gallery-attachment .filename {
|
||||
.acf-gallery .acf-gallery-attachment img[src$="svg"] {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
.acf-gallery .acf-gallery-attachment .filename {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 5%;
|
||||
background: #F4F4F4;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
border-top: #DFDFDF solid 1px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
word-wrap: break-word;
|
||||
max-height: 90%;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
}
|
||||
.acf-gallery-attachment .actions {
|
||||
.acf-gallery .acf-gallery-attachment .actions {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.acf-gallery.sidebar-open .acf-gallery-attachment .actions {
|
||||
display: none;
|
||||
.acf-gallery .acf-gallery-attachment.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #F1F1F1;
|
||||
}
|
||||
/* icon */
|
||||
.acf-gallery-attachment.is-mime-icon .margin:before {
|
||||
.acf-gallery .acf-gallery-attachment.ui-sortable-placeholder .margin {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.acf-gallery .acf-gallery-attachment.active .margin {
|
||||
box-shadow: 0 0 0 1px #FFFFFF, 0 0 0 5px #1E8CBE;
|
||||
}
|
||||
.acf-gallery .acf-gallery-attachment.-audio .filename,
|
||||
.acf-gallery .acf-gallery-attachment.-video .filename {
|
||||
display: block;
|
||||
}
|
||||
.acf-gallery .acf-gallery-attachment.-icon .margin:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 100%;
|
||||
}
|
||||
.acf-gallery-attachment.is-mime-icon .thumbnail {
|
||||
.acf-gallery .acf-gallery-attachment.-icon .thumbnail {
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
left: 50%;
|
||||
max-width: 40%;
|
||||
}
|
||||
.acf-gallery-attachment.is-mime-icon .thumbnail img {
|
||||
.acf-gallery .acf-gallery-attachment.-icon img {
|
||||
margin: -50% 0 0 -50%;
|
||||
}
|
||||
/* toolbar */
|
||||
.acf-gallery .acf-gallery-attachment.-icon .filename {
|
||||
display: block;
|
||||
}
|
||||
html[dir="rtl"] .acf-gallery .acf-gallery-attachment {
|
||||
float: right;
|
||||
}
|
||||
.acf-gallery.sidebar-open .acf-gallery-attachment .actions {
|
||||
display: none;
|
||||
}
|
||||
.acf-gallery .acf-gallery-toolbar {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
|
@ -424,10 +452,16 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
left: 0;
|
||||
padding: 10px;
|
||||
border-top: #DFDFDF solid 1px;
|
||||
background: #fff;
|
||||
height: 28px;
|
||||
}
|
||||
.acf-gallery .acf-gallery-toolbar .acf-hl li {
|
||||
line-height: 24px;
|
||||
}
|
||||
.acf-gallery .acf-gallery-toolbar .bulk-actions-select {
|
||||
width: auto;
|
||||
margin: 0 1px 0 0;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
@ -439,18 +473,13 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
z-index: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-inner {
|
||||
.acf-gallery .acf-gallery-side .acf-gallery-side-inner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 349px;
|
||||
}
|
||||
.acf-gallery .bulk-actions-select {
|
||||
width: auto;
|
||||
margin: 0 1px 0 0;
|
||||
}
|
||||
/* side info */
|
||||
.acf-gallery .acf-gallery-side-info {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
|
@ -469,11 +498,17 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
padding: 3px;
|
||||
border: #DFDFDF solid 1px;
|
||||
border-radius: 1px;
|
||||
/* rtl */
|
||||
}
|
||||
html[dir="rtl"] .acf-gallery .acf-gallery-side-info img {
|
||||
float: right;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-info p {
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
margin: 3px 0;
|
||||
word-break: break-all;
|
||||
color: #999999;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-info p strong {
|
||||
|
|
@ -482,16 +517,15 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
.acf-gallery .acf-gallery-side-info a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-info a.edit-attachment {
|
||||
.acf-gallery .acf-gallery-side-info a.acf-gallery-edit {
|
||||
color: #21759b;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-info a.remove-attachment {
|
||||
.acf-gallery .acf-gallery-side-info a.acf-gallery-remove {
|
||||
color: #bc0b0b;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-info a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
/* side data */
|
||||
.acf-gallery .acf-gallery-side-data {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
@ -510,11 +544,16 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
padding: 0 4px 8px 0 !important;
|
||||
width: auto !important;
|
||||
vertical-align: top;
|
||||
/* rtl */
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-data .acf-label label,
|
||||
.acf-gallery .acf-gallery-side-data th.label label {
|
||||
font-weight: normal;
|
||||
}
|
||||
html[dir="rtl"] .acf-gallery .acf-gallery-side-data .acf-label,
|
||||
html[dir="rtl"] .acf-gallery .acf-gallery-side-data th.label {
|
||||
text-align: left;
|
||||
}
|
||||
.acf-gallery .acf-gallery-side-data .acf-input,
|
||||
.acf-gallery .acf-gallery-side-data td.field {
|
||||
padding: 0 0 8px !important;
|
||||
|
|
@ -529,14 +568,6 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
.acf-gallery .acf-gallery-side-data p.help:hover {
|
||||
font-weight: normal;
|
||||
}
|
||||
/* selected */
|
||||
.attachment.acf-selected {
|
||||
box-shadow: 0 0 0 3px #fff inset, 0 0 0 7px #1e8cbe inset !important;
|
||||
}
|
||||
.attachment.acf-selected .check {
|
||||
display: none !important;
|
||||
}
|
||||
/* column widths */
|
||||
.acf-gallery[data-columns="1"] .acf-gallery-attachment {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -561,29 +592,15 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
.acf-gallery[data-columns="8"] .acf-gallery-attachment {
|
||||
width: 12.5%;
|
||||
}
|
||||
/* column widths clear */
|
||||
.acf-gallery[data-columns="2"] .acf-gallery-attachment:nth-child(2n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="3"] .acf-gallery-attachment:nth-child(3n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="4"] .acf-gallery-attachment:nth-child(4n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="5"] .acf-gallery-attachment:nth-child(5n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="6"] .acf-gallery-attachment:nth-child(6n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="7"] .acf-gallery-attachment:nth-child(7n+1) {
|
||||
clear: both;
|
||||
}
|
||||
.acf-gallery[data-columns="2"] .acf-gallery-attachment:nth-child(2n+1),
|
||||
.acf-gallery[data-columns="3"] .acf-gallery-attachment:nth-child(3n+1),
|
||||
.acf-gallery[data-columns="4"] .acf-gallery-attachment:nth-child(4n+1),
|
||||
.acf-gallery[data-columns="5"] .acf-gallery-attachment:nth-child(5n+1),
|
||||
.acf-gallery[data-columns="6"] .acf-gallery-attachment:nth-child(6n+1),
|
||||
.acf-gallery[data-columns="7"] .acf-gallery-attachment:nth-child(7n+1),
|
||||
.acf-gallery[data-columns="8"] .acf-gallery-attachment:nth-child(8n+1) {
|
||||
clear: both;
|
||||
}
|
||||
/* resizable */
|
||||
.acf-gallery .ui-resizable-handle {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
|
@ -595,11 +612,11 @@ html[dir="rtl"] .acf-flexible-content .layout .acf-fc-layout-controlls {
|
|||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* rtl */
|
||||
html[dir="rtl"] .acf-gallery-attachment {
|
||||
float: right;
|
||||
/* media modal selected */
|
||||
.acf-media-modal .attachment.acf-selected {
|
||||
box-shadow: 0 0 0 3px #fff inset, 0 0 0 7px #1e8cbe inset !important;
|
||||
opacity: 0.5;
|
||||
}
|
||||
html[dir="rtl"] .acf-gallery .acf-gallery-side-info img {
|
||||
float: right;
|
||||
margin: 0 0 0 10px;
|
||||
.acf-media-modal .attachment.acf-selected .check {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -110,27 +110,23 @@ class acf_pro_updates {
|
|||
|
||||
|
||||
// bail early if no show_updates
|
||||
if( !acf_get_setting('show_updates') ) {
|
||||
if( !acf_get_setting('show_updates') ) return $transient;
|
||||
|
||||
return $transient;
|
||||
|
||||
// ensure is_plugin_active() exists (not on frontend)
|
||||
if( !function_exists('is_plugin_active') ) {
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// bail early if not a plugin (included in theme)
|
||||
if( !is_plugin_active($basename) ) {
|
||||
|
||||
return $transient;
|
||||
|
||||
}
|
||||
if( !is_plugin_active($basename) ) return $transient;
|
||||
|
||||
|
||||
// bail early if no update available
|
||||
if( !acf_pro_is_update_available() ) {
|
||||
|
||||
return $transient;
|
||||
|
||||
}
|
||||
if( !acf_pro_is_update_available() ) return $transient;
|
||||
|
||||
|
||||
// vars
|
||||
|
|
@ -195,11 +191,11 @@ class acf_pro_updates {
|
|||
|
||||
|
||||
// vars
|
||||
$m = __('To enable updates, please enter your license key on the <a href="%s">Updates</a> page. If you don\'t have a licence key, please see <a href="%s">details & pricing</a>', 'acf');
|
||||
$m = __('To enable updates, please enter your license key on the <a href="%s">Updates</a> page. If you don\'t have a licence key, please see <a href="%s">details & pricing</a>.', 'acf');
|
||||
|
||||
|
||||
// show message
|
||||
echo '<br />' . sprintf( $m, admin_url('edit.php?post_type=acf-field-group&page=acf-settings-updates'), 'http://www.advancedcustomfields.com/pro');
|
||||
echo '<br />' . sprintf( $m, admin_url('edit.php?post_type=acf-field-group&page=acf-settings-updates'), 'https://www.advancedcustomfields.com/pro');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ class acf_field_flexible_content extends acf_field {
|
|||
<?php acf_hidden_input(array( 'name' => "{$field['name']}[{$i}][acf_fc_layout]", 'value' => $layout['name'] )); ?>
|
||||
</div>
|
||||
|
||||
<div class="acf-fc-layout-handle"><?php echo $title; ?></div>
|
||||
<div class="acf-fc-layout-handle" title="<?php _e('Drag to reorder','acf'); ?>"><?php echo $title; ?></div>
|
||||
|
||||
<ul class="acf-fc-layout-controlls acf-hl">
|
||||
<li class="acf-fc-show-on-hover">
|
||||
|
|
@ -781,11 +781,7 @@ class acf_field_flexible_content extends acf_field {
|
|||
|
||||
|
||||
// bail early if layout deosnt exist
|
||||
if( empty($layouts[ $l ]) ) {
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
if( empty($layouts[ $l ]) ) continue;
|
||||
|
||||
|
||||
// get layout
|
||||
|
|
@ -799,6 +795,10 @@ class acf_field_flexible_content extends acf_field {
|
|||
$sub_field = $layout[ $j ];
|
||||
|
||||
|
||||
// update $sub_field name
|
||||
$sub_field['name'] = "{$field['name']}_{$i}_{$sub_field['name']}";
|
||||
|
||||
|
||||
// extract value
|
||||
$sub_value = acf_extract_var( $value[ $i ], $sub_field['key'] );
|
||||
|
||||
|
|
@ -808,7 +808,7 @@ class acf_field_flexible_content extends acf_field {
|
|||
|
||||
|
||||
// append to $row
|
||||
$value[ $i ][ $sub_field['name'] ] = $sub_value;
|
||||
$value[ $i ][ $sub_field['_name'] ] = $sub_value;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1065,6 +1065,66 @@ class acf_field_flexible_content extends acf_field {
|
|||
|
||||
// return
|
||||
return $order;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* delete_value
|
||||
*
|
||||
* description
|
||||
*
|
||||
* @type function
|
||||
* @date 1/07/2015
|
||||
* @since 5.2.3
|
||||
*
|
||||
* @param $post_id (int)
|
||||
* @return $post_id (int)
|
||||
*/
|
||||
|
||||
function delete_value( $post_id, $key, $field ) {
|
||||
|
||||
// get old value (db only)
|
||||
$old_order = acf_get_metadata( $post_id, $field['name'] );
|
||||
|
||||
|
||||
// bail early if no rows or no sub fields
|
||||
if( empty($old_order) ) return;
|
||||
|
||||
|
||||
// vars
|
||||
$layouts = array();
|
||||
|
||||
|
||||
// populate $layouts
|
||||
foreach( $field['layouts'] as $layout ) {
|
||||
|
||||
$layouts[ $layout['name'] ] = $layout['sub_fields'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
// loop
|
||||
foreach( $old_order as $i => $l ) {
|
||||
|
||||
// bail early if no layout
|
||||
if( empty($layouts[ $l ]) ) continue;
|
||||
|
||||
|
||||
// loop through sub fields
|
||||
foreach( $layouts[ $l ] as $sub_field ) {
|
||||
|
||||
// modify name for delete
|
||||
$sub_field['name'] = "{$key}_{$i}_{$sub_field['name']}";
|
||||
|
||||
|
||||
// delete value
|
||||
acf_delete_value( $post_id, $sub_field );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1294,13 +1354,18 @@ class acf_field_flexible_content extends acf_field {
|
|||
|
||||
function get_layout_title( $field, $layout, $i, $value ) {
|
||||
|
||||
// vars
|
||||
$rows = array();
|
||||
$rows[ $i ] = $value;
|
||||
|
||||
|
||||
// add loop
|
||||
acf_add_loop(array(
|
||||
'selector' => $field['name'],
|
||||
'name' => $field['name'],
|
||||
'value' => array( $value ),
|
||||
'value' => $rows,
|
||||
'field' => $field,
|
||||
'i' => 0,
|
||||
'i' => $i,
|
||||
'post_id' => 0,
|
||||
));
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ class acf_field_gallery extends acf_field {
|
|||
'max_width' => 0,
|
||||
'max_height' => 0,
|
||||
'max_size' => 0,
|
||||
'mime_types' => ''
|
||||
'mime_types' => '',
|
||||
'insert' => 'append'
|
||||
);
|
||||
$this->l10n = array(
|
||||
'select' => __("Add Image to Gallery",'acf'),
|
||||
|
|
@ -92,6 +93,7 @@ class acf_field_gallery extends acf_field {
|
|||
// options
|
||||
$options = acf_parse_args( $_POST, array(
|
||||
'post_id' => 0,
|
||||
'attachment' => 0,
|
||||
'id' => 0,
|
||||
'field_key' => '',
|
||||
'nonce' => '',
|
||||
|
|
@ -99,27 +101,19 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
|
||||
// validate
|
||||
if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) {
|
||||
if( !wp_verify_nonce($options['nonce'], 'acf_nonce') ) die();
|
||||
|
||||
die();
|
||||
|
||||
}
|
||||
|
||||
if( empty($options['id']) ) {
|
||||
|
||||
die();
|
||||
|
||||
}
|
||||
// bail early if no id
|
||||
if( !$options['id'] ) die();
|
||||
|
||||
|
||||
// load field
|
||||
$field = acf_get_field( $options['field_key'] );
|
||||
|
||||
if( !$field ) {
|
||||
|
||||
die();
|
||||
|
||||
}
|
||||
// bali early if no field
|
||||
if( !$field ) die();
|
||||
|
||||
|
||||
// render
|
||||
|
|
@ -306,9 +300,10 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
// vars
|
||||
$attachment = wp_prepare_attachment_for_js( $id );
|
||||
$thumb = '';
|
||||
$prefix = "attachments[{$id}]";
|
||||
$compat = get_compat_media_markup( $id );
|
||||
$compat = $compat['item'];
|
||||
$prefix = 'attachments[' . $id . ']';
|
||||
$thumb = '';
|
||||
$dimentions = '';
|
||||
|
||||
|
||||
|
|
@ -331,12 +326,11 @@ class acf_field_gallery extends acf_field {
|
|||
} else {
|
||||
|
||||
// fallback (perhaps attachment does not exist)
|
||||
$thumb = $attachment['icon'];
|
||||
$thumb = wp_mime_type_icon();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// dimentions
|
||||
if( $attachment['type'] === 'audio' ) {
|
||||
|
||||
|
|
@ -348,7 +342,7 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
}
|
||||
|
||||
if( $attachment['filesizeHumanReadable'] ) {
|
||||
if( !empty($attachment['filesizeHumanReadable']) ) {
|
||||
|
||||
$dimentions .= ' (' . $attachment['filesizeHumanReadable'] . ')';
|
||||
|
||||
|
|
@ -360,7 +354,10 @@ class acf_field_gallery extends acf_field {
|
|||
<p class="filename"><strong><?php echo $attachment['filename']; ?></strong></p>
|
||||
<p class="uploaded"><?php echo $attachment['dateFormatted']; ?></p>
|
||||
<p class="dimensions"><?php echo $dimentions; ?></p>
|
||||
<p class="actions"><a href="#" class="edit-attachment" data-id="<?php echo $id; ?>"><?php _e('Edit', 'acf'); ?></a> <a href="#" class="remove-attachment" data-id="<?php echo $id; ?>"><?php _e('Remove', 'acf'); ?></a></p>
|
||||
<p class="actions">
|
||||
<a href="#" class="acf-gallery-edit" data-id="<?php echo $id; ?>"><?php _e('Edit', 'acf'); ?></a>
|
||||
<a href="#" class="acf-gallery-remove" data-id="<?php echo $id; ?>"><?php _e('Remove', 'acf'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
|
|
@ -405,10 +402,46 @@ class acf_field_gallery extends acf_field {
|
|||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $compat['item']; ?>
|
||||
|
||||
<?php
|
||||
|
||||
echo $compat;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* get_attachments
|
||||
*
|
||||
* This function will return an array of attachments for a given field value
|
||||
*
|
||||
* @type function
|
||||
* @date 13/06/2014
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param $value (array)
|
||||
* @return $value
|
||||
*/
|
||||
|
||||
function get_attachments( $value ) {
|
||||
|
||||
// bail early if no value
|
||||
if( empty($value) ) return false;
|
||||
|
||||
|
||||
// force value to array
|
||||
$post__in = acf_get_array( $value );
|
||||
|
||||
|
||||
// get posts
|
||||
$posts = acf_get_posts(array(
|
||||
'post_type' => 'attachment',
|
||||
'post__in' => $post__in
|
||||
));
|
||||
|
||||
|
||||
// return
|
||||
return $posts;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -431,7 +464,6 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
|
||||
// vars
|
||||
$posts = array();
|
||||
$atts = array(
|
||||
'id' => $field['id'],
|
||||
'class' => "acf-gallery {$field['class']}",
|
||||
|
|
@ -440,6 +472,8 @@ class acf_field_gallery extends acf_field {
|
|||
'data-min' => $field['min'],
|
||||
'data-max' => $field['max'],
|
||||
'data-mime_types' => $field['mime_types'],
|
||||
'data-insert' => $field['insert'],
|
||||
'data-columns' => 4
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -449,83 +483,63 @@ class acf_field_gallery extends acf_field {
|
|||
$atts['style'] = "height:{$height}px";
|
||||
|
||||
|
||||
// load posts
|
||||
if( !empty($field['value']) ) {
|
||||
|
||||
$posts = acf_get_posts(array(
|
||||
'post_type' => 'attachment',
|
||||
'post__in' => $field['value']
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
// get posts
|
||||
$value = $this->get_attachments( $field['value'] );
|
||||
|
||||
?>
|
||||
<div <?php acf_esc_attr_e($atts); ?>>
|
||||
|
||||
<div class="acf-hidden">
|
||||
<input type="hidden" <?php acf_esc_attr_e(array( 'name' => $field['name'], 'value' => '', 'data-name' => 'ids' )); ?> />
|
||||
<?php acf_hidden_input(array( 'name' => $field['name'], 'value' => '' )); ?>
|
||||
</div>
|
||||
|
||||
<div class="acf-gallery-main">
|
||||
|
||||
<div class="acf-gallery-attachments">
|
||||
|
||||
<?php if( !empty($posts) ): ?>
|
||||
<?php if( $value ): ?>
|
||||
|
||||
<?php foreach( $value as $i => $v ):
|
||||
|
||||
// bail early if no value
|
||||
if( !$v ) continue;
|
||||
|
||||
<?php foreach( $posts as $post ):
|
||||
|
||||
// vars
|
||||
$type = acf_maybe_get(explode('/', $post->post_mime_type), 0);
|
||||
$thumb_id = $post->ID;
|
||||
$thumb_url = '';
|
||||
$thumb_class = 'acf-gallery-attachment acf-soh';
|
||||
$filename = wp_basename($post->guid);
|
||||
$a = array(
|
||||
'ID' => $v->ID,
|
||||
'title' => $v->post_title,
|
||||
'filename' => wp_basename($v->guid),
|
||||
'type' => acf_maybe_get(explode('/', $v->post_mime_type), 0),
|
||||
'class' => 'acf-gallery-attachment acf-soh'
|
||||
);
|
||||
|
||||
|
||||
// thumb
|
||||
if( $type === 'image' || $type === 'audio' || $type === 'video' ) {
|
||||
// thumbnail
|
||||
$thumbnail = acf_get_post_thumbnail($a['ID'], $field['preview_size']);
|
||||
|
||||
// change $thumb_id
|
||||
if( $type === 'audio' || $type === 'video' ) {
|
||||
|
||||
$thumb_id = get_post_thumbnail_id( $post->ID );
|
||||
// icon
|
||||
$a['class'] .= ' -' . $a['type'];
|
||||
|
||||
if( $thumbnail['type'] == 'icon' ) {
|
||||
|
||||
$a['class'] .= ' -icon';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// get attachment
|
||||
if( $thumb_id ) {
|
||||
|
||||
$thumb_url = wp_get_attachment_image_src( $thumb_id, $field['preview_size'] );
|
||||
$thumb_url = acf_maybe_get( $thumb_url, 0 );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// fallback
|
||||
if( !$thumb_url ) {
|
||||
|
||||
$thumb_url = wp_mime_type_icon( $post->ID );
|
||||
$thumb_class .= ' is-mime-icon';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="<?php echo $thumb_class; ?>" data-id="<?php echo $post->ID; ?>">
|
||||
<input type="hidden" name="<?php echo $field['name']; ?>[]" value="<?php echo $post->ID; ?>" />
|
||||
<div class="margin" title="<?php echo $filename; ?>">
|
||||
<div class="<?php echo $a['class']; ?>" data-id="<?php echo $a['ID']; ?>">
|
||||
<?php acf_hidden_input(array( 'name' => $field['name'].'[]', 'value' => $a['ID'] )); ?>
|
||||
<div class="margin">
|
||||
<div class="thumbnail">
|
||||
<img src="<?php echo $thumb_url; ?>"/>
|
||||
<img src="<?php echo $thumbnail['url']; ?>" alt="" title="<?php echo $a['title']; ?>"/>
|
||||
</div>
|
||||
<?php if( $type !== 'image' ): ?>
|
||||
<div class="filename"><?php echo acf_get_truncated($filename, 18); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="filename"><?php echo acf_get_truncated($a['filename'], 30); ?></div>
|
||||
</div>
|
||||
<div class="actions acf-soh-target">
|
||||
<a class="acf-icon -cancel dark remove-attachment" data-id="<?php echo $post->ID; ?>" href="#"></a>
|
||||
<a class="acf-icon -cancel dark acf-gallery-remove" href="#" data-id="<?php echo $a['ID']; ?>" title="<?php _e('Remove', 'acf'); ?>"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -540,10 +554,10 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
<ul class="acf-hl">
|
||||
<li>
|
||||
<a href="#" class="acf-button button button-primary add-attachment"><?php _e('Add to gallery', 'acf'); ?></a>
|
||||
<a href="#" class="acf-button button button-primary acf-gallery-add"><?php _e('Add to gallery', 'acf'); ?></a>
|
||||
</li>
|
||||
<li class="acf-fr">
|
||||
<select class="bulk-actions">
|
||||
<select class="acf-gallery-sort">
|
||||
<option value=""><?php _e('Bulk actions', 'acf'); ?></option>
|
||||
<option value="date"><?php _e('Sort by date uploaded', 'acf'); ?></option>
|
||||
<option value="modified"><?php _e('Sort by date modified', 'acf'); ?></option>
|
||||
|
|
@ -566,10 +580,10 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
<ul class="acf-hl">
|
||||
<li>
|
||||
<a href="#" class="acf-button button close-sidebar"><?php _e('Close', 'acf'); ?></a>
|
||||
<a href="#" class="acf-button button acf-gallery-close"><?php _e('Close', 'acf'); ?></a>
|
||||
</li>
|
||||
<li class="acf-fr">
|
||||
<a class="acf-button button button-primary update-attachment"><?php _e('Update', 'acf'); ?></a>
|
||||
<a class="acf-button button button-primary acf-gallery-update"><?php _e('Update', 'acf'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -613,11 +627,7 @@ class acf_field_gallery extends acf_field {
|
|||
|
||||
foreach( $clear as $k ) {
|
||||
|
||||
if( empty($field[$k]) ) {
|
||||
|
||||
$field[$k] = '';
|
||||
|
||||
}
|
||||
if( empty($field[$k]) ) $field[$k] = '';
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -650,6 +660,19 @@ class acf_field_gallery extends acf_field {
|
|||
));
|
||||
|
||||
|
||||
// insert
|
||||
acf_render_field_setting( $field, array(
|
||||
'label' => __('Insert','acf'),
|
||||
'instructions' => __('Specify where new attachments are added','acf'),
|
||||
'type' => 'select',
|
||||
'name' => 'insert',
|
||||
'choices' => array(
|
||||
'append' => __('Append to the end', 'acf'),
|
||||
'prepend' => __('Prepend to the beginning', 'acf')
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// library
|
||||
acf_render_field_setting( $field, array(
|
||||
'label' => __('Library','acf'),
|
||||
|
|
@ -760,20 +783,11 @@ class acf_field_gallery extends acf_field {
|
|||
function format_value( $value, $post_id, $field ) {
|
||||
|
||||
// bail early if no value
|
||||
if( empty($value) ) {
|
||||
|
||||
// return false as $value may be '' (from DB) which doesn't make much sense
|
||||
return false;
|
||||
|
||||
}
|
||||
if( empty($value) ) return false;
|
||||
|
||||
|
||||
// get posts
|
||||
$posts = acf_get_posts(array(
|
||||
'post_type' => 'attachment',
|
||||
'post__in' => $value,
|
||||
));
|
||||
|
||||
$posts = $this->get_attachments($value);
|
||||
|
||||
|
||||
// update value to include $post
|
||||
|
|
@ -825,6 +839,78 @@ class acf_field_gallery extends acf_field {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* update_value()
|
||||
*
|
||||
* This filter is appied to the $value before it is updated in the db
|
||||
*
|
||||
* @type filter
|
||||
* @since 3.6
|
||||
* @date 23/01/13
|
||||
*
|
||||
* @param $value - the value which will be saved in the database
|
||||
* @param $post_id - the $post_id of which the value will be saved
|
||||
* @param $field - the field array holding all the field options
|
||||
*
|
||||
* @return $value - the modified value
|
||||
*/
|
||||
|
||||
function update_value( $value, $post_id, $field ) {
|
||||
|
||||
// bail early if no value
|
||||
if( empty($value) || !is_array($value) ) return false;
|
||||
|
||||
|
||||
// loop
|
||||
foreach( $value as $i => $v ) {
|
||||
|
||||
$value[ $i ] = $this->update_single_value( $v );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* update_single_value()
|
||||
*
|
||||
* This filter is appied to the $value before it is updated in the db
|
||||
*
|
||||
* @type filter
|
||||
* @since 3.6
|
||||
* @date 23/01/13
|
||||
*
|
||||
* @param $value - the value which will be saved in the database
|
||||
* @param $post_id - the $post_id of which the value will be saved
|
||||
* @param $field - the field array holding all the field options
|
||||
*
|
||||
* @return $value - the modified value
|
||||
*/
|
||||
|
||||
function update_single_value( $value ) {
|
||||
|
||||
// numeric
|
||||
if( is_numeric($value) ) return $value;
|
||||
|
||||
|
||||
// array?
|
||||
if( is_array($value) && isset($value['ID']) ) return $value['ID'];
|
||||
|
||||
|
||||
// object?
|
||||
if( is_object($value) && isset($value->ID) ) return $value->ID;
|
||||
|
||||
|
||||
// return
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
new acf_field_gallery();
|
||||
|
|
|
|||
|
|
@ -594,6 +594,10 @@ class acf_field_repeater extends acf_field {
|
|||
$sub_field = $field['sub_fields'][ $j ];
|
||||
|
||||
|
||||
// update $sub_field name
|
||||
$sub_field['name'] = "{$field['name']}_{$i}_{$sub_field['name']}";
|
||||
|
||||
|
||||
// extract value
|
||||
$sub_value = acf_extract_var( $value[ $i ], $sub_field['key'] );
|
||||
|
||||
|
|
@ -603,7 +607,7 @@ class acf_field_repeater extends acf_field {
|
|||
|
||||
|
||||
// append to $row
|
||||
$value[ $i ][ $sub_field['name'] ] = $sub_value;
|
||||
$value[ $i ][ $sub_field['_name'] ] = $sub_value;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
102
readme.txt
102
readme.txt
|
|
@ -2,7 +2,7 @@
|
|||
Contributors: elliotcondon
|
||||
Tags: acf, advanced, custom, field, fields, custom field, custom fields, simple fields, magic fields, more fields, repeater, edit
|
||||
Requires at least: 3.6.0
|
||||
Tested up to: 4.4.0
|
||||
Tested up to: 4.5.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ Advanced Custom Fields is the perfect solution for any WordPress website which n
|
|||
* Repeater (ability to create repeatable blocks of fields!)
|
||||
* Flexible Content (ability to create flexible blocks of fields!)
|
||||
* Gallery (Add, edit and order multiple images in 1 simple field)
|
||||
* [Custom](http://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/) (Create your own field type!)
|
||||
* [Custom](https://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/) (Create your own field type!)
|
||||
|
||||
= Tested on =
|
||||
* Mac Firefox :)
|
||||
|
|
@ -59,16 +59,16 @@ Advanced Custom Fields is the perfect solution for any WordPress website which n
|
|||
* PC ie7 :S
|
||||
|
||||
= Website =
|
||||
http://www.advancedcustomfields.com/
|
||||
https://www.advancedcustomfields.com/
|
||||
|
||||
= Documentation =
|
||||
* [Getting Started](http://www.advancedcustomfields.com/resources/#getting-started)
|
||||
* [Field Types](http://www.advancedcustomfields.com/resources/#field-types)
|
||||
* [Functions](http://www.advancedcustomfields.com/resources/#functions)
|
||||
* [Actions](http://www.advancedcustomfields.com/resources/#actions)
|
||||
* [Filters](http://www.advancedcustomfields.com/resources/#filters)
|
||||
* [How to guides](http://www.advancedcustomfields.com/resources/#how-to)
|
||||
* [Tutorials](http://www.advancedcustomfields.com/resources/#tutorials)
|
||||
* [Getting Started](https://www.advancedcustomfields.com/resources/#getting-started)
|
||||
* [Field Types](https://www.advancedcustomfields.com/resources/#field-types)
|
||||
* [Functions](https://www.advancedcustomfields.com/resources/#functions)
|
||||
* [Actions](https://www.advancedcustomfields.com/resources/#actions)
|
||||
* [Filters](https://www.advancedcustomfields.com/resources/#filters)
|
||||
* [How to guides](https://www.advancedcustomfields.com/resources/#how-to)
|
||||
* [Tutorials](https://www.advancedcustomfields.com/resources/#tutorials)
|
||||
|
||||
= Bug Submission and Forum Support =
|
||||
http://support.advancedcustomfields.com/
|
||||
|
|
@ -101,11 +101,35 @@ http://support.advancedcustomfields.com/
|
|||
|
||||
3. The Page edit screen after creating the Advanced Custom Fields
|
||||
|
||||
4. Simple and intuitive API. Read the documentation at: http://www.advancedcustomfields.com/resources/
|
||||
4. Simple and intuitive API. Read the documentation at: https://www.advancedcustomfields.com/resources/
|
||||
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 5.3.8.1 =
|
||||
* Image field: Fixed JS bug causing errors when 'Uploaded to post' library setting is checked
|
||||
* File field: Same as above
|
||||
* Gallery field: Same as above
|
||||
* Flexible Content field: Fixed bug preventing `get_sub_field()` from working within 'layout_title' filter
|
||||
* Radio field: Fixed bug causing field name to change when adding 'other' choice to a sub field
|
||||
|
||||
= 5.3.8 =
|
||||
* Gallery field: Added new 'Insert' setting to control where new attachments are added
|
||||
* Radio field: Added new 'Allow Null' setting
|
||||
* Relationship field: Added attachment mime type icons when no thumbnail is available
|
||||
* Core: Fixed bug causing customizer preview values from loading on newly added widgets
|
||||
* Core: Improved attachments location rule for future compatibility with specific mime types
|
||||
* Core: Fixed bug causing select2 to appear blank after duplicating a field setting
|
||||
* Core: Fixed bug causing PHP error on front-end plugin update check
|
||||
* Core: Updated title elements (h1, h2, h3) to match WP 4.5
|
||||
* Core: Minor fixes and improvements
|
||||
* Core: Fixed bug where comment fields appeared in different locations for logged in/out users
|
||||
* Language: Updated Polish translation - thanks to Michal Lepiarz
|
||||
* Language: Updated Italian translation - thanks to Davide Pantè
|
||||
* Language: Updated Portuguese translation - thanks to Pedro Mendonca
|
||||
* Language: Updated Swiss German translation - thanks to Raphael Hüni
|
||||
* Language: Updated French Translation - thanks to Maxime Bernard-Jacquet
|
||||
|
||||
= 5.3.7 =
|
||||
* Options page: Added new 'update_button' setting to modify update button text
|
||||
* Options page: Added columns support (Screen Options)
|
||||
|
|
@ -356,7 +380,7 @@ http://support.advancedcustomfields.com/
|
|||
* Gallery field: Same as above
|
||||
* Message field: Added new `esc_html` setting to show HTML as plain text
|
||||
* Core: Fixed customizer issues when editing widgets
|
||||
* Core: Added new filter to validate upload - http://www.advancedcustomfields.com/resources/acfupload_prefilter/
|
||||
* Core: Added new filter to validate upload - https://www.advancedcustomfields.com/resources/acfupload_prefilter/
|
||||
* Core: Added file types (new field setting) to media popup select filter
|
||||
* Core: Added an edit field group link to metabox titles
|
||||
* Core: Added new `capability` setting for use in admin pages / CPT
|
||||
|
|
@ -386,7 +410,7 @@ http://support.advancedcustomfields.com/
|
|||
* Core: Fixed many field bugs in WP media grid popup
|
||||
* Core: Added new friendly field wrap classes: acf-field-{$type} acf-field-{$key}
|
||||
* Core: JS speed improvements due to new field wrap classes
|
||||
* Core: Added new filter for removing compatibility http://www.advancedcustomfields.com/resources/acfcompatibility/
|
||||
* Core: Added new filter for removing compatibility https://www.advancedcustomfields.com/resources/acfcompatibility/
|
||||
* Core: Minor fixes and improvements
|
||||
* Language: Updated German translation - thanks to Thomas Meyer
|
||||
|
||||
|
|
@ -788,7 +812,7 @@ http://support.advancedcustomfields.com/
|
|||
* [Fixed] Test / Fix field group duplication in WooCommerce category w SEO plugin - http://support.advancedcustomfields.com/discussion/5440/acf-woocommerce-product-category-taxonomy-bug
|
||||
|
||||
= 4.0.0 =
|
||||
* [IMPORTANT] This update contains major changes to premium and custom field type Add-ons. Please read the [Migrating from v3 to v4 guide](http://www.advancedcustomfields.com/resources/getting-started/migrating-from-v3-to-v4/)
|
||||
* [IMPORTANT] This update contains major changes to premium and custom field type Add-ons. Please read the [Migrating from v3 to v4 guide](https://www.advancedcustomfields.com/resources/getting-started/migrating-from-v3-to-v4/)
|
||||
* [Optimized] Optimize performance by removing heavy class structure and implementing light weight hooks & filters!
|
||||
* [Changed] Remove all Add-on code from the core plugin and separate into individual plugins with self hosted updates
|
||||
* [Added] Add field 'Taxonomy'
|
||||
|
|
@ -877,7 +901,7 @@ http://support.advancedcustomfields.com/
|
|||
* [Fixed] Fix bug preventing options pages from appearing in the field group's location rules
|
||||
|
||||
= 3.5.4 =
|
||||
* [Added] Add new filter for ACF settings - http://www.advancedcustomfields.com/docs/filters/acf_settings/
|
||||
* [Added] Add new filter for ACF settings - https://www.advancedcustomfields.com/docs/filters/acf_settings/
|
||||
* [Updated] Updated field keys to look nicer. eg field_12
|
||||
* [Added] Update admin_head to use hooks / enque all scripts / styles
|
||||
* [Added] Add duplicate function for flexible content layouts
|
||||
|
|
@ -1054,47 +1078,47 @@ http://support.advancedcustomfields.com/
|
|||
* [Added] Add new Czech translation - Thanks to Webees ( http://www.webees.cz/ )
|
||||
|
||||
= 3.2.8 =
|
||||
* [Added] Repeater - Add option for min rows + max rows - http://www.advancedcustomfields.com/support/discussion/2111/repeater-empty-conditional-statements#Item_4
|
||||
* [Added] Repeater - Add option for min rows + max rows - https://www.advancedcustomfields.com/support/discussion/2111/repeater-empty-conditional-statements#Item_4
|
||||
* [Fixed] Test / Fix Chrome Double WYSIWYG. Again...
|
||||
* [Added] Add "future" to post status options - http://advancedcustomfields.com/support/discussion/1975/changed-line-81-and-94-of-corefieldspost_object-to-show-future-entries
|
||||
* [Added] Make image sizes strings "Pretty" for preview size options
|
||||
* [Fixed] Test / Fix WYSIWYG insert image inside a repeater bug - http://www.advancedcustomfields.com/support/discussion/2404/problem-with-repeater-wysiwyg-fields-and-images
|
||||
* [Fixed] Test / Fix WYSIWYG insert image inside a repeater bug - https://www.advancedcustomfields.com/support/discussion/2404/problem-with-repeater-wysiwyg-fields-and-images
|
||||
|
||||
= 3.2.7 =
|
||||
* [Fixed] Rename controller classes - http://www.advancedcustomfields.com/support/discussion/2363/fatal-error-after-update-to-3.2.6
|
||||
* [Fixed] Rename controller classes - https://www.advancedcustomfields.com/support/discussion/2363/fatal-error-after-update-to-3.2.6
|
||||
* [Added] Add edit button to image / file fields
|
||||
* [Fixed] WYSIWYG toolbar buttons dissapearing in HTML tab mode
|
||||
|
||||
= 3.2.6 =
|
||||
* [Fixed] Fix flexible content inside repeater add extra row jquery bug - http://www.advancedcustomfields.com/support/discussion/2134/add-flexible-content-button-in-repeater-field-adds-new-repeater-row
|
||||
* [Added] Add suppress_filters to relationship field for WPML compatibility - http://www.advancedcustomfields.com/support/discussion/comment/5401#Comment_5401
|
||||
* [Added] Add new German translation - http://www.advancedcustomfields.com/support/discussion/2197/german-translation
|
||||
* [Fixed] Fix flexible content inside repeater add extra row jquery bug - https://www.advancedcustomfields.com/support/discussion/2134/add-flexible-content-button-in-repeater-field-adds-new-repeater-row
|
||||
* [Added] Add suppress_filters to relationship field for WPML compatibility - https://www.advancedcustomfields.com/support/discussion/comment/5401#Comment_5401
|
||||
* [Added] Add new German translation - https://www.advancedcustomfields.com/support/discussion/2197/german-translation
|
||||
* [Added] Add new Italian translation - Alessandro Mignogna (www.asernet.it)
|
||||
* [Added] Add new Japanese translation - http://www.advancedcustomfields.com/support/discussion/2219/japanese-translation
|
||||
* [Fixed] Test / Fix WYSIWYG removing p tags - http://www.advancedcustomfields.com/support/discussion/comment/5482#Comment_5482
|
||||
* [Added] Add new Japanese translation - https://www.advancedcustomfields.com/support/discussion/2219/japanese-translation
|
||||
* [Fixed] Test / Fix WYSIWYG removing p tags - https://www.advancedcustomfields.com/support/discussion/comment/5482#Comment_5482
|
||||
* [Added] edit basic toolbar buttons to match WP teeny mode - WYSIWYG
|
||||
* [Fixed] Test front end form hiding - http://www.advancedcustomfields.com/support/discussion/2226/frontend-form-disppears-on-acf-3.2.5
|
||||
* [Fixed] Test saving user custom fields - http://www.advancedcustomfields.com/support/discussion/2231/custom-fields-not-saving-data-on-initial-user-registration
|
||||
* [Fixed] Fix options page translation bug - http://www.advancedcustomfields.com/support/discussion/2098/change-language-and-options-page-fields-disappear
|
||||
* [Fixed] Pages rule not returning private pages - http://www.advancedcustomfields.com/support/discussion/2275/attach-field-group-to-privately-published-pages
|
||||
* [Added] Add custom add_image_size() Image field preview sizes - http://www.advancedcustomfields.com/support/discussion/comment/5800#Comment_5800
|
||||
* [Fixed] Test front end form hiding - https://www.advancedcustomfields.com/support/discussion/2226/frontend-form-disppears-on-acf-3.2.5
|
||||
* [Fixed] Test saving user custom fields - https://www.advancedcustomfields.com/support/discussion/2231/custom-fields-not-saving-data-on-initial-user-registration
|
||||
* [Fixed] Fix options page translation bug - https://www.advancedcustomfields.com/support/discussion/2098/change-language-and-options-page-fields-disappear
|
||||
* [Fixed] Pages rule not returning private pages - https://www.advancedcustomfields.com/support/discussion/2275/attach-field-group-to-privately-published-pages
|
||||
* [Added] Add custom add_image_size() Image field preview sizes - https://www.advancedcustomfields.com/support/discussion/comment/5800#Comment_5800
|
||||
|
||||
= 3.2.5 =
|
||||
* [IMPORTANT] Change field group option "Show on page" to "Hide on Screen" to allow for future proof adding new elements to list. Previously exported and registered field groups via PHP will still work as expected! This change will prompt you for a database upgrade.
|
||||
* [Added] Add in edit button to upload image / file thickbox
|
||||
* [Improved] Changed loading default values. Now behaves as expected!
|
||||
* [Fixed] Test / Fix full screen mode dissapearing from editor - http://www.advancedcustomfields.com/support/discussion/2124/full-screen-button-for-zen-mode-is-gone
|
||||
* [Fixed] Test / Fix full screen mode dissapearing from editor - https://www.advancedcustomfields.com/support/discussion/2124/full-screen-button-for-zen-mode-is-gone
|
||||
* [Fixed] get_field returning false for 0 - http://advancedcustomfields.com/support/discussion/2115/get_field-returns-false-if-field-has-value-0
|
||||
* [Improved] Improve relationship sortable code with item param - http://www.advancedcustomfields.com/support/discussion/comment/3536#Comment_3536
|
||||
* [Fixed] IE category js bug - http://www.advancedcustomfields.com/support/discussion/2127/ie-78-category-checkbox-bug
|
||||
* [Fixed] Flexible content field row css bug - http://www.advancedcustomfields.com/support/discussion/2126/space-between-fields-is-a-little-tight-in-3.2.33.2.4
|
||||
* [Fixed] Repeater row limit in flexible field bug - http://www.advancedcustomfields.com/support/discussion/1635/repeater-with-row-limit-of-1-inside-flexible-field-no-rows-show
|
||||
* [Improved] Improve relationship sortable code with item param - https://www.advancedcustomfields.com/support/discussion/comment/3536#Comment_3536
|
||||
* [Fixed] IE category js bug - https://www.advancedcustomfields.com/support/discussion/2127/ie-78-category-checkbox-bug
|
||||
* [Fixed] Flexible content field row css bug - https://www.advancedcustomfields.com/support/discussion/2126/space-between-fields-is-a-little-tight-in-3.2.33.2.4
|
||||
* [Fixed] Repeater row limit in flexible field bug - https://www.advancedcustomfields.com/support/discussion/1635/repeater-with-row-limit-of-1-inside-flexible-field-no-rows-show
|
||||
* [Fixed] Fix update message - appears on first activation
|
||||
* [Fixed] Fix options page sidebar drag area - no border needed
|
||||
* [Fixed] Fix export options page activation - http://www.advancedcustomfields.com/support/discussion/2112/options-page-not-working-in-functions.php
|
||||
* [Fixed] Fix export options page activation - https://www.advancedcustomfields.com/support/discussion/2112/options-page-not-working-in-functions.php
|
||||
|
||||
= 3.2.4 =
|
||||
* [Fixed] Remove translation from validation class - http://www.advancedcustomfields.com/support/discussion/2110/custom-validation-broken-in-other-languages
|
||||
* [Fixed] Remove translation from validation class - https://www.advancedcustomfields.com/support/discussion/2110/custom-validation-broken-in-other-languages
|
||||
* [Fixed] Test fix WYSIWYG insert media issues
|
||||
* [Added] Add Excerpt to the field group "show on page" options
|
||||
|
||||
|
|
@ -1103,14 +1127,14 @@ http://support.advancedcustomfields.com/
|
|||
* [Fixed] Wysiwyg in repeater not working
|
||||
* [Fixed] Remove Swedish translation until string / js bugs are fixed
|
||||
* [Fixed] Checkbox array value issue: http://wordpress.org/support/topic/plugin-advanced-custom-fields-php-warning-in-corefieldscheckboxphp?replies=6
|
||||
* [Added] Add inherit to relationship posts query - http://www.advancedcustomfields.com/support/discussion/comment/3826#Comment_3826
|
||||
* [Fixed] Relationship shows deleted posts - http://www.advancedcustomfields.com/support/discussion/2080/strange-behavior-of-relationship-field-trash-posts
|
||||
* [Added] Add inherit to relationship posts query - https://www.advancedcustomfields.com/support/discussion/comment/3826#Comment_3826
|
||||
* [Fixed] Relationship shows deleted posts - https://www.advancedcustomfields.com/support/discussion/2080/strange-behavior-of-relationship-field-trash-posts
|
||||
* [Fixed] Wysiwyg editor not working on taxonomy edit page
|
||||
|
||||
= 3.2.2 =
|
||||
* [Fixed] Fix layout bug: Nested repeaters of different layouts
|
||||
* [Fixed] Fix strip slashes bug
|
||||
* [Fixed] Fix nested repeater bug - http://www.advancedcustomfields.com/support/discussion/2068/latest-update-broken-editing-environment-
|
||||
* [Fixed] Fix nested repeater bug - https://www.advancedcustomfields.com/support/discussion/2068/latest-update-broken-editing-environment-
|
||||
* [Fixed] Test / Fix add multiple images to repeater
|
||||
|
||||
= 3.2.1 =
|
||||
|
|
@ -1430,7 +1454,7 @@ http://support.advancedcustomfields.com/
|
|||
== Upgrade Notice ==
|
||||
|
||||
= 5.2.7 =
|
||||
* Field class names have changed slightly in v5.2.7 from `field_type-{$type}` to `acf-field-{$type}`. This change was introduced to better optimise JS performance. The previous class names can be added back in with the following filter: http://www.advancedcustomfields.com/resources/acfcompatibility/
|
||||
* Field class names have changed slightly in v5.2.7 from `field_type-{$type}` to `acf-field-{$type}`. This change was introduced to better optimise JS performance. The previous class names can be added back in with the following filter: https://www.advancedcustomfields.com/resources/acfcompatibility/
|
||||
|
||||
= 3.0.0 =
|
||||
* Editor is broken in WordPress 3.3
|
||||
|
|
|
|||
Loading…
Reference in New Issue