Merge branch 'release/5.5.11' into develop

This commit is contained in:
Remco Tolsma 2017-04-11 09:23:09 +02:00
commit b3dd72138d
107 changed files with 2304 additions and 1529 deletions

15
acf.php
View File

@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com/
Description: Customise WordPress with powerful, professional and intuitive fields
Version: 5.5.10
Version: 5.5.11
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.5.10',
'version' => '5.5.11',
// urls
'basename' => plugin_basename( __FILE__ ),
@ -184,16 +184,13 @@ class acf {
function init() {
// bail early if a plugin called get_field early
// bail early if too early
// ensures all plugins have a chance to add fields, etc
if( !did_action('plugins_loaded') ) return;
// bail early if already init
if( acf_get_setting('init') ) return;
// only run once
acf_update_setting('init', true);
if( acf_has_done('init') ) return;
// vars
@ -559,4 +556,4 @@ acf();
endif; // class_exists check
?>
?>

View File

@ -232,4 +232,4 @@ function acf_get_admin_notices() {
}
?>
?>

View File

@ -1259,4 +1259,4 @@ new acf_admin_field_group();
endif;
?>
?>

View File

@ -803,4 +803,4 @@ new acf_admin_field_groups();
endif;
?>
?>

View File

@ -254,7 +254,9 @@ function acf_get_sites() {
// WP >= 4.6
if( function_exists('get_sites') ) {
$_sites = get_sites();
$_sites = get_sites(array(
'number' => 0
));
foreach( $_sites as $_site ) {
@ -266,7 +268,9 @@ function acf_get_sites() {
// WP < 4.6
} else {
$sites = wp_get_sites();
$sites = wp_get_sites(array(
'limit' => 0
));
}
@ -276,4 +280,4 @@ function acf_get_sites() {
}
?>
?>

View File

@ -501,4 +501,4 @@ function acf_update_550_taxonomy( $taxonomy ) { //acf_log('acf_update_550_taxono
}
?>
?>

View File

@ -104,7 +104,7 @@ class acf_admin_install {
/*
* admin_notices
*
* This function will render any admin notices
* This function will render the DB Upgrade notice
*
* @type function
* @date 17/10/13
@ -427,4 +427,4 @@ function acf_get_db_updates() {
}
?>
?>

View File

@ -120,4 +120,4 @@ class acf_settings_addons {
// initialize
new acf_settings_addons();
?>
?>

View File

@ -98,4 +98,4 @@ class acf_settings_info {
// initialize
new acf_settings_info();
?>
?>

View File

@ -453,4 +453,4 @@ class acf_settings_tools {
// initialize
new acf_settings_tools();
?>
?>

View File

@ -159,4 +159,4 @@ if( empty($groups) ) {
</div>
</td>
</tr>
</tr>

View File

@ -201,4 +201,4 @@ $atts['class'] = str_replace('_', '-', $atts['class']);
</table>
</div>
</div>
</div>

View File

@ -59,4 +59,4 @@ extract( $args );
</script>
<?php endif;?>
</div>
</div>

View File

@ -157,4 +157,4 @@ if( typeof acf !== 'undefined' ) {
});
}
</script>
</script>

View File

@ -143,4 +143,4 @@ if( typeof acf !== 'undefined' ) {
});
}
</script>
</script>

View File

@ -236,4 +236,4 @@ extract($args);
})(jQuery);
</script>
</div>
</div>

View File

@ -1,14 +1,27 @@
<?php
// defaults
$args = wp_parse_args($args, array(
'button_url' => '',
'button_text' => '',
'confirm' => true
));
// vars
$button_url = '';
$button_text = '';
$confirm = true;
// extract
extract($args);
// calculate add-ons (non pro only)
$plugins = array();
if( !acf_get_setting('pro') ) {
if( is_plugin_active('acf-repeater/acf-repeater.php') ) $plugins[] = __("Repeater",'acf');
if( is_plugin_active('acf-flexible-content/acf-flexible-content.php') ) $plugins[] = __("Flexible Content",'acf');
if( is_plugin_active('acf-gallery/acf-gallery.php') ) $plugins[] = __("Gallery",'acf');
if( is_plugin_active('acf-options-page/acf-options-page.php') ) $plugins[] = __("Options Page",'acf');
}
?>
<div id="acf-upgrade-notice" class="acf-cf">
@ -24,6 +37,10 @@ extract($args);
<p><?php printf(__("Thank you for updating to %s v%s!", 'acf'), acf_get_setting('name'), acf_get_setting('version') ); ?><br /><?php _e("Before you start using the new awesome features, please update your database to the newest version.", 'acf'); ?></p>
<?php if( !empty($plugins) ): ?>
<p><?php printf(__("Please also ensure any premium add-ons (%s) have first been updated to the latest version.", 'acf'), implode(', ', $plugins) ); ?></p>
<?php endif; ?>
<p><a id="acf-notice-action" href="<?php echo $button_url; ?>" class="button button-primary"><?php echo $button_text; ?></a></p>
<?php if( $confirm ): ?>
@ -45,4 +62,4 @@ extract($args);
</div>
</div>
</div>

View File

@ -111,4 +111,4 @@ extract($args);
<?php endif; ?>
</div>
</div>

View File

@ -57,4 +57,4 @@ $json = acf_extract_var( $args, 'json');
</div>
</div>
</div>

View File

@ -186,4 +186,4 @@ extract( $args );
<?php endif; ?>
</div>
</div>

View File

@ -109,4 +109,4 @@ $preg_replace = array(
})(jQuery);
</script>
</div>
</div>

View File

@ -95,4 +95,4 @@ if( $field_groups ) {
</div>
</div>
</div>

View File

@ -1185,4 +1185,4 @@ function acf_prepare_field_group_for_export( $field_group ) {
}
?>
?>

View File

@ -1026,57 +1026,49 @@ function _acf_get_field_by_name( $name = '', $db_only = false ) {
function acf_maybe_get_field( $selector, $post_id = false, $strict = true ) {
// complete init
// this function may be used in a theme file before the init action has been run
acf()->init();
// init
acf_init();
// vars
$field_name = false;
// bail early if is field key
if( acf_is_field_key($selector) ) {
return acf_get_field( $selector );
}
// save selector as field_name (could be sub field name 'images_0_image')
$field_name = $selector;
// get valid post_id
$post_id = acf_get_valid_post_id( $post_id );
// load field reference if not a field_key
if( !acf_is_field_key($selector) ) {
// get reference
$field_key = acf_get_field_reference( $selector, $post_id );
// update selector
if( $field_key ) {
// save selector as field_name (could be sub field name)
$field_name = $selector;
// get reference
$field_key = acf_get_field_reference( $selector, $post_id );
$selector = $field_key;
// bail early if no reference
} elseif( $strict ) {
if( $field_key ) {
$selector = $field_key;
} elseif( $strict ) {
return false;
}
return false;
}
// get field key
// get field
$field = acf_get_field( $selector );
// bail early if no field
if( !$field ) return false;
// Override name - allows the $selector to be a sub field (images_0_image)
if( $field_name ) {
$field['name'] = $field_name;
}
// update name
if( $field ) $field['name'] = $field_name;
// return
@ -1709,18 +1701,14 @@ function acf_prepare_fields_for_import( $fields = false ) {
$field = acf_prepare_field_for_import( $fields[ $i ] );
// ensure $field is an array of fields
// this allows for multiepl sub fields to be returned
if( acf_is_associative_array($field) ) {
// allow multiple fields to be returned ($field + $sub_fields)
if( acf_is_sequential_array($field) ) {
$field = array( $field );
// merge in $field (1 or more fields)
array_splice($fields, $i, 1, $field);
}
// merge in $field (1 or more fields)
array_splice($fields, $i, 1, $field);
// $i
$i++;

View File

@ -81,6 +81,26 @@ function acf_update_setting( $name, $value ) {
}
/*
* acf_init
*
* alias of acf()->init()
*
* @type function
* @date 28/09/13
* @since 5.0.0
*
* @param n/a
* @return n/a
*/
function acf_init() {
acf()->init();
}
/*
* acf_append_setting
*
@ -4159,12 +4179,17 @@ function acf_translate_keys( $array, $keys ) {
function acf_translate( $string ) {
// vars
$l10n = acf_get_setting('l10n');
$textdomain = acf_get_setting('l10n_textdomain');
// bail early if not enabled
if( !acf_get_setting('l10n') ) return $string;
if( !$l10n ) return $string;
// bail early if no textdomain
if( !acf_get_setting('l10n_textdomain') ) return $string;
if( !$textdomain ) return $string;
// is array
@ -4186,13 +4211,18 @@ function acf_translate( $string ) {
// allow for var_export export
if( acf_get_setting('l10n_var_export') ){
return "!!__(!!'" . $string . "!!', !!'" . acf_get_setting('l10n_textdomain') . "!!')!!";
// bail early if already translated
if( substr($string, 0, 7) === '!!__(!!' ) return $string;
// return
return "!!__(!!'" . $string . "!!', !!'" . $textdomain . "!!')!!";
}
// vars
return __( $string, acf_get_setting('l10n_textdomain') );
return __( $string, $textdomain );
}

View File

@ -323,7 +323,7 @@ function get_field_objects( $post_id = false, $format_value = true, $load_value
// get field
$field_key = $meta["_{$k}"][0];
$field = acf_get_field( $field_key );
$field = acf_maybe_get_field( $field_key );
// bail early if no field, or if the field's name is different to $k

View File

@ -348,7 +348,7 @@ function acf_update_value( $value = null, $post_id = 0, $field ) {
// filter for 3rd party customization
$value = apply_filters( "acf/update_value", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/type={$field['type']}", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/name={$field['name']}", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/name={$field['_name']}", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/key={$field['key']}", $value, $post_id, $field );
@ -518,4 +518,4 @@ function acf_preview_value( $value, $post_id, $field ) {
}
?>
?>

View File

@ -698,21 +698,6 @@ a.acf-icon.-cancel.grey:hover {
}
/*---------------------------------------------------------------------------------------------
*
* media-modal
*
*---------------------------------------------------------------------------------------------*/
/* media fix */
.media-modal .acf-field * {
box-sizing: border-box;
}
.media-modal .acf-table {
table-layout: auto;
}
.media-item .describe .acf-table > thead > tr > th {
width: auto;
}
/*---------------------------------------------------------------------------------------------
*
* wp-admin
*
*---------------------------------------------------------------------------------------------*/

View File

@ -1851,8 +1851,8 @@ html[dir="rtl"] .acf-taxonomy-field[data-type="select"] .acf-icon {
.media-modal.acf-expanded .acf-expand-details .is-closed {
display: none;
}
.media-modal.acf-expanded .media-toolbar,
.media-modal.acf-expanded .attachments {
.media-modal.acf-expanded .attachments-browser .media-toolbar,
.media-modal.acf-expanded .attachments-browser .attachments {
right: 740px;
}
.media-modal.acf-expanded .media-sidebar {
@ -1974,6 +1974,7 @@ body.major-4 .acf-media-modal.-edit .media-frame-content {
padding: 0 16px;
/* WP details */
/* ACF fields */
/* WP required message */
}
.acf-media-modal.-edit .media-sidebar .attachment-details {
overflow: visible;
@ -2010,6 +2011,9 @@ body.major-4 .acf-media-modal.-edit .media-frame-content {
.acf-media-modal.-edit .media-sidebar .compat-attachment-fields > tbody > .acf-field p.description {
margin-top: 3px;
}
.acf-media-modal.-edit .media-sidebar .media-types-required-info {
display: none;
}
@media (max-width: 900px) {
.acf-media-modal.-edit {
top: 30px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,4 +27,4 @@
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }

View File

@ -2,4 +2,4 @@
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1836,45 +1836,229 @@ var acf;
str_sanitize: function( string ) {
// vars
var string2 = '',
replace = {
'æ': 'a',
'å': 'a',
'á': 'a',
'ä': 'a',
'č': 'c',
'ď': 'd',
'è': 'e',
'é': 'e',
'ě': 'e',
'ë': 'e',
'í': 'i',
'ĺ': 'l',
'ľ': 'l',
'ň': 'n',
'ø': 'o',
'ó': 'o',
'ô': 'o',
'ő': 'o',
'ö': 'o',
'ŕ': 'r',
'š': 's',
'ť': 't',
'ú': 'u',
'ů': 'u',
'ű': 'u',
'ü': 'u',
'ý': 'y',
'ř': 'r',
'ž': 'z',
' ': '_',
// chars (https://jsperf.com/replace-foreign-characters)
var map = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Æ": "AE",
"Ç": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ý": "Y",
"ß": "s",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"æ": "ae",
"ç": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"ĝ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ŵ": "W",
"ŵ": "w",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
// extra
' ': '_',
'\'': '',
'?': '',
'/': '',
'\\': '',
'.': '',
',': '',
'`': '',
'>': '',
'<': '',
'"': '',
@ -1885,37 +2069,24 @@ var acf;
'}': '',
'(': '',
')': ''
};
};
// vars
var regexp = /\W/g,
mapping = function (c) { return (typeof map[c] !== 'undefined') ? map[c] : c; };
// lowercase
// replace
string = string.replace(regexp, mapping);
// lower case
string = string.toLowerCase();
// loop through characters
for( i = 0; i < string.length; i++ ) {
// character
var c = string.charAt(i);
// override c with replacement
if( typeof replace[c] !== 'undefined' ) {
c = replace[c];
}
// append
string2 += c;
}
// return
return string2;
return string;
},
@ -5417,17 +5588,27 @@ var acf;
get_file_info: function( $file_input, $hidden_input ){
// vars
var attachment = {};
var val = $file_input.val(),
attachment = {};
// bail early if no value
if( !val ) {
$hidden_input.val('');
return;
}
// url
attachment.url = $file_input.val();
attachment.url = val;
// modern browsers
var files = $file_input[0].files;
if( files ){
if( files.length ){
// vars
var file = files[0];
@ -5465,7 +5646,7 @@ var acf;
}
}
// set hidden input value
$hidden_input.val( jQuery.param(attachment) );
@ -5805,6 +5986,10 @@ var acf;
});
// action for 3rd party customization
acf.do_action('google_map_init', this.map, this.map.marker, this.$field);
// add to maps
this.maps[ this.o.id ] = this.map;
@ -7640,62 +7825,63 @@ var acf;
// extend
wp.media.view.AttachmentCompat = AttachmentCompat.extend({
add_acf_expand_button: function(){
// vars
var $el = this.$el.closest('.media-modal');
// does button already exist?
if( $el.find('.media-frame-router .acf-expand-details').exists() ) return;
// create button
var $a = $([
'<a href="#" class="acf-expand-details">',
'<span class="is-closed"><span class="acf-icon -left small grey"></span>' + acf._e('expand_details') + '</span>',
'<span class="is-open"><span class="acf-icon -right small grey"></span>' + acf._e('collapse_details') + '</span>',
'</a>'
].join(''));
// add events
$a.on('click', function( e ){
e.preventDefault();
if( $el.hasClass('acf-expanded') ) {
$el.removeClass('acf-expanded');
} else {
$el.addClass('acf-expanded');
}
});
// append
$el.find('.media-frame-router').append( $a );
},
render: function() {
// reference
var self = this;
// validate
if( this.ignore_render ) return this;
// add button
// reference
var self = this;
// add expand button
setTimeout(function(){
// vars
var $media_model = self.$el.closest('.media-modal');
self.add_acf_expand_button();
// does button already exist?
if( $media_model.find('.media-frame-router .acf-expand-details').exists() ) {
return;
}
// create button
var $a = $([
'<a href="#" class="acf-expand-details">',
'<span class="is-closed"><span class="acf-icon -left small grey"></span>' + acf._e('expand_details') + '</span>',
'<span class="is-open"><span class="acf-icon -right small grey"></span>' + acf._e('collapse_details') + '</span>',
'</a>'
].join(''));
// add events
$a.on('click', function( e ){
e.preventDefault();
if( $media_model.hasClass('acf-expanded') ) {
$media_model.removeClass('acf-expanded');
} else {
$media_model.addClass('acf-expanded');
}
});
// append
$media_model.find('.media-frame-router').append( $a );
}, 0);

File diff suppressed because one or more lines are too long

View File

@ -83,4 +83,4 @@ new acf_ajax();
endif;
?>
?>

View File

@ -296,4 +296,4 @@ function acf_delete_cache( $key = '' ) {
}
?>
?>

View File

@ -588,4 +588,4 @@ class acf_compatibility {
new acf_compatibility();
?>
?>

View File

@ -182,4 +182,4 @@ acf()->deprecated = new acf_deprecated();
endif; // class_exists check
?>
?>

View File

@ -428,4 +428,4 @@ function acf_field_type_exists( $type = '' ) {
}
?>
?>

View File

@ -6,6 +6,8 @@ if( ! class_exists('acf_fields') ) :
class acf_fields {
var $types = array();
/*
* __construct
@ -21,9 +23,8 @@ class acf_fields {
*/
function __construct() {
// vars
$this->types = array();
}
@ -135,4 +136,4 @@ function acf_get_field_type( $name ) {
}
?>
?>

View File

@ -694,4 +694,4 @@ function acf_register_form( $args ) {
}
?>
?>

View File

@ -253,4 +253,4 @@ function acf_delete_json_field_group( $key ) {
}
?>
?>

View File

@ -7,7 +7,8 @@ if( ! class_exists('acf_local') ) :
class acf_local {
// vars
var $temp = array(),
var $temp_groups = array(),
$temp_fields = array(),
$groups = array(),
$fields = array(),
$reference = array(),
@ -88,7 +89,8 @@ class acf_local {
function reset() {
// vars
$this->temp = array();
$this->temp_groups = array();
$this->temp_fields = array();
$this->groups = array();
$this->fields = array();
$this->reference = array();
@ -122,6 +124,84 @@ class acf_local {
}
/*
* is_ready
*
* This function will return true when ACF has included all field types and is ready to import
* Importing fields too early will cause issues where sub fields have not been extracted correctly
*
* @type function
* @date 13/3/17
* @since 5.5.10
*
* @param n/a
* @return (boolean)
*/
function is_ready() {
return did_action('acf/include_fields');
}
/*
* acf_include_fields
*
* This function include any $temp data
*
* @type function
* @date 8/2/17
* @since 5.5.6
*
* @param n/a
* @return n/a
*/
function acf_include_fields() {
// field groups
if( !empty($this->temp_groups) ) {
// loop
foreach( $this->temp_groups as $i => $temp ) {
// add
$this->add_field_group($temp);
// unset
unset($this->temp_groups[ $i ]);
}
}
// fields
if( !empty($this->temp_fields) ) {
// prepare
$this->temp_fields = acf_prepare_fields_for_import( $this->temp_fields );
// loop
foreach( $this->temp_fields as $i => $temp ) {
// add
$this->add_field($temp);
// unset
unset($this->temp_fields[ $i ]);
}
}
}
/*
* add_parent_reference
*
@ -178,6 +258,36 @@ class acf_local {
}
/*
* maybe_add_field
*
* This function will either import or add to temp
*
* @type function
* @date 9/2/17
* @since 5.5.6
*
* @param $field (array)
* @return n/a
*/
function maybe_add_field( $field ) {
// add
if( $this->is_ready() ) {
$this->add_field( $field );
// add to temp
} else {
$this->temp_fields[] = $field;
}
}
/*
* add_field
*
@ -344,74 +454,32 @@ class acf_local {
}
/*
* acf_include_fields
*
* This function include any $temp field groups during the 'acf/include_fields' action
*
* @type function
* @date 8/2/17
* @since 5.5.6
*
* @param n/a
* @return n/a
*/
function acf_include_fields() {
// bail ealry if no temp
if( empty($this->temp) ) return;
// loop
foreach( $this->temp as $i => $temp ) {
// add
$this->add_field_group($temp);
// unset
unset($this->temp[ $i ]);
}
}
/*
* maybe_add_field_group
*
* This function will determine if it is too early to 'add' a field group and if so will add to $temp
* Field groups added to $temp will be included during the 'acf/include_fields' action which ensures all field types exist
* This function will either import or add to temp
*
* @type function
* @date 9/2/17
* @since 5.5.6
*
* @param $post_id (int)
* @return $post_id (int)
* @param $field_group (array)
* @return n/a
*/
function maybe_add_field_group( $field_group ) {
// add to temp if too early
if( !did_action('acf/include_fields') ) {
// append
$this->temp[] = $field_group;
// return
return false;
}
// add
$this->add_field_group( $field_group );
if( $this->is_ready() ) {
$this->add_field_group( $field_group );
// return
return true;
// add to temp
} else {
$this->temp_groups[] = $field_group;
}
}
@ -865,7 +933,7 @@ function acf_add_local_field_group( $field_group ) {
function acf_remove_local_field_group( $key = '' ) {
// missing
return false;
}
@ -905,7 +973,7 @@ function acf_get_local_field_groups() {
// field
function acf_add_local_field( $field ) {
return acf_local()->add_field( $field );
return acf_local()->maybe_add_field( $field );
}
@ -974,4 +1042,4 @@ function register_field_group( $field_group ) {
}
?>
?>

View File

@ -1299,4 +1299,4 @@ function acf_get_field_group_visibility( $field_group, $args = array() ) {
return $visibility;
}
?>
?>

View File

@ -331,4 +331,4 @@ function acf_remove_loop( $i = 'active' ) {
}
?>
?>

View File

@ -242,4 +242,4 @@ class acf_media {
// initialize
new acf_media();
?>
?>

View File

@ -479,4 +479,4 @@ function acf_get_post_latest_revision( $post_id ) {
}
?>
?>

View File

@ -179,4 +179,4 @@ new acf_third_party();
endif;
?>
?>

View File

@ -407,4 +407,4 @@ function acf_refresh_plugin_updates_transient() {
}
?>
?>

View File

@ -481,4 +481,4 @@ class acf_wpml_compatibility {
new acf_wpml_compatibility();
?>
?>

View File

@ -385,6 +385,10 @@ class acf_field_checkbox extends acf_field {
if( isset($field['choices'][ $v ]) ) continue;
// unslash (fixes serialize single quote issue)
$v = wp_unslash($v);
// append
$field['choices'][ $v ] = $v;
@ -453,4 +457,4 @@ acf_register_field_type( new acf_field_checkbox() );
endif; // class_exists check
?>
?>

View File

@ -161,4 +161,4 @@ acf_register_field_type( new acf_field_color_picker() );
endif; // class_exists check
?>
?>

View File

@ -309,4 +309,4 @@ acf_register_field_type( new acf_field_date_picker() );
endif; // class_exists check
?>
?>

View File

@ -259,4 +259,4 @@ acf_register_field_type( new acf_field_date_and_time_picker() );
endif; // class_exists check
?>
?>

View File

@ -173,4 +173,4 @@ acf_register_field_type( new acf_field_email() );
endif; // class_exists check
?>
?>

View File

@ -457,4 +457,4 @@ acf_register_field_type( new acf_field_file() );
endif; // class_exists check
?>
?>

View File

@ -331,4 +331,4 @@ acf_register_field_type( new acf_field_google_map() );
endif; // class_exists check
?>
?>

View File

@ -487,4 +487,4 @@ acf_register_field_type( new acf_field_image() );
endif; // class_exists check
?>
?>

View File

@ -211,4 +211,4 @@ acf_register_field_type( new acf_field_message() );
endif; // class_exists check
?>
?>

View File

@ -318,4 +318,4 @@ acf_register_field_type( new acf_field_number() );
endif; // class_exists check
?>
?>

View File

@ -346,4 +346,4 @@ acf_register_field_type( new acf_field_oembed() );
endif; // class_exists check
?>
?>

View File

@ -88,4 +88,4 @@ acf_register_field_type( new acf_field_output() );
endif; // class_exists check
?>
?>

View File

@ -692,4 +692,4 @@ acf_register_field_type( new acf_field_page_link() );
endif; // class_exists check
?>
?>

View File

@ -164,4 +164,4 @@ acf_register_field_type( new acf_field_password() );
endif; // class_exists check
?>
?>

View File

@ -635,4 +635,4 @@ acf_register_field_type( new acf_field_post_object() );
endif; // class_exists check
?>
?>

View File

@ -383,6 +383,10 @@ class acf_field_radio extends acf_field {
if( !$field['ID'] ) return $value;
// unslash (fixes serialize single quote issue)
$value = wp_unslash($value);
// update $field
$field['choices'][ $value ] = $value;
@ -482,4 +486,4 @@ acf_register_field_type( new acf_field_radio() );
endif; // class_exists check
?>
?>

View File

@ -940,4 +940,4 @@ acf_register_field_type( new acf_field_relationship() );
endif; // class_exists check
?>
?>

View File

@ -741,4 +741,4 @@ acf_register_field_type( new acf_field_select() );
endif; // class_exists check
?>
?>

View File

@ -172,4 +172,4 @@ acf_register_field_type( new acf_field_tab() );
endif; // class_exists check
?>
?>

View File

@ -1065,4 +1065,4 @@ class acf_taxonomy_field_walker extends Walker {
endif;
?>
?>

View File

@ -191,4 +191,4 @@ acf_register_field_type( new acf_field_text() );
endif; // class_exists check
?>
?>

View File

@ -237,4 +237,4 @@ acf_register_field_type( new acf_field_textarea() );
endif; // class_exists check
?>
?>

View File

@ -181,4 +181,4 @@ acf_register_field_type( new acf_field_time_picker() );
endif; // class_exists check
?>
?>

View File

@ -281,4 +281,4 @@ acf_register_field_type( new acf_field_true_false() );
endif; // class_exists check
?>
?>

View File

@ -180,4 +180,4 @@ acf_register_field_type( new acf_field_url() );
endif; // class_exists check
?>
?>

View File

@ -598,4 +598,4 @@ acf_register_field_type( new acf_field_user() );
endif; // class_exists check
?>
?>

View File

@ -531,4 +531,4 @@ acf_register_field_type( new acf_field_wysiwyg() );
endif; // class_exists check
?>
?>

View File

@ -323,4 +323,4 @@ new acf_form_attachment();
endif;
?>
?>

View File

@ -341,4 +341,4 @@ new acf_form_comment();
endif;
?>
?>

View File

@ -608,4 +608,4 @@ new acf_form_post();
endif;
?>
?>

View File

@ -455,4 +455,4 @@ new acf_form_taxonomy();
endif;
?>
?>

View File

@ -408,4 +408,4 @@ new acf_form_user();
endif;
?>
?>

View File

@ -784,4 +784,4 @@ new acf_form_widget();
endif;
?>
?>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -167,4 +167,4 @@ new acf_pro();
// end class
endif;
?>
?>

View File

@ -1,6 +1,10 @@
<?php
class acf_pro_options_page {
if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if( ! class_exists('acf_admin_options_page') ) :
class acf_admin_options_page {
var $page;
@ -473,6 +477,9 @@ if( typeof acf !== 'undefined' ) {
}
new acf_pro_options_page();
// initialize
new acf_admin_options_page();
?>
endif; // class_exists check
?>

View File

@ -352,4 +352,4 @@ class acf_settings_updates {
// initialize
new acf_settings_updates();
?>
?>

View File

@ -47,4 +47,4 @@ extract($args);
</form>
</div>
</div>

View File

@ -143,4 +143,4 @@ $readonly = $active ? 1 : 0;
#acf-update-information td h4 {
display: none;
}
</style>
</style>

View File

@ -13,6 +13,8 @@
* @return $post_id (int)
*/
if( ! function_exists('acf_get_valid_options_page') ):
function acf_get_valid_options_page( $page = '' ) {
// allow for string
@ -91,6 +93,8 @@ function acf_get_valid_options_page( $page = '' ) {
}
endif;
/*
* acf_pro_get_option_page
@ -105,6 +109,8 @@ function acf_get_valid_options_page( $page = '' ) {
* @return $post_id (int)
*/
if( ! function_exists('acf_get_options_page') ):
function acf_get_options_page( $slug ) {
// bail early if page doens't exist
@ -128,6 +134,8 @@ function acf_get_options_page( $slug ) {
}
endif;
/*
* acf_pro_get_option_pages
@ -142,6 +150,8 @@ function acf_get_options_page( $slug ) {
* @return $post_id (int)
*/
if( ! function_exists('acf_get_options_pages') ):
function acf_get_options_pages() {
// global
@ -244,6 +254,8 @@ function acf_get_options_pages() {
}
endif;
/*
* acf_update_options_page
@ -258,6 +270,8 @@ function acf_get_options_pages() {
* @return $post_id (int)
*/
if( ! function_exists('acf_update_options_page') ):
function acf_update_options_page( $data ) {
// bail early if no menu_slug
@ -296,6 +310,8 @@ function acf_update_options_page( $data ) {
}
endif;
/*
* acf_add_options_page
@ -501,4 +517,4 @@ function register_options_page( $title = false ) {
endif;
?>
?>

View File

@ -387,4 +387,4 @@ function acf_pro_update_license( $key = '' ) {
}
?>
?>

Some files were not shown because too many files have changed in this diff Show More