Version Description
- Core: Minor fixes and improvements
Download this release
Release Info
Developer | elliotcondon |
Plugin | Advanced Custom Fields |
Version | 5.6.10 |
Comparing to | |
See all releases |
Code changes from version 5.6.9 to 5.6.10
- acf.php +17 -9
- assets/css/acf-input.css +22 -10
- assets/js/acf-field-group.js +9 -21
- assets/js/acf-field-group.min.js +1 -1
- assets/js/acf-input.js +301 -323
- assets/js/acf-input.min.js +3 -3
- includes/api/api-field.php +8 -3
- includes/api/api-helpers.php +87 -85
- includes/api/api-value.php +3 -3
- includes/fields/class-acf-field-file.php +14 -19
- lang/acf-zh_CN.mo +0 -0
- lang/acf-zh_CN.po +2 -2
- readme.txt +3 -0
acf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: https://www.advancedcustomfields.com/
|
5 |
Description: Customise WordPress with powerful, professional and intuitive fields.
|
6 |
-
Version: 5.6.
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
Copyright: Elliot Condon
|
@@ -18,7 +18,7 @@ if( ! class_exists('ACF') ) :
|
|
18 |
class ACF {
|
19 |
|
20 |
/** @var string The plugin version number */
|
21 |
-
var $version = '5.6.
|
22 |
|
23 |
/** @var array The plugin settings array */
|
24 |
var $settings = array();
|
@@ -66,17 +66,26 @@ class ACF {
|
|
66 |
function initialize() {
|
67 |
|
68 |
// vars
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
$this->settings = array(
|
70 |
|
71 |
// basic
|
72 |
'name' => __('Advanced Custom Fields', 'acf'),
|
73 |
-
'version' => $
|
74 |
|
75 |
// urls
|
76 |
'file' => __FILE__,
|
77 |
-
'basename' =>
|
78 |
-
'path' =>
|
79 |
-
'url' =>
|
|
|
80 |
|
81 |
// options
|
82 |
'show_admin' => true,
|
@@ -107,8 +116,8 @@ class ACF {
|
|
107 |
|
108 |
// constants
|
109 |
$this->define( 'ACF', true );
|
110 |
-
$this->define( 'ACF_VERSION', $
|
111 |
-
$this->define( 'ACF_PATH', $
|
112 |
|
113 |
|
114 |
// api
|
@@ -191,7 +200,6 @@ class ACF {
|
|
191 |
// filters
|
192 |
add_filter('posts_where', array($this, 'posts_where'), 10, 2 );
|
193 |
//add_filter('posts_request', array($this, 'posts_request'), 10, 1 );
|
194 |
-
|
195 |
}
|
196 |
|
197 |
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: https://www.advancedcustomfields.com/
|
5 |
Description: Customise WordPress with powerful, professional and intuitive fields.
|
6 |
+
Version: 5.6.10
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
Copyright: Elliot Condon
|
18 |
class ACF {
|
19 |
|
20 |
/** @var string The plugin version number */
|
21 |
+
var $version = '5.6.10';
|
22 |
|
23 |
/** @var array The plugin settings array */
|
24 |
var $settings = array();
|
66 |
function initialize() {
|
67 |
|
68 |
// vars
|
69 |
+
$version = $this->version;
|
70 |
+
$basename = plugin_basename( __FILE__ );
|
71 |
+
$path = plugin_dir_path( __FILE__ );
|
72 |
+
$url = plugin_dir_url( __FILE__ );
|
73 |
+
$slug = dirname($basename);
|
74 |
+
|
75 |
+
|
76 |
+
// settings
|
77 |
$this->settings = array(
|
78 |
|
79 |
// basic
|
80 |
'name' => __('Advanced Custom Fields', 'acf'),
|
81 |
+
'version' => $version,
|
82 |
|
83 |
// urls
|
84 |
'file' => __FILE__,
|
85 |
+
'basename' => $basename,
|
86 |
+
'path' => $path,
|
87 |
+
'url' => $url,
|
88 |
+
'slug' => $slug,
|
89 |
|
90 |
// options
|
91 |
'show_admin' => true,
|
116 |
|
117 |
// constants
|
118 |
$this->define( 'ACF', true );
|
119 |
+
$this->define( 'ACF_VERSION', $version );
|
120 |
+
$this->define( 'ACF_PATH', $path );
|
121 |
|
122 |
|
123 |
// api
|
200 |
// filters
|
201 |
add_filter('posts_where', array($this, 'posts_where'), 10, 2 );
|
202 |
//add_filter('posts_request', array($this, 'posts_request'), 10, 1 );
|
|
|
203 |
}
|
204 |
|
205 |
|
assets/css/acf-input.css
CHANGED
@@ -2670,14 +2670,26 @@ p.submit .acf-spinner {
|
|
2670 |
* Gutenberg
|
2671 |
*
|
2672 |
*--------------------------------------------------------------------------------------------*/
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2683 |
}
|
|
2670 |
* Gutenberg
|
2671 |
*
|
2672 |
*--------------------------------------------------------------------------------------------*/
|
2673 |
+
/*
|
2674 |
+
#editor {
|
2675 |
+
|
2676 |
+
.edit-post-layout__metaboxes {
|
2677 |
+
//border-top: none;
|
2678 |
+
}
|
2679 |
+
|
2680 |
+
.edit-post-meta-boxes-area {
|
2681 |
+
max-width: 80%;
|
2682 |
+
|
2683 |
+
.postbox {
|
2684 |
+
border: #e2e4e7 solid 1px;
|
2685 |
+
border-bottom: none;
|
2686 |
+
margin: 20px 0;
|
2687 |
+
}
|
2688 |
+
|
2689 |
+
input {
|
2690 |
+
max-width: none;
|
2691 |
+
}
|
2692 |
+
}
|
2693 |
+
|
2694 |
}
|
2695 |
+
*/
|
assets/js/acf-field-group.js
CHANGED
@@ -1252,41 +1252,29 @@
|
|
1252 |
|
1253 |
|
1254 |
// get settings
|
1255 |
-
var $settings = $tbody.children('.acf-field[data-setting="' + old_type + '"]')
|
1256 |
-
html = '';
|
1257 |
-
|
1258 |
-
|
1259 |
-
// populate settings html
|
1260 |
-
$settings.each(function(){
|
1261 |
-
|
1262 |
-
html += $(this).outerHTML();
|
1263 |
-
|
1264 |
-
});
|
1265 |
-
|
1266 |
-
|
1267 |
-
// remove settings
|
1268 |
-
$settings.remove();
|
1269 |
-
|
1270 |
|
1271 |
// save field settings html
|
1272 |
-
acf.update( key + '_settings_' + old_type,
|
1273 |
-
|
|
|
|
|
1274 |
|
1275 |
// render field
|
1276 |
this.render_field( $el );
|
1277 |
|
1278 |
|
1279 |
// show field options if they already exist
|
1280 |
-
|
1281 |
|
1282 |
-
if(
|
1283 |
|
1284 |
// append settings
|
1285 |
-
$tbody.children('.acf-field[data-name="conditional_logic"]').before(
|
1286 |
|
1287 |
|
1288 |
// remove field settings html
|
1289 |
-
acf.update( key + '_settings_' + new_type,
|
1290 |
|
1291 |
|
1292 |
// trigger event
|
1252 |
|
1253 |
|
1254 |
// get settings
|
1255 |
+
var $settings = $tbody.children('.acf-field[data-setting="' + old_type + '"]');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1256 |
|
1257 |
// save field settings html
|
1258 |
+
acf.update( key + '_settings_' + old_type, $settings );
|
1259 |
+
|
1260 |
+
// remove settings
|
1261 |
+
$settings.detach();
|
1262 |
|
1263 |
// render field
|
1264 |
this.render_field( $el );
|
1265 |
|
1266 |
|
1267 |
// show field options if they already exist
|
1268 |
+
$newettings = acf.get( key + '_settings_' + new_type );
|
1269 |
|
1270 |
+
if( $newettings ) {
|
1271 |
|
1272 |
// append settings
|
1273 |
+
$tbody.children('.acf-field[data-name="conditional_logic"]').before( $newettings );
|
1274 |
|
1275 |
|
1276 |
// remove field settings html
|
1277 |
+
acf.update( key + '_settings_' + new_type, false );
|
1278 |
|
1279 |
|
1280 |
// trigger event
|
assets/js/acf-field-group.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){acf.field_group=acf.model.extend({$fields:null,$locations:null,$options:null,actions:{ready:"init"},events:{"submit #post":"submit",'click a[href="#"]':"preventDefault","click .submitdelete":"trash","mouseenter .acf-field-list":"sortable"},init:function(){this.$fields=$("#acf-field-group-fields"),this.$locations=$("#acf-field-group-locations"),this.$options=$("#acf-field-group-options"),acf.validation.active=0},sortable:function(e){if(!e.$el.hasClass("ui-sortable")){var t=this;e.$el.sortable({handle:".acf-sortable-handle",connectWith:".acf-field-list",start:function(e,t){t.placeholder.height(t.item.height())},update:function(e,i){var a=i.item;t.render_fields(),acf.do_action("sortstop",a)}})}},preventDefault:function(e){e.preventDefault()},get_selector:function(e){e=e||"";var t=".acf-field-object";return e&&(t+="-"+e,t=t.split("_").join("-")),t},render_fields:function(){var e=this;$(".acf-field-list").each(function(){var t=$(this).children(".acf-field-object");t.each(function(t){e.update_field_meta($(this),"menu_order",t),$(this).children(".handle").find(".acf-icon").html(t+1)}),t.exists()?$(this).children(".no-fields-message").hide():$(this).children(".no-fields-message").show()})},get_field_meta:function(e,t){var i=e.find("> .meta > .input-"+t);return!!i.exists()&&i.val()},update_field_meta:function(e,t,i){var a=e.find("> .meta > .input-"+t);if(!a.exists()){var n=e.find("> .meta > .input-ID").outerHTML();n=acf.str_replace("ID",t,n),a=$(n),a.val(i),e.children(".meta").append(a)}a.val()!=i&&(a.val(i),"save"!=t&&this.save_field(e,"meta"))},delete_field_meta:function(e,t){var i=e.find("> .meta > .input-"+t);i.exists()&&(i.remove(),this.save_field(e,"meta"))},save_field:function(e,t){t=t||"settings";var i=this.get_field_meta(e,"save");"settings"!=i&&i!=t&&(this.update_field_meta(e,"save",t),acf.do_action("save_field",e,t))},submit:function(e){var t=this,i=$("#titlewrap #title");i.val()||(e.preventDefault(),acf.validation.toggle(e.$el,"unlock"),alert(acf._e("title_is_required")),i.focus()),$(".acf-field-object").each(function(){var e=t.get_field_meta($(this),"save"),i=t.get_field_meta($(this),"ID");$(this).hasClass("open")&&t.close_field($(this)),"settings"==e||("meta"==e?$(this).children(".settings").find('[name^="acf_fields['+i+']"]').remove():$(this).find('[name^="acf_fields['+i+']"]').remove())})},trash:function(e){confirm(acf._e("move_to_trash"))||e.preventDefault()},render_field:function(e){var t=e.find(".field-label:first").val(),i=e.find(".field-name:first").val(),a=e.find(".field-type:first option:selected").text(),n=e.find(".field-required:first").prop("checked"),d=e.children(".handle");d.find(".li-field-label strong a").html(t),d.find(".li-field-label .acf-required").remove(),n&&d.find(".li-field-label strong").append('<span class="acf-required">*</span>'),d.find(".li-field-name").text(i),d.find(".li-field-type").text(a),acf.do_action("render_field_handle",e,d)},edit_field:function(e){e.hasClass("open")?this.close_field(e):this.open_field(e)},open_field:function(e){if(e.hasClass("open"))return!1;e.addClass("open"),acf.do_action("open_field",e),e.children(".settings").animate({height:"toggle"},250)},close_field:function(e){if(!e.hasClass("open"))return!1;e.removeClass("open"),acf.do_action("close_field",e),e.children(".settings").animate({height:"toggle"},250)},wipe_field:function(e){var t=e.attr("data-id"),i=e.attr("data-key"),a=acf.get_uniqid(),n="field_"+a;e.attr("data-id",a),e.attr("data-key",n),e.attr("data-orig",i),this.update_field_meta(e,"ID",""),this.update_field_meta(e,"key",n),e.find('[id*="'+t+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(t,a))}),e.find('[name*="'+t+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(t,a))}),e.find("> .handle .pre-field-key").text(n),e.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("wipe_field",e)},add_field:function(e){var t=$($("#tmpl-acf-field").html()),i=t.find(".field-label:first"),a=t.find(".field-name:first");this.wipe_field(t),e.append(t),i.val(""),a.val(""),setTimeout(function(){i.focus()},251),this.render_fields(),acf.do_action("append",t),this.edit_field(t),acf.do_action("add_field",t)},duplicate_field:function(e){acf.do_action("before_duplicate",e);var t=e.clone(),i=t.find(".field-label:first"),a=t.find(".field-name:first");acf.do_action("remove",t),this.wipe_field(t),acf.do_action("after_duplicate",e,t),e.after(t),acf.do_action("append",t),setTimeout(function(){i.focus()},251),this.render_fields(),e.hasClass("open")?this.close_field(e):this.open_field(t);var n=i.val(),d=a.val(),l=d.split("_").pop(),f=acf._e("copy");if(0===l.indexOf(f)){var c=1*l.replace(f,"");c=c?c+1:2,n=n.replace(l,f+c),d=d.replace(l,f+c)}else n+=" ("+f+")",d+="_"+f;return i.val(n),a.val(d),this.save_field(t),this.render_field(t),acf.do_action("duplicate_field",t),t},move_field:function(e){var t=this,i=acf.prepare_for_ajax({action:"acf/field_group/move_field",field_id:this.get_field_meta(e,"ID")}),a=!1;if(i.field_id?"settings"==this.get_field_meta(e,"save")?a=!0:e.find(".acf-field-object").each(function(){if(!t.get_field_meta($(this),"ID"))return a=!0,!1;"settings"==t.get_field_meta($(this),"save")&&(a=!0)}):a=!0,a)return void alert(acf._e("move_field_warning"));acf.open_popup({title:acf._e("move_field"),loading:!0,height:145}),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(i){t.move_field_confirm(e,i)}})},move_field_confirm:function(e,t){var i=this;acf.update_popup({content:t});var a=acf.prepare_for_ajax({action:"acf/field_group/move_field",field_id:this.get_field_meta(e,"ID"),field_group_id:0});$("#acf-move-field-form").on("submit",function(){return a.field_group_id=$(this).find("select").val(),$.ajax({url:acf.get("ajaxurl"),data:a,type:"post",dataType:"html",success:function(t){acf.update_popup({content:t}),i.remove_field(e)}}),!1})},delete_field:function(e,t){t=t||!0;var i=this.get_field_meta(e,"ID");if(i){var a=$("#_acf_delete_fields");a.val(a.val()+"|"+i)}acf.do_action("delete_field",e),t&&this.remove_field(e)},remove_field:function(e){var t=this,i=e.closest(".acf-field-list");e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap('<div class="temp-field-wrap" style="height:'+e.height()+'px"></div>'),e.animate({opacity:0},250);var a=0,n=!1;i.children(".acf-field-object").length||(n=i.children(".no-fields-message"),a=n.outerHeight()),e.parent(".temp-field-wrap").animate({height:a},250,function(){n&&n.show(),acf.do_action("remove",$(this)),$(this).remove(),t.render_fields()})},change_field_type:function(e){var t=e.closest("tbody"),i=t.closest(".acf-field-object"),a=i.parent().closest(".acf-field-object"),n=i.attr("data-key"),d=i.attr("data-type"),l=e.val();i.removeClass("acf-field-object-"+acf.str_replace("_","-",d)),i.addClass("acf-field-object-"+acf.str_replace("_","-",l)),i.attr("data-type",l),i.data("type",l),i.data("xhr")&&i.data("xhr").abort();var f=t.children('.acf-field[data-setting="'+d+'"]'),c="";if(f.each(function(){c+=$(this).outerHTML()}),f.remove(),acf.update(n+"_settings_"+d,c),this.render_field(i),c=acf.get(n+"_settings_"+l))return t.children('.acf-field[data-name="conditional_logic"]').before(c),acf.update(n+"_settings_"+l,""),void acf.do_action("change_field_type",i);var r=$('<tr class="acf-field"><td class="acf-label"></td><td class="acf-input"><div class="acf-loading"></div></td></tr>');t.children('.acf-field[data-name="conditional_logic"]').before(r);var o={action:"acf/field_group/render_field_settings",nonce:acf.o.nonce,parent:acf.o.post_id,field_group:acf.o.post_id,prefix:e.attr("name").replace("[type]",""),type:l};a.exists()&&(o.parent=this.get_field_meta(a,"ID"));var s=$.ajax({url:acf.o.ajaxurl,data:o,type:"post",dataType:"html",success:function(e){if(e){var t=$(e);r.after(t),acf.do_action("append",t),acf.do_action("change_field_type",i)}},complete:function(){r.remove()}});i.data("xhr",s)},change_field_label:function(e){var t=e.find(".field-label:first"),i=e.find(".field-name:first"),a=e.attr("data-type");if(""==i.val()){var n=t.val();n=acf.str_sanitize(n),i.val(n).trigger("change")}this.render_field(e),acf.do_action("change_field_label",e)},change_field_name:function(e){var t=e.find(".field-name:first");"field_"===t.val().substr(0,6)&&(alert(acf._e("field_name_start")),setTimeout(function(){t.focus()},1)),acf.do_action("change_field_name",e)}}),acf.field_group.field=acf.model.extend({events:{"click .edit-field":"edit","click .duplicate-field":"duplicate","click .move-field":"move","click .delete-field":"delete","click .add-field":"add","change .field-type":"change_type","blur .field-label":"change_label","blur .field-name":"change_name","keyup .field-label":"render","keyup .field-name":"render","change .field-required":"render","change .acf-field-object input":"save","change .acf-field-object textarea":"save","change .acf-field-object select":"save"},event:function(e){return e.$field=e.$el.closest(".acf-field-object"),e},edit:function(e){acf.field_group.edit_field(e.$field)},duplicate:function(e){acf.field_group.duplicate_field(e.$field)},move:function(e){acf.field_group.move_field(e.$field)},delete:function(e){acf.field_group.delete_field(e.$field)},add:function(e){var t=e.$el.closest(".acf-field-list-wrap").children(".acf-field-list");acf.field_group.add_field(t)},change_type:function(e){acf.field_group.change_field_type(e.$el)},change_label:function(e){acf.field_group.change_field_label(e.$field)},change_name:function(e){acf.field_group.change_field_name(e.$field)},render:function(e){acf.field_group.render_field(e.$field)},save:function(e){acf.field_group.save_field(e.$field)}}),acf.field_group.conditional_logic=acf.model.extend({actions:{open_field:"render_field",change_field_label:"render_fields",change_field_type:"render_fields"},events:{"click .add-conditional-rule":"add_rule","click .add-conditional-group":"add_group","click .remove-conditional-rule":"remove_rule","change .conditional-toggle":"change_toggle","change .conditional-rule-param":"change_param"},render_fields:function(){var e=this;$(".acf-field-object.open").each(function(){e.render_field($(this))})},render_field:function(e){var t=this,i=e.attr("data-key"),a=e.parents(".acf-field-list"),n=e.find(".acf-field-setting-conditional_logic:last"),d=[];$.each(a,function(e){var t=0==e?acf._e("sibling_fields"):acf._e("parent_fields");$(this).children(".acf-field-object").each(function(){var e=$(this),a=e.attr("data-key"),n=e.attr("data-type"),l=e.find(".field-label:first").val();-1!==$.inArray(n,["select","checkbox","true_false","radio","button_group"])&&a!=i&&d.push({value:a,label:l,group:t})})}),d.length||d.push({value:"",label:acf._e("no_fields")}),n.find(".rule").each(function(){t.render_rule($(this),d)})},render_rule:function(e,t){var i=e.find(".conditional-rule-param"),a=e.find(".conditional-rule-value");t&&acf.render_select(i,t);var n=$('.acf-field-object[data-key="'+i.val()+'"]'),d=n.attr("data-type"),l=[];if("true_false"==d)l.push({value:1,label:acf._e("checked")});else if("select"==d||"checkbox"==d||"radio"==d||"button_group"==d){var f=n.find('.acf-field[data-name="choices"] textarea').val().split("\n");$.each(f,function(e,t){t=t.split(":"),t[1]=t[1]||t[0],l.push({value:$.trim(t[0]),label:$.trim(t[1])})});var c=n.find('.acf-field[data-name="allow_null"]');c.exists()&&"1"==c.find("input:checked").val()&&l.unshift({value:"",label:acf._e("null")})}acf.render_select(a,l)},change_toggle:function(e){var t=e.$el,i=e.$el.prop("checked"),a=t.closest(".acf-input");i?(a.find(".rule-groups").show(),a.find(".rule-groups").find("[name]").prop("disabled",!1)):(a.find(".rule-groups").hide(),a.find(".rule-groups").find("[name]").prop("disabled",!0))},change_param:function(e){var t=e.$el.closest(".rule");this.render_rule(t)},add_rule:function(e){var t=e.$el.closest("tr");$tr2=acf.duplicate(t),$tr2.find("select:first").trigger("change")},remove_rule:function(e){var t=e.$el.closest("tr");t.find("select:first").trigger("change"),0==t.siblings("tr").length&&t.closest(".rule-group").remove(),t.remove()},add_group:function(e){var t=e.$el.closest(".rule-groups"),i=t.find(".rule-group:last");$group2=acf.duplicate(i),$group2.find("h4").text(acf._e("or")),$group2.find("tr:not(:first)").remove(),$group2.find("select:first").trigger("change")}}),acf.field_group.locations=acf.model.extend({events:{"click .add-location-rule":"add_rule","click .add-location-group":"add_group","click .remove-location-rule":"remove_rule","change .refresh-location-rule":"change_rule"},add_rule:function(e){var t=e.$el.closest("tr");$tr2=acf.duplicate(t)},remove_rule:function(e){var t=e.$el.closest("tr");0==t.siblings("tr").length?t.closest(".rule-group").remove():t.remove()},add_group:function(e){var t=e.$el.closest(".rule-groups"),i=t.find(".rule-group:last");$group2=acf.duplicate(i),$group2.find("h4").text(acf._e("or")),$group2.find("tr:not(:first)").remove()},change_rule:function(e){var t=e.$el.closest("tr"),i=t.closest(".rule-group"),a=t.find("td.param select").attr("name").replace("[param]",""),n={action:"acf/field_group/render_location_rule",rule:acf.serialize(t,a)};n.rule.id=t.attr("data-id"),n.rule.group=i.attr("data-id"),$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(n),type:"post",dataType:"html",success:function(e){e&&t.replaceWith(e)}})}}),acf.field_group.field_object=acf.model.extend({type:"",o:{},$field:null,$settings:null,tag:function(e){var t=this.type,i=e.split("_");return i.splice(1,0,"field"),e=i.join("_"),t&&(e+="/type="+t),e},selector:function(){var e=".acf-field-object",t=this.type;return t&&(e+="-"+t,e=acf.str_replace("_","-",e)),e},_add_action:function(e,t){var i=this;acf.add_action(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;acf.add_filter(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),d=this.selector();$(document).on(a,d+" "+n,function(e){e.$el=$(this),e.$field=e.$el.closest(".acf-field-object"),i.set("$field",e.$field),i[t].apply(i,[e])})},_set_$field:function(){this.o=this.$field.data(),this.$settings=this.$field.find("> .settings > table > tbody"),this.focus()},focus:function(){},setting:function(e){return this.$settings.find("> .acf-field-setting-"+e)}}),acf.field_group.field_objects=acf.model.extend({actions:{save_field:"_save_field",open_field:"_open_field",close_field:"_close_field",wipe_field:"_wipe_field",add_field:"_add_field",duplicate_field:"_duplicate_field",delete_field:"_delete_field",change_field_type:"_change_field_type",change_field_label:"_change_field_label",change_field_name:"_change_field_name",render_field_settings:"_render_field_settings"},_save_field:function(e){acf.do_action("save_field/type="+e.data("type"),e)},_open_field:function(e){acf.do_action("open_field/type="+e.data("type"),e),acf.do_action("render_field_settings",e)},_close_field:function(e){acf.do_action("close_field/type="+e.data("type"),e)},_wipe_field:function(e){acf.do_action("wipe_field/type="+e.data("type"),e)},_add_field:function(e){acf.do_action("add_field/type="+e.data("type"),e)},_duplicate_field:function(e){acf.do_action("duplicate_field/type="+e.data("type"),e)},_delete_field:function(e){acf.do_action("delete_field/type="+e.data("type"),e)},_change_field_type:function(e){acf.do_action("change_field_type/type="+e.data("type"),e),acf.do_action("render_field_settings",e)},_change_field_label:function(e){acf.do_action("change_field_label/type="+e.data("type"),e)},_change_field_name:function(e){acf.do_action("change_field_name/type="+e.data("type"),e)},_render_field_settings:function(e){acf.do_action("render_field_settings/type="+e.data("type"),e)}}),acf.field_group.append=acf.model.extend({actions:{render_field_settings:"_render_field_settings"},render:function(e){var t=e.data("append");if($sibling=e.siblings('[data-name="'+t+'"]'),$sibling.exists()){var i=$sibling.children(".acf-input"),a=i.children(".acf-hl");a.exists()||(i.wrapInner('<ul class="acf-hl"><li></li></ul>'),a=i.children(".acf-hl"));var n=$("<li></li>").append(e.children(".acf-input").children());a.append(n),a.attr("data-cols",a.children().length),e.remove()}},_render_field_settings:function(e){var t=this;e.find(".acf-field[data-append]").each(function(){t.render($(this))})}});var e=acf.field_group.field_object.extend({type:"select",actions:{render_settings:"render"},events:{"change .acf-field-setting-ui input":"render"},render:function(e){this.setting('ui input[type="checkbox"]').prop("checked")?this.setting("ajax").show():(this.setting("ajax").hide(),this.setting('ajax input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),t=acf.field_group.field_object.extend({type:"radio",actions:{render_settings:"render"},events:{"change .acf-field-setting-other_choice input":"render"},render:function(e){this.setting('other_choice input[type="checkbox"]').prop("checked")?this.setting("save_other_choice").show():(this.setting("save_other_choice").hide(),this.setting('save_other_choice input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),i=acf.field_group.field_object.extend({type:"checkbox",actions:{render_settings:"render"},events:{"change .acf-field-setting-allow_custom input":"render"},render:function(e){this.setting('allow_custom input[type="checkbox"]').prop("checked")?this.setting("save_custom").show():(this.setting("save_custom").hide(),this.setting('save_custom input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),a=acf.field_group.field_object.extend({type:"true_false",actions:{render_settings:"render"},events:{"change .acf-field-setting-ui input":"render"},render:function(e){this.setting('ui input[type="checkbox"]').prop("checked")?(this.setting("ui_on_text").show(),this.setting("ui_off_text").show()):(this.setting("ui_on_text").hide(),this.setting("ui_off_text").hide())}}),n=acf.field_group.field_object.extend({type:"date_picker",actions:{render_settings:"render"},events:{"change .acf-field-setting-display_format input":"render","change .acf-field-setting-return_format input":"render"},render:function(e){this.render_list(this.setting("display_format")),this.render_list(this.setting("return_format"))},render_list:function(e){var t=e.find("ul"),i=t.find('input[type="radio"]:checked'),a=t.find('input[type="text"]');"other"!=i.val()&&a.val(i.val())}}),d=n.extend({type:"date_time_picker"}),d=n.extend({type:"time_picker"}),l=acf.field_group.field_object.extend({type:"tab",actions:{render_settings:"render"},render:function(e){this.setting("name input").val("").trigger("change"),this.setting('required input[type="checkbox"]').prop("checked",!1).trigger("change")}}),f=l.extend({type:"message"});acf.field_group.screen=acf.model.extend({actions:{ready:"ready"},events:{"click #acf-field-key-hide":"toggle"},ready:function(){var e=$("#adv-settings"),t=e.find("#acf-append-show-on-screen");e.find(".metabox-prefs").append(t.html()),e.find(".metabox-prefs br").remove(),t.remove(),this.render()},toggle:function(e){var t=e.$el.prop("checked")?1:0;acf.update_user_setting("show_field_keys",t),this.render()},render:function(){var e=acf.serialize($("#adv-settings")),t=acf.field_group.$fields;e.show_field_keys?t.addClass("show-field-keys"):t.removeClass("show-field-keys")}}),acf.field_group.sub_fields=acf.model.extend({actions:{open_field:"update_field_parent",sortstop:"update_field_parent",duplicate_field:"duplicate_field",delete_field:"delete_field",change_field_type:"change_field_type"},fix_conditional_logic:function(e){var t={};e.each(function(){t[$(this).attr("data-orig")]=$(this).attr("data-key")}),e.find(".conditional-rule-param").each(function(){var e=$(this).val();e in t&&($(this).find('option[value="'+t[e]+'"]').exists()||$(this).append('<option value="'+t[e]+'">'+t[e]+"</option>"),$(this).val(t[e]))})},update_field_parent:function(e){if(e.hasClass("acf-field-object")){var t=e.parent().closest(".acf-field-object"),i=acf.get("post_id");t.exists()&&((i=acf.field_group.get_field_meta(t,"ID"))||(i=acf.field_group.get_field_meta(t,"key"))),acf.field_group.update_field_meta(e,"parent",i),acf.do_action("update_field_parent",e,t)}},duplicate_field:function(e){var t=e.find(".acf-field-object");t.exists()&&(t.each(function(){var e=$(this).parent().closest(".acf-field-object"),t=acf.field_group.get_field_meta(e,"key");acf.field_group.wipe_field($(this)),acf.field_group.update_field_meta($(this),"parent",t),acf.field_group.save_field($(this))}),this.fix_conditional_logic(t))},delete_field:function(e){e.find(".acf-field-object").each(function(){acf.field_group.delete_field($(this),!1)})},change_field_type:function(e){e.find(".acf-field-object").each(function(){acf.field_group.delete_field($(this),!1)})}})}(jQuery);
|
1 |
+
!function($){acf.field_group=acf.model.extend({$fields:null,$locations:null,$options:null,actions:{ready:"init"},events:{"submit #post":"submit",'click a[href="#"]':"preventDefault","click .submitdelete":"trash","mouseenter .acf-field-list":"sortable"},init:function(){this.$fields=$("#acf-field-group-fields"),this.$locations=$("#acf-field-group-locations"),this.$options=$("#acf-field-group-options"),acf.validation.active=0},sortable:function(e){if(!e.$el.hasClass("ui-sortable")){var t=this;e.$el.sortable({handle:".acf-sortable-handle",connectWith:".acf-field-list",start:function(e,t){t.placeholder.height(t.item.height())},update:function(e,i){var a=i.item;t.render_fields(),acf.do_action("sortstop",a)}})}},preventDefault:function(e){e.preventDefault()},get_selector:function(e){e=e||"";var t=".acf-field-object";return e&&(t+="-"+e,t=t.split("_").join("-")),t},render_fields:function(){var e=this;$(".acf-field-list").each(function(){var t=$(this).children(".acf-field-object");t.each(function(t){e.update_field_meta($(this),"menu_order",t),$(this).children(".handle").find(".acf-icon").html(t+1)}),t.exists()?$(this).children(".no-fields-message").hide():$(this).children(".no-fields-message").show()})},get_field_meta:function(e,t){var i=e.find("> .meta > .input-"+t);return!!i.exists()&&i.val()},update_field_meta:function(e,t,i){var a=e.find("> .meta > .input-"+t);if(!a.exists()){var n=e.find("> .meta > .input-ID").outerHTML();n=acf.str_replace("ID",t,n),a=$(n),a.val(i),e.children(".meta").append(a)}a.val()!=i&&(a.val(i),"save"!=t&&this.save_field(e,"meta"))},delete_field_meta:function(e,t){var i=e.find("> .meta > .input-"+t);i.exists()&&(i.remove(),this.save_field(e,"meta"))},save_field:function(e,t){t=t||"settings";var i=this.get_field_meta(e,"save");"settings"!=i&&i!=t&&(this.update_field_meta(e,"save",t),acf.do_action("save_field",e,t))},submit:function(e){var t=this,i=$("#titlewrap #title");i.val()||(e.preventDefault(),acf.validation.toggle(e.$el,"unlock"),alert(acf._e("title_is_required")),i.focus()),$(".acf-field-object").each(function(){var e=t.get_field_meta($(this),"save"),i=t.get_field_meta($(this),"ID");$(this).hasClass("open")&&t.close_field($(this)),"settings"==e||("meta"==e?$(this).children(".settings").find('[name^="acf_fields['+i+']"]').remove():$(this).find('[name^="acf_fields['+i+']"]').remove())})},trash:function(e){confirm(acf._e("move_to_trash"))||e.preventDefault()},render_field:function(e){var t=e.find(".field-label:first").val(),i=e.find(".field-name:first").val(),a=e.find(".field-type:first option:selected").text(),n=e.find(".field-required:first").prop("checked"),d=e.children(".handle");d.find(".li-field-label strong a").html(t),d.find(".li-field-label .acf-required").remove(),n&&d.find(".li-field-label strong").append('<span class="acf-required">*</span>'),d.find(".li-field-name").text(i),d.find(".li-field-type").text(a),acf.do_action("render_field_handle",e,d)},edit_field:function(e){e.hasClass("open")?this.close_field(e):this.open_field(e)},open_field:function(e){if(e.hasClass("open"))return!1;e.addClass("open"),acf.do_action("open_field",e),e.children(".settings").animate({height:"toggle"},250)},close_field:function(e){if(!e.hasClass("open"))return!1;e.removeClass("open"),acf.do_action("close_field",e),e.children(".settings").animate({height:"toggle"},250)},wipe_field:function(e){var t=e.attr("data-id"),i=e.attr("data-key"),a=acf.get_uniqid(),n="field_"+a;e.attr("data-id",a),e.attr("data-key",n),e.attr("data-orig",i),this.update_field_meta(e,"ID",""),this.update_field_meta(e,"key",n),e.find('[id*="'+t+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(t,a))}),e.find('[name*="'+t+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(t,a))}),e.find("> .handle .pre-field-key").text(n),e.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("wipe_field",e)},add_field:function(e){var t=$($("#tmpl-acf-field").html()),i=t.find(".field-label:first"),a=t.find(".field-name:first");this.wipe_field(t),e.append(t),i.val(""),a.val(""),setTimeout(function(){i.focus()},251),this.render_fields(),acf.do_action("append",t),this.edit_field(t),acf.do_action("add_field",t)},duplicate_field:function(e){acf.do_action("before_duplicate",e);var t=e.clone(),i=t.find(".field-label:first"),a=t.find(".field-name:first");acf.do_action("remove",t),this.wipe_field(t),acf.do_action("after_duplicate",e,t),e.after(t),acf.do_action("append",t),setTimeout(function(){i.focus()},251),this.render_fields(),e.hasClass("open")?this.close_field(e):this.open_field(t);var n=i.val(),d=a.val(),l=d.split("_").pop(),f=acf._e("copy");if(0===l.indexOf(f)){var c=1*l.replace(f,"");c=c?c+1:2,n=n.replace(l,f+c),d=d.replace(l,f+c)}else n+=" ("+f+")",d+="_"+f;return i.val(n),a.val(d),this.save_field(t),this.render_field(t),acf.do_action("duplicate_field",t),t},move_field:function(e){var t=this,i=acf.prepare_for_ajax({action:"acf/field_group/move_field",field_id:this.get_field_meta(e,"ID")}),a=!1;if(i.field_id?"settings"==this.get_field_meta(e,"save")?a=!0:e.find(".acf-field-object").each(function(){if(!t.get_field_meta($(this),"ID"))return a=!0,!1;"settings"==t.get_field_meta($(this),"save")&&(a=!0)}):a=!0,a)return void alert(acf._e("move_field_warning"));acf.open_popup({title:acf._e("move_field"),loading:!0,height:145}),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(i){t.move_field_confirm(e,i)}})},move_field_confirm:function(e,t){var i=this;acf.update_popup({content:t});var a=acf.prepare_for_ajax({action:"acf/field_group/move_field",field_id:this.get_field_meta(e,"ID"),field_group_id:0});$("#acf-move-field-form").on("submit",function(){return a.field_group_id=$(this).find("select").val(),$.ajax({url:acf.get("ajaxurl"),data:a,type:"post",dataType:"html",success:function(t){acf.update_popup({content:t}),i.remove_field(e)}}),!1})},delete_field:function(e,t){t=t||!0;var i=this.get_field_meta(e,"ID");if(i){var a=$("#_acf_delete_fields");a.val(a.val()+"|"+i)}acf.do_action("delete_field",e),t&&this.remove_field(e)},remove_field:function(e){var t=this,i=e.closest(".acf-field-list");e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap('<div class="temp-field-wrap" style="height:'+e.height()+'px"></div>'),e.animate({opacity:0},250);var a=0,n=!1;i.children(".acf-field-object").length||(n=i.children(".no-fields-message"),a=n.outerHeight()),e.parent(".temp-field-wrap").animate({height:a},250,function(){n&&n.show(),acf.do_action("remove",$(this)),$(this).remove(),t.render_fields()})},change_field_type:function(e){var t=e.closest("tbody"),i=t.closest(".acf-field-object"),a=i.parent().closest(".acf-field-object"),n=i.attr("data-key"),d=i.attr("data-type"),l=e.val();i.removeClass("acf-field-object-"+acf.str_replace("_","-",d)),i.addClass("acf-field-object-"+acf.str_replace("_","-",l)),i.attr("data-type",l),i.data("type",l),i.data("xhr")&&i.data("xhr").abort();var f=t.children('.acf-field[data-setting="'+d+'"]');if(acf.update(n+"_settings_"+d,f),f.detach(),this.render_field(i),$newettings=acf.get(n+"_settings_"+l),$newettings)return t.children('.acf-field[data-name="conditional_logic"]').before($newettings),acf.update(n+"_settings_"+l,!1),void acf.do_action("change_field_type",i);var c=$('<tr class="acf-field"><td class="acf-label"></td><td class="acf-input"><div class="acf-loading"></div></td></tr>');t.children('.acf-field[data-name="conditional_logic"]').before(c);var r={action:"acf/field_group/render_field_settings",nonce:acf.o.nonce,parent:acf.o.post_id,field_group:acf.o.post_id,prefix:e.attr("name").replace("[type]",""),type:l};a.exists()&&(r.parent=this.get_field_meta(a,"ID"));var o=$.ajax({url:acf.o.ajaxurl,data:r,type:"post",dataType:"html",success:function(e){if(e){var t=$(e);c.after(t),acf.do_action("append",t),acf.do_action("change_field_type",i)}},complete:function(){c.remove()}});i.data("xhr",o)},change_field_label:function(e){var t=e.find(".field-label:first"),i=e.find(".field-name:first"),a=e.attr("data-type");if(""==i.val()){var n=t.val();n=acf.str_sanitize(n),i.val(n).trigger("change")}this.render_field(e),acf.do_action("change_field_label",e)},change_field_name:function(e){var t=e.find(".field-name:first");"field_"===t.val().substr(0,6)&&(alert(acf._e("field_name_start")),setTimeout(function(){t.focus()},1)),acf.do_action("change_field_name",e)}}),acf.field_group.field=acf.model.extend({events:{"click .edit-field":"edit","click .duplicate-field":"duplicate","click .move-field":"move","click .delete-field":"delete","click .add-field":"add","change .field-type":"change_type","blur .field-label":"change_label","blur .field-name":"change_name","keyup .field-label":"render","keyup .field-name":"render","change .field-required":"render","change .acf-field-object input":"save","change .acf-field-object textarea":"save","change .acf-field-object select":"save"},event:function(e){return e.$field=e.$el.closest(".acf-field-object"),e},edit:function(e){acf.field_group.edit_field(e.$field)},duplicate:function(e){acf.field_group.duplicate_field(e.$field)},move:function(e){acf.field_group.move_field(e.$field)},delete:function(e){acf.field_group.delete_field(e.$field)},add:function(e){var t=e.$el.closest(".acf-field-list-wrap").children(".acf-field-list");acf.field_group.add_field(t)},change_type:function(e){acf.field_group.change_field_type(e.$el)},change_label:function(e){acf.field_group.change_field_label(e.$field)},change_name:function(e){acf.field_group.change_field_name(e.$field)},render:function(e){acf.field_group.render_field(e.$field)},save:function(e){acf.field_group.save_field(e.$field)}}),acf.field_group.conditional_logic=acf.model.extend({actions:{open_field:"render_field",change_field_label:"render_fields",change_field_type:"render_fields"},events:{"click .add-conditional-rule":"add_rule","click .add-conditional-group":"add_group","click .remove-conditional-rule":"remove_rule","change .conditional-toggle":"change_toggle","change .conditional-rule-param":"change_param"},render_fields:function(){var e=this;$(".acf-field-object.open").each(function(){e.render_field($(this))})},render_field:function(e){var t=this,i=e.attr("data-key"),a=e.parents(".acf-field-list"),n=e.find(".acf-field-setting-conditional_logic:last"),d=[];$.each(a,function(e){var t=0==e?acf._e("sibling_fields"):acf._e("parent_fields");$(this).children(".acf-field-object").each(function(){var e=$(this),a=e.attr("data-key"),n=e.attr("data-type"),l=e.find(".field-label:first").val();-1!==$.inArray(n,["select","checkbox","true_false","radio","button_group"])&&a!=i&&d.push({value:a,label:l,group:t})})}),d.length||d.push({value:"",label:acf._e("no_fields")}),n.find(".rule").each(function(){t.render_rule($(this),d)})},render_rule:function(e,t){var i=e.find(".conditional-rule-param"),a=e.find(".conditional-rule-value");t&&acf.render_select(i,t);var n=$('.acf-field-object[data-key="'+i.val()+'"]'),d=n.attr("data-type"),l=[];if("true_false"==d)l.push({value:1,label:acf._e("checked")});else if("select"==d||"checkbox"==d||"radio"==d||"button_group"==d){var f=n.find('.acf-field[data-name="choices"] textarea').val().split("\n");$.each(f,function(e,t){t=t.split(":"),t[1]=t[1]||t[0],l.push({value:$.trim(t[0]),label:$.trim(t[1])})});var c=n.find('.acf-field[data-name="allow_null"]');c.exists()&&"1"==c.find("input:checked").val()&&l.unshift({value:"",label:acf._e("null")})}acf.render_select(a,l)},change_toggle:function(e){var t=e.$el,i=e.$el.prop("checked"),a=t.closest(".acf-input");i?(a.find(".rule-groups").show(),a.find(".rule-groups").find("[name]").prop("disabled",!1)):(a.find(".rule-groups").hide(),a.find(".rule-groups").find("[name]").prop("disabled",!0))},change_param:function(e){var t=e.$el.closest(".rule");this.render_rule(t)},add_rule:function(e){var t=e.$el.closest("tr");$tr2=acf.duplicate(t),$tr2.find("select:first").trigger("change")},remove_rule:function(e){var t=e.$el.closest("tr");t.find("select:first").trigger("change"),0==t.siblings("tr").length&&t.closest(".rule-group").remove(),t.remove()},add_group:function(e){var t=e.$el.closest(".rule-groups"),i=t.find(".rule-group:last");$group2=acf.duplicate(i),$group2.find("h4").text(acf._e("or")),$group2.find("tr:not(:first)").remove(),$group2.find("select:first").trigger("change")}}),acf.field_group.locations=acf.model.extend({events:{"click .add-location-rule":"add_rule","click .add-location-group":"add_group","click .remove-location-rule":"remove_rule","change .refresh-location-rule":"change_rule"},add_rule:function(e){var t=e.$el.closest("tr");$tr2=acf.duplicate(t)},remove_rule:function(e){var t=e.$el.closest("tr");0==t.siblings("tr").length?t.closest(".rule-group").remove():t.remove()},add_group:function(e){var t=e.$el.closest(".rule-groups"),i=t.find(".rule-group:last");$group2=acf.duplicate(i),$group2.find("h4").text(acf._e("or")),$group2.find("tr:not(:first)").remove()},change_rule:function(e){var t=e.$el.closest("tr"),i=t.closest(".rule-group"),a=t.find("td.param select").attr("name").replace("[param]",""),n={action:"acf/field_group/render_location_rule",rule:acf.serialize(t,a)};n.rule.id=t.attr("data-id"),n.rule.group=i.attr("data-id"),$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(n),type:"post",dataType:"html",success:function(e){e&&t.replaceWith(e)}})}}),acf.field_group.field_object=acf.model.extend({type:"",o:{},$field:null,$settings:null,tag:function(e){var t=this.type,i=e.split("_");return i.splice(1,0,"field"),e=i.join("_"),t&&(e+="/type="+t),e},selector:function(){var e=".acf-field-object",t=this.type;return t&&(e+="-"+t,e=acf.str_replace("_","-",e)),e},_add_action:function(e,t){var i=this;acf.add_action(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;acf.add_filter(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),d=this.selector();$(document).on(a,d+" "+n,function(e){e.$el=$(this),e.$field=e.$el.closest(".acf-field-object"),i.set("$field",e.$field),i[t].apply(i,[e])})},_set_$field:function(){this.o=this.$field.data(),this.$settings=this.$field.find("> .settings > table > tbody"),this.focus()},focus:function(){},setting:function(e){return this.$settings.find("> .acf-field-setting-"+e)}}),acf.field_group.field_objects=acf.model.extend({actions:{save_field:"_save_field",open_field:"_open_field",close_field:"_close_field",wipe_field:"_wipe_field",add_field:"_add_field",duplicate_field:"_duplicate_field",delete_field:"_delete_field",change_field_type:"_change_field_type",change_field_label:"_change_field_label",change_field_name:"_change_field_name",render_field_settings:"_render_field_settings"},_save_field:function(e){acf.do_action("save_field/type="+e.data("type"),e)},_open_field:function(e){acf.do_action("open_field/type="+e.data("type"),e),acf.do_action("render_field_settings",e)},_close_field:function(e){acf.do_action("close_field/type="+e.data("type"),e)},_wipe_field:function(e){acf.do_action("wipe_field/type="+e.data("type"),e)},_add_field:function(e){acf.do_action("add_field/type="+e.data("type"),e)},_duplicate_field:function(e){acf.do_action("duplicate_field/type="+e.data("type"),e)},_delete_field:function(e){acf.do_action("delete_field/type="+e.data("type"),e)},_change_field_type:function(e){acf.do_action("change_field_type/type="+e.data("type"),e),acf.do_action("render_field_settings",e)},_change_field_label:function(e){acf.do_action("change_field_label/type="+e.data("type"),e)},_change_field_name:function(e){acf.do_action("change_field_name/type="+e.data("type"),e)},_render_field_settings:function(e){acf.do_action("render_field_settings/type="+e.data("type"),e)}}),acf.field_group.append=acf.model.extend({actions:{render_field_settings:"_render_field_settings"},render:function(e){var t=e.data("append");if($sibling=e.siblings('[data-name="'+t+'"]'),$sibling.exists()){var i=$sibling.children(".acf-input"),a=i.children(".acf-hl");a.exists()||(i.wrapInner('<ul class="acf-hl"><li></li></ul>'),a=i.children(".acf-hl"));var n=$("<li></li>").append(e.children(".acf-input").children());a.append(n),a.attr("data-cols",a.children().length),e.remove()}},_render_field_settings:function(e){var t=this;e.find(".acf-field[data-append]").each(function(){t.render($(this))})}});var e=acf.field_group.field_object.extend({type:"select",actions:{render_settings:"render"},events:{"change .acf-field-setting-ui input":"render"},render:function(e){this.setting('ui input[type="checkbox"]').prop("checked")?this.setting("ajax").show():(this.setting("ajax").hide(),this.setting('ajax input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),t=acf.field_group.field_object.extend({type:"radio",actions:{render_settings:"render"},events:{"change .acf-field-setting-other_choice input":"render"},render:function(e){this.setting('other_choice input[type="checkbox"]').prop("checked")?this.setting("save_other_choice").show():(this.setting("save_other_choice").hide(),this.setting('save_other_choice input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),i=acf.field_group.field_object.extend({type:"checkbox",actions:{render_settings:"render"},events:{"change .acf-field-setting-allow_custom input":"render"},render:function(e){this.setting('allow_custom input[type="checkbox"]').prop("checked")?this.setting("save_custom").show():(this.setting("save_custom").hide(),this.setting('save_custom input[type="checkbox"]').prop("checked",!1).trigger("change"))}}),a=acf.field_group.field_object.extend({type:"true_false",actions:{render_settings:"render"},events:{"change .acf-field-setting-ui input":"render"},render:function(e){this.setting('ui input[type="checkbox"]').prop("checked")?(this.setting("ui_on_text").show(),this.setting("ui_off_text").show()):(this.setting("ui_on_text").hide(),this.setting("ui_off_text").hide())}}),n=acf.field_group.field_object.extend({type:"date_picker",actions:{render_settings:"render"},events:{"change .acf-field-setting-display_format input":"render","change .acf-field-setting-return_format input":"render"},render:function(e){this.render_list(this.setting("display_format")),this.render_list(this.setting("return_format"))},render_list:function(e){var t=e.find("ul"),i=t.find('input[type="radio"]:checked'),a=t.find('input[type="text"]');"other"!=i.val()&&a.val(i.val())}}),d=n.extend({type:"date_time_picker"}),d=n.extend({type:"time_picker"}),l=acf.field_group.field_object.extend({type:"tab",actions:{render_settings:"render"},render:function(e){this.setting("name input").val("").trigger("change"),this.setting('required input[type="checkbox"]').prop("checked",!1).trigger("change")}}),f=l.extend({type:"message"});acf.field_group.screen=acf.model.extend({actions:{ready:"ready"},events:{"click #acf-field-key-hide":"toggle"},ready:function(){var e=$("#adv-settings"),t=e.find("#acf-append-show-on-screen");e.find(".metabox-prefs").append(t.html()),e.find(".metabox-prefs br").remove(),t.remove(),this.render()},toggle:function(e){var t=e.$el.prop("checked")?1:0;acf.update_user_setting("show_field_keys",t),this.render()},render:function(){var e=acf.serialize($("#adv-settings")),t=acf.field_group.$fields;e.show_field_keys?t.addClass("show-field-keys"):t.removeClass("show-field-keys")}}),acf.field_group.sub_fields=acf.model.extend({actions:{open_field:"update_field_parent",sortstop:"update_field_parent",duplicate_field:"duplicate_field",delete_field:"delete_field",change_field_type:"change_field_type"},fix_conditional_logic:function(e){var t={};e.each(function(){t[$(this).attr("data-orig")]=$(this).attr("data-key")}),e.find(".conditional-rule-param").each(function(){var e=$(this).val();e in t&&($(this).find('option[value="'+t[e]+'"]').exists()||$(this).append('<option value="'+t[e]+'">'+t[e]+"</option>"),$(this).val(t[e]))})},update_field_parent:function(e){if(e.hasClass("acf-field-object")){var t=e.parent().closest(".acf-field-object"),i=acf.get("post_id");t.exists()&&((i=acf.field_group.get_field_meta(t,"ID"))||(i=acf.field_group.get_field_meta(t,"key"))),acf.field_group.update_field_meta(e,"parent",i),acf.do_action("update_field_parent",e,t)}},duplicate_field:function(e){var t=e.find(".acf-field-object");t.exists()&&(t.each(function(){var e=$(this).parent().closest(".acf-field-object"),t=acf.field_group.get_field_meta(e,"key");acf.field_group.wipe_field($(this)),acf.field_group.update_field_meta($(this),"parent",t),acf.field_group.save_field($(this))}),this.fix_conditional_logic(t))},delete_field:function(e){e.find(".acf-field-object").each(function(){acf.field_group.delete_field($(this),!1)})},change_field_type:function(e){e.find(".acf-field-object").each(function(){acf.field_group.delete_field($(this),!1)})}})}(jQuery);
|
assets/js/acf-input.js
CHANGED
@@ -247,7 +247,7 @@
|
|
247 |
};
|
248 |
|
249 |
window.wp = window.wp || {};
|
250 |
-
window.wp.hooks = new EventManager();
|
251 |
|
252 |
} )( window );
|
253 |
|
@@ -1024,265 +1024,6 @@ var acf;
|
|
1024 |
|
1025 |
},
|
1026 |
|
1027 |
-
/*
|
1028 |
-
serialize: function( $el, prefix ){
|
1029 |
-
|
1030 |
-
// defaults
|
1031 |
-
prefix = prefix || '';
|
1032 |
-
|
1033 |
-
|
1034 |
-
// vars
|
1035 |
-
var data = {};
|
1036 |
-
var $inputs = $el.find('select, textarea, input');
|
1037 |
-
|
1038 |
-
|
1039 |
-
// loop
|
1040 |
-
$inputs.each(function(){
|
1041 |
-
|
1042 |
-
// vars
|
1043 |
-
var $el = $(this);
|
1044 |
-
var name = $el.attr('name');
|
1045 |
-
var val = $el.val();
|
1046 |
-
|
1047 |
-
|
1048 |
-
// is array
|
1049 |
-
var is_array = ( name.slice(-2) === '[]' );
|
1050 |
-
if( is_array ) {
|
1051 |
-
name = name.slice(0, -2);
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
|
1055 |
-
// explode name
|
1056 |
-
var bits = name.split('[');
|
1057 |
-
var depth = bits.length;
|
1058 |
-
|
1059 |
-
|
1060 |
-
// loop
|
1061 |
-
for( var i = 0; i < depth; i++ ) {
|
1062 |
-
|
1063 |
-
// vars
|
1064 |
-
var k = bits[i];
|
1065 |
-
|
1066 |
-
|
1067 |
-
// end
|
1068 |
-
if( i == depth-1 ) {
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
// not end
|
1074 |
-
} else {
|
1075 |
-
|
1076 |
-
// must be object
|
1077 |
-
if( typeof data[k] !== 'object' ) {
|
1078 |
-
data[k] = {};
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
|
1084 |
-
}
|
1085 |
-
|
1086 |
-
|
1087 |
-
bits.map(function( s ){ return s.replace(']', ''); })
|
1088 |
-
|
1089 |
-
|
1090 |
-
});
|
1091 |
-
|
1092 |
-
},
|
1093 |
-
*/
|
1094 |
-
|
1095 |
-
|
1096 |
-
/*
|
1097 |
-
* disable
|
1098 |
-
*
|
1099 |
-
* This function will disable an input
|
1100 |
-
*
|
1101 |
-
* @type function
|
1102 |
-
* @date 22/09/2016
|
1103 |
-
* @since 5.4.0
|
1104 |
-
*
|
1105 |
-
* @param $el (jQuery)
|
1106 |
-
* @param context (string)
|
1107 |
-
* @return n/a
|
1108 |
-
*/
|
1109 |
-
|
1110 |
-
disable: function( $input, context ){
|
1111 |
-
|
1112 |
-
// defaults
|
1113 |
-
context = context || '';
|
1114 |
-
|
1115 |
-
|
1116 |
-
// bail early if is .acf-disabled
|
1117 |
-
if( $input.hasClass('acf-disabled') ) return false;
|
1118 |
-
|
1119 |
-
|
1120 |
-
// always disable input
|
1121 |
-
$input.prop('disabled', true);
|
1122 |
-
|
1123 |
-
|
1124 |
-
// context
|
1125 |
-
if( context ) {
|
1126 |
-
|
1127 |
-
// vars
|
1128 |
-
var disabled = $input.data('acf_disabled') || [],
|
1129 |
-
i = disabled.indexOf(context);
|
1130 |
-
|
1131 |
-
|
1132 |
-
// append context if not found
|
1133 |
-
if( i < 0 ) {
|
1134 |
-
|
1135 |
-
// append
|
1136 |
-
disabled.push( context );
|
1137 |
-
|
1138 |
-
|
1139 |
-
// update
|
1140 |
-
$input.data('acf_disabled', disabled);
|
1141 |
-
|
1142 |
-
}
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
|
1146 |
-
// return
|
1147 |
-
return true;
|
1148 |
-
|
1149 |
-
},
|
1150 |
-
|
1151 |
-
|
1152 |
-
/*
|
1153 |
-
* enable
|
1154 |
-
*
|
1155 |
-
* This function will enable an input
|
1156 |
-
*
|
1157 |
-
* @type function
|
1158 |
-
* @date 22/09/2016
|
1159 |
-
* @since 5.4.0
|
1160 |
-
*
|
1161 |
-
* @param $el (jQuery)
|
1162 |
-
* @param context (string)
|
1163 |
-
* @return n/a
|
1164 |
-
*/
|
1165 |
-
|
1166 |
-
enable: function( $input, context ){
|
1167 |
-
|
1168 |
-
// defaults
|
1169 |
-
context = context || '';
|
1170 |
-
|
1171 |
-
|
1172 |
-
// bail early if is .acf-disabled
|
1173 |
-
if( $input.hasClass('acf-disabled') ) return false;
|
1174 |
-
|
1175 |
-
|
1176 |
-
// vars
|
1177 |
-
var disabled = $input.data('acf_disabled') || [];
|
1178 |
-
|
1179 |
-
|
1180 |
-
// context
|
1181 |
-
if( context ) {
|
1182 |
-
|
1183 |
-
// vars
|
1184 |
-
var i = disabled.indexOf(context);
|
1185 |
-
|
1186 |
-
|
1187 |
-
// remove context if found
|
1188 |
-
if( i > -1 ) {
|
1189 |
-
|
1190 |
-
// delete
|
1191 |
-
disabled.splice(i, 1);
|
1192 |
-
|
1193 |
-
|
1194 |
-
// update
|
1195 |
-
$input.data('acf_disabled', disabled);
|
1196 |
-
|
1197 |
-
}
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
|
1201 |
-
// bail early if other disabled exist
|
1202 |
-
if( disabled.length ) return false;
|
1203 |
-
|
1204 |
-
|
1205 |
-
// enable input
|
1206 |
-
$input.prop('disabled', false);
|
1207 |
-
|
1208 |
-
|
1209 |
-
// return
|
1210 |
-
return true;
|
1211 |
-
|
1212 |
-
},
|
1213 |
-
|
1214 |
-
|
1215 |
-
/*
|
1216 |
-
* disable_el
|
1217 |
-
*
|
1218 |
-
* This function will disable all inputs within an element
|
1219 |
-
*
|
1220 |
-
* @type function
|
1221 |
-
* @date 22/09/2016
|
1222 |
-
* @since 5.4.0
|
1223 |
-
*
|
1224 |
-
* @param $el (jQuery)
|
1225 |
-
* @param context (string)
|
1226 |
-
* @return na
|
1227 |
-
*/
|
1228 |
-
|
1229 |
-
disable_el: function( $el, context ) {
|
1230 |
-
|
1231 |
-
// defaults
|
1232 |
-
context = context || '';
|
1233 |
-
|
1234 |
-
|
1235 |
-
// loop
|
1236 |
-
$el.find('select, textarea, input').each(function(){
|
1237 |
-
|
1238 |
-
acf.disable( $(this), context );
|
1239 |
-
|
1240 |
-
});
|
1241 |
-
|
1242 |
-
},
|
1243 |
-
|
1244 |
-
disable_form: function( $el, context ) {
|
1245 |
-
|
1246 |
-
this.disable_el.apply( this, arguments );
|
1247 |
-
|
1248 |
-
},
|
1249 |
-
|
1250 |
-
|
1251 |
-
/*
|
1252 |
-
* enable_el
|
1253 |
-
*
|
1254 |
-
* This function will enable all inputs within an element
|
1255 |
-
*
|
1256 |
-
* @type function
|
1257 |
-
* @date 22/09/2016
|
1258 |
-
* @since 5.4.0
|
1259 |
-
*
|
1260 |
-
* @param $el (jQuery)
|
1261 |
-
* @param context (string)
|
1262 |
-
* @return na
|
1263 |
-
*/
|
1264 |
-
|
1265 |
-
enable_el: function( $el, context ) {
|
1266 |
-
|
1267 |
-
// defaults
|
1268 |
-
context = context || '';
|
1269 |
-
|
1270 |
-
|
1271 |
-
// loop
|
1272 |
-
$el.find('select, textarea, input').each(function(){
|
1273 |
-
|
1274 |
-
acf.enable( $(this), context );
|
1275 |
-
|
1276 |
-
});
|
1277 |
-
|
1278 |
-
},
|
1279 |
-
|
1280 |
-
enable_form: function( $el, context ) {
|
1281 |
-
|
1282 |
-
this.enable_el.apply( this, arguments );
|
1283 |
-
|
1284 |
-
},
|
1285 |
-
|
1286 |
|
1287 |
/*
|
1288 |
* remove_tr
|
@@ -4089,15 +3830,25 @@ var acf;
|
|
4089 |
/**
|
4090 |
* acf.lock
|
4091 |
*
|
4092 |
-
* Creates a lock on an element
|
4093 |
*
|
4094 |
* @date 22/2/18
|
4095 |
* @since 5.6.9
|
4096 |
*
|
4097 |
-
* @param
|
4098 |
-
* @
|
|
|
|
|
4099 |
*/
|
4100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4101 |
acf.lock = function( $el, type, key ){
|
4102 |
var locks = getLocks( $el, type );
|
4103 |
var i = locks.indexOf(key);
|
@@ -4107,6 +3858,20 @@ var acf;
|
|
4107 |
}
|
4108 |
};
|
4109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4110 |
acf.unlock = function( $el, type, key ){
|
4111 |
var locks = getLocks( $el, type );
|
4112 |
var i = locks.indexOf(key);
|
@@ -4114,37 +3879,269 @@ var acf;
|
|
4114 |
locks.splice(i, 1);
|
4115 |
setLocks( $el, type, locks );
|
4116 |
}
|
|
|
|
|
|
|
4117 |
};
|
4118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4119 |
acf.isLocked = function( $el, type ){
|
4120 |
return ( getLocks( $el, type ).length > 0 );
|
4121 |
};
|
4122 |
|
4123 |
-
|
4124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4125 |
};
|
4126 |
|
4127 |
-
|
4128 |
-
|
4129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4130 |
|
4131 |
-
|
4132 |
-
$(document).ready(function(){
|
4133 |
|
4134 |
-
|
|
|
|
|
|
|
4135 |
|
4136 |
-
|
4137 |
-
|
|
|
|
|
4138 |
|
4139 |
-
|
4140 |
-
|
4141 |
-
|
|
|
4142 |
|
4143 |
-
|
4144 |
-
|
|
|
|
|
4145 |
|
4146 |
-
|
4147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4148 |
|
4149 |
/*
|
4150 |
* Sortable
|
@@ -5321,9 +5318,9 @@ var acf;
|
|
5321 |
|
5322 |
// hide / show
|
5323 |
if( visibility ) {
|
5324 |
-
this.showField( $target );
|
5325 |
} else {
|
5326 |
-
this.hideField( $target );
|
5327 |
}
|
5328 |
|
5329 |
},
|
@@ -5343,34 +5340,23 @@ var acf;
|
|
5343 |
*/
|
5344 |
|
5345 |
showField: function( $field, lockKey ){
|
5346 |
-
//console.log('showField', lockKey, $field.data('name'), $field.data('type') );
|
5347 |
-
// defaults
|
5348 |
-
lockKey = lockKey || 'default';
|
5349 |
|
5350 |
-
//
|
5351 |
-
|
5352 |
-
//console.log('- not locked, no need to show');
|
5353 |
-
return false;
|
5354 |
-
}
|
5355 |
|
5356 |
-
//
|
5357 |
-
acf.
|
5358 |
|
5359 |
-
//
|
5360 |
-
if(
|
5361 |
-
|
5362 |
-
return false;
|
5363 |
}
|
5364 |
|
5365 |
-
//
|
5366 |
-
|
5367 |
-
|
5368 |
-
// enable
|
5369 |
-
acf.enable_form( $field, CONTEXT );
|
5370 |
-
|
5371 |
-
// action for 3rd party customization
|
5372 |
-
acf.do_action('show_field', $field, CONTEXT );
|
5373 |
|
|
|
|
|
5374 |
},
|
5375 |
|
5376 |
|
@@ -5388,31 +5374,23 @@ var acf;
|
|
5388 |
*/
|
5389 |
|
5390 |
hideField: function( $field, lockKey ){
|
5391 |
-
//console.log('hideField', lockKey, $field.data('name'), $field.data('type') );
|
5392 |
-
// defaults
|
5393 |
-
lockKey = lockKey || 'default';
|
5394 |
|
5395 |
-
//
|
5396 |
-
|
5397 |
|
5398 |
-
//
|
5399 |
-
acf.
|
5400 |
|
5401 |
-
//
|
5402 |
-
if(
|
5403 |
-
|
5404 |
-
return false;
|
5405 |
}
|
5406 |
|
5407 |
-
//
|
5408 |
-
|
5409 |
-
|
5410 |
-
// disable
|
5411 |
-
acf.disable_form( $field, CONTEXT );
|
5412 |
-
|
5413 |
-
// action for 3rd party customization
|
5414 |
-
acf.do_action('hide_field', $field, CONTEXT );
|
5415 |
|
|
|
|
|
5416 |
},
|
5417 |
|
5418 |
|
247 |
};
|
248 |
|
249 |
window.wp = window.wp || {};
|
250 |
+
window.wp.hooks = window.wp.hooks || new EventManager();
|
251 |
|
252 |
} )( window );
|
253 |
|
1024 |
|
1025 |
},
|
1026 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1027 |
|
1028 |
/*
|
1029 |
* remove_tr
|
3830 |
/**
|
3831 |
* acf.lock
|
3832 |
*
|
3833 |
+
* Creates a "lock" on an element for a given type and key
|
3834 |
*
|
3835 |
* @date 22/2/18
|
3836 |
* @since 5.6.9
|
3837 |
*
|
3838 |
+
* @param jQuery $el The element to lock.
|
3839 |
+
* @param string type The type of lock such as "condition" or "visibility".
|
3840 |
+
* @param string key The key that will be used to unlock.
|
3841 |
+
* @return void
|
3842 |
*/
|
3843 |
|
3844 |
+
var getLocks = function( $el, type ){
|
3845 |
+
return $el.data('acf-lock-'+type) || [];
|
3846 |
+
};
|
3847 |
+
|
3848 |
+
var setLocks = function( $el, type, locks ){
|
3849 |
+
$el.data('acf-lock-'+type, locks);
|
3850 |
+
}
|
3851 |
+
|
3852 |
acf.lock = function( $el, type, key ){
|
3853 |
var locks = getLocks( $el, type );
|
3854 |
var i = locks.indexOf(key);
|
3858 |
}
|
3859 |
};
|
3860 |
|
3861 |
+
/**
|
3862 |
+
* acf.unlock
|
3863 |
+
*
|
3864 |
+
* Unlocks a "lock" on an element for a given type and key
|
3865 |
+
*
|
3866 |
+
* @date 22/2/18
|
3867 |
+
* @since 5.6.9
|
3868 |
+
*
|
3869 |
+
* @param jQuery $el The element to lock.
|
3870 |
+
* @param string type The type of lock such as "condition" or "visibility".
|
3871 |
+
* @param string key The key that will be used to unlock.
|
3872 |
+
* @return void
|
3873 |
+
*/
|
3874 |
+
|
3875 |
acf.unlock = function( $el, type, key ){
|
3876 |
var locks = getLocks( $el, type );
|
3877 |
var i = locks.indexOf(key);
|
3879 |
locks.splice(i, 1);
|
3880 |
setLocks( $el, type, locks );
|
3881 |
}
|
3882 |
+
|
3883 |
+
// return true if is unlocked (no locks)
|
3884 |
+
return (locks.length === 0);
|
3885 |
};
|
3886 |
|
3887 |
+
/**
|
3888 |
+
* acf.isLocked
|
3889 |
+
*
|
3890 |
+
* Returns true if a lock exists for a given type
|
3891 |
+
*
|
3892 |
+
* @date 22/2/18
|
3893 |
+
* @since 5.6.9
|
3894 |
+
*
|
3895 |
+
* @param jQuery $el The element to lock.
|
3896 |
+
* @param string type The type of lock such as "condition" or "visibility".
|
3897 |
+
* @return void
|
3898 |
+
*/
|
3899 |
+
|
3900 |
acf.isLocked = function( $el, type ){
|
3901 |
return ( getLocks( $el, type ).length > 0 );
|
3902 |
};
|
3903 |
|
3904 |
+
/**
|
3905 |
+
* acf.show
|
3906 |
+
*
|
3907 |
+
* description
|
3908 |
+
*
|
3909 |
+
* @date 9/2/18
|
3910 |
+
* @since 5.6.5
|
3911 |
+
*
|
3912 |
+
* @param type $var Description. Default.
|
3913 |
+
* @return type Description.
|
3914 |
+
*/
|
3915 |
+
|
3916 |
+
acf.show = function( $el, lockKey ){
|
3917 |
+
|
3918 |
+
// unlock
|
3919 |
+
if( lockKey ) {
|
3920 |
+
acf.unlock($el, 'hidden', lockKey);
|
3921 |
+
}
|
3922 |
+
|
3923 |
+
// bail early if $el is still locked
|
3924 |
+
if( acf.isLocked($el, 'hidden') ) {
|
3925 |
+
//console.log( 'still locked', getLocks( $el, 'hidden' ));
|
3926 |
+
return false;
|
3927 |
+
}
|
3928 |
+
|
3929 |
+
// $el is hidden, remove class and return true due to change in visibility
|
3930 |
+
if( $el.hasClass('acf-hidden') ) {
|
3931 |
+
$el.removeClass('acf-hidden');
|
3932 |
+
return true;
|
3933 |
+
|
3934 |
+
// $el is visible, return false due to no change in visibility
|
3935 |
+
} else {
|
3936 |
+
return false;
|
3937 |
+
}
|
3938 |
};
|
3939 |
|
3940 |
+
/**
|
3941 |
+
* enable
|
3942 |
+
*
|
3943 |
+
* description
|
3944 |
+
*
|
3945 |
+
* @date 12/3/18
|
3946 |
+
* @since 5.6.9
|
3947 |
+
*
|
3948 |
+
* @param type $var Description. Default.
|
3949 |
+
* @return type Description.
|
3950 |
+
*/
|
3951 |
|
3952 |
+
var enable = function( $el, lockKey ){
|
|
|
3953 |
|
3954 |
+
// check class. Allow .acf-disabled to overrule all JS
|
3955 |
+
if( $el.hasClass('acf-disabled') ) {
|
3956 |
+
return false;
|
3957 |
+
}
|
3958 |
|
3959 |
+
// unlock
|
3960 |
+
if( lockKey ) {
|
3961 |
+
acf.unlock($el, 'disabled', lockKey);
|
3962 |
+
}
|
3963 |
|
3964 |
+
// bail early if $el is still locked
|
3965 |
+
if( acf.isLocked($el, 'disabled') ) {
|
3966 |
+
return false;
|
3967 |
+
}
|
3968 |
|
3969 |
+
// $el is disabled, remove prop and return true due to change
|
3970 |
+
if( $el.prop('disabled') ) {
|
3971 |
+
$el.prop('disabled', false);
|
3972 |
+
return true;
|
3973 |
|
3974 |
+
// $el is enabled, return false due to no change
|
3975 |
+
} else {
|
3976 |
+
return false;
|
3977 |
+
}
|
3978 |
+
};
|
3979 |
+
|
3980 |
+
/**
|
3981 |
+
* acf.enable
|
3982 |
+
*
|
3983 |
+
* description
|
3984 |
+
*
|
3985 |
+
* @date 9/2/18
|
3986 |
+
* @since 5.6.5
|
3987 |
+
*
|
3988 |
+
* @param type $var Description. Default.
|
3989 |
+
* @return type Description.
|
3990 |
+
*/
|
3991 |
+
|
3992 |
+
acf.enable = function( $el, lockKey ){
|
3993 |
+
|
3994 |
+
// enable single input
|
3995 |
+
if( $el.attr('name') ) {
|
3996 |
+
return enable( $el, lockKey );
|
3997 |
+
}
|
3998 |
+
|
3999 |
+
// find and enable child inputs
|
4000 |
+
// return false if 'any' inputs are still disabled
|
4001 |
+
var results = true;
|
4002 |
+
$el.find('[name]').each(function(){
|
4003 |
+
var result = enable( $(this), lockKey );
|
4004 |
+
if( !result ) {
|
4005 |
+
results = false;
|
4006 |
+
}
|
4007 |
+
});
|
4008 |
+
return results;
|
4009 |
+
};
|
4010 |
+
|
4011 |
+
|
4012 |
+
/**
|
4013 |
+
* disable
|
4014 |
+
*
|
4015 |
+
* description
|
4016 |
+
*
|
4017 |
+
* @date 12/3/18
|
4018 |
+
* @since 5.6.9
|
4019 |
+
*
|
4020 |
+
* @param type $var Description. Default.
|
4021 |
+
* @return type Description.
|
4022 |
+
*/
|
4023 |
+
|
4024 |
+
var disable = function( $el, lockKey ){
|
4025 |
+
|
4026 |
+
// lock
|
4027 |
+
if( lockKey ) {
|
4028 |
+
acf.lock($el, 'disabled', lockKey);
|
4029 |
+
}
|
4030 |
+
|
4031 |
+
// $el is disabled, return false due to no change
|
4032 |
+
if( $el.prop('disabled') ) {
|
4033 |
+
return false;
|
4034 |
+
|
4035 |
+
// $el is enabled, add prop and return true due to change
|
4036 |
+
} else {
|
4037 |
+
$el.prop('disabled', true);
|
4038 |
+
return true;
|
4039 |
+
}
|
4040 |
+
};
|
4041 |
+
|
4042 |
+
|
4043 |
+
/**
|
4044 |
+
* acf.disable
|
4045 |
+
*
|
4046 |
+
* description
|
4047 |
+
*
|
4048 |
+
* @date 9/2/18
|
4049 |
+
* @since 5.6.5
|
4050 |
+
*
|
4051 |
+
* @param type $var Description. Default.
|
4052 |
+
* @return type Description.
|
4053 |
+
*/
|
4054 |
+
|
4055 |
+
acf.disable = function( $el, lockKey ){
|
4056 |
+
|
4057 |
+
// disable single input
|
4058 |
+
if( $el.attr('name') ) {
|
4059 |
+
return disable( $el, lockKey );
|
4060 |
+
}
|
4061 |
+
|
4062 |
+
// find and enable child inputs
|
4063 |
+
// return false if 'any' inputs did not change
|
4064 |
+
var results = true;
|
4065 |
+
$el.find('[name]').each(function(){
|
4066 |
+
var result = disable( $(this), lockKey );
|
4067 |
+
if( !result ) {
|
4068 |
+
results = false;
|
4069 |
+
}
|
4070 |
+
});
|
4071 |
+
return results;
|
4072 |
+
};
|
4073 |
+
|
4074 |
+
// compatibility
|
4075 |
+
acf.enable_el = acf.enable;
|
4076 |
+
acf.enable_form = acf.enable;
|
4077 |
+
|
4078 |
+
acf.disable_el = acf.disable;
|
4079 |
+
acf.disable_form = acf.disable;
|
4080 |
+
|
4081 |
+
|
4082 |
+
/**
|
4083 |
+
* acf.hide
|
4084 |
+
*
|
4085 |
+
* description
|
4086 |
+
*
|
4087 |
+
* @date 9/2/18
|
4088 |
+
* @since 5.6.5
|
4089 |
+
*
|
4090 |
+
* @param type $var Description. Default.
|
4091 |
+
* @return type Description.
|
4092 |
+
*/
|
4093 |
+
|
4094 |
+
acf.hide = function( $el, lockKey ){
|
4095 |
+
|
4096 |
+
// lock
|
4097 |
+
if( lockKey ) {
|
4098 |
+
acf.lock($el, 'hidden', lockKey);
|
4099 |
+
}
|
4100 |
+
|
4101 |
+
// $el is hidden, return false due to no change in visibility
|
4102 |
+
if( $el.hasClass('acf-hidden') ) {
|
4103 |
+
return false;
|
4104 |
+
|
4105 |
+
// $el is visible, add class and return true due to change in visibility
|
4106 |
+
} else {
|
4107 |
+
$el.addClass('acf-hidden');
|
4108 |
+
return true;
|
4109 |
+
}
|
4110 |
+
};
|
4111 |
+
|
4112 |
+
|
4113 |
+
/**
|
4114 |
+
* acf.isHidden
|
4115 |
+
*
|
4116 |
+
* description
|
4117 |
+
*
|
4118 |
+
* @date 9/2/18
|
4119 |
+
* @since 5.6.5
|
4120 |
+
*
|
4121 |
+
* @param type $var Description. Default.
|
4122 |
+
* @return type Description.
|
4123 |
+
*/
|
4124 |
+
|
4125 |
+
acf.isHidden = function( $el ){
|
4126 |
+
return $el.hasClass('acf-hidden');
|
4127 |
+
};
|
4128 |
+
|
4129 |
+
|
4130 |
+
/**
|
4131 |
+
* acf.isVisible
|
4132 |
+
*
|
4133 |
+
* description
|
4134 |
+
*
|
4135 |
+
* @date 9/2/18
|
4136 |
+
* @since 5.6.5
|
4137 |
+
*
|
4138 |
+
* @param type $var Description. Default.
|
4139 |
+
* @return type Description.
|
4140 |
+
*/
|
4141 |
+
|
4142 |
+
acf.isVisible = function( $el ){
|
4143 |
+
return !acf.isHidden( $el );
|
4144 |
+
};
|
4145 |
|
4146 |
/*
|
4147 |
* Sortable
|
5318 |
|
5319 |
// hide / show
|
5320 |
if( visibility ) {
|
5321 |
+
this.showField( $target, key );
|
5322 |
} else {
|
5323 |
+
this.hideField( $target, key );
|
5324 |
}
|
5325 |
|
5326 |
},
|
5340 |
*/
|
5341 |
|
5342 |
showField: function( $field, lockKey ){
|
|
|
|
|
|
|
5343 |
|
5344 |
+
// enable
|
5345 |
+
acf.enable( $field, lockKey );
|
|
|
|
|
|
|
5346 |
|
5347 |
+
// show field and store result
|
5348 |
+
var changed = acf.show( $field, lockKey );
|
5349 |
|
5350 |
+
// use changed to set cl class
|
5351 |
+
if( changed ) {
|
5352 |
+
$field.removeClass( CLASS );
|
|
|
5353 |
}
|
5354 |
|
5355 |
+
// always do action to avoid tab field bugs (fixed in 5.7)
|
5356 |
+
acf.do_action('show_field', $field, CONTEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
5357 |
|
5358 |
+
// return
|
5359 |
+
return changed;
|
5360 |
},
|
5361 |
|
5362 |
|
5374 |
*/
|
5375 |
|
5376 |
hideField: function( $field, lockKey ){
|
|
|
|
|
|
|
5377 |
|
5378 |
+
// disable
|
5379 |
+
acf.disable( $field, lockKey );
|
5380 |
|
5381 |
+
// hide field and store result
|
5382 |
+
var changed = acf.hide( $field, lockKey );
|
5383 |
|
5384 |
+
// use changed to set cl class
|
5385 |
+
if( changed ) {
|
5386 |
+
$field.addClass( CLASS );
|
|
|
5387 |
}
|
5388 |
|
5389 |
+
// always do action to avoid tab field bugs (fixed in 5.7)
|
5390 |
+
acf.do_action('hide_field', $field, CONTEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
5391 |
|
5392 |
+
// return
|
5393 |
+
return changed;
|
5394 |
},
|
5395 |
|
5396 |
|
assets/js/acf-input.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
!function(e,t){"use strict";var i=function(){function e(){return u}function t(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("actions",e,t,i,a)),f}function i(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&d("actions",t,e),f}function a(e,t){return"string"==typeof e&&r("actions",e,t),f}function n(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("filters",e,t,i,a)),f}function s(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?d("filters",t,e):f}function o(e,t){return"string"==typeof e&&r("filters",e,t),f}function r(e,t,i,a){if(u[e][t])if(i){var n=u[e][t],s;if(a)for(s=n.length;s--;){var o=n[s];o.callback===i&&o.context===a&&n.splice(s,1)}else for(s=n.length;s--;)n[s].callback===i&&n.splice(s,1)}else u[e][t]=[]}function l(e,t,i,a,n){var s={callback:i,priority:a,context:n},o=u[e][t];o?(o.push(s),o=c(o)):o=[s],u[e][t]=o}function c(e){for(var t,i,a,n=1,s=e.length;n<s;n++){for(t=e[n],i=n;(a=e[i-1])&&a.priority>t.priority;)e[i]=e[i-1],--i;e[i]=t}return e}function d(e,t,i){var a=u[e][t];if(!a)return"filters"===e&&i[0];var n=0,s=a.length;if("filters"===e)for(;n<s;n++)i[0]=a[n].callback.apply(a[n].context,i);else for(;n<s;n++)a[n].callback.apply(a[n].context,i);return"filters"!==e||i[0]}var f={removeFilter:o,applyFilters:s,addFilter:n,removeAction:a,doAction:i,addAction:t,storage:e},u={actions:{},filters:{}};return f};e.wp=e.wp||{},e.wp.hooks=new i}(window);var acf;!function($){$.fn.exists=function(){return $(this).length>0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},acf={l10n:{},o:{},update:function(e,t){this.o[e]=t},get:function(e){return void 0!==this.o[e]?this.o[e]:null},_e:function(e,t){t=t||!1;var i=this.l10n[e]||"";return t&&(i=i[t]||""),i},add_action:function(){for(var e=arguments[0].split(" "),t=e.length,i=0;i<t;i++)arguments[0]="acf/"+e[i],wp.hooks.addAction.apply(this,arguments);return this},remove_action:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.removeAction.apply(this,arguments),this},do_action:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.doAction.apply(this,arguments),this},add_filter:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.addFilter.apply(this,arguments),this},remove_filter:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.removeFilter.apply(this,arguments),this},apply_filters:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.applyFilters.apply(this,arguments)},get_selector:function(e){e=e||"";var t=".acf-field";if($.isPlainObject(e))if($.isEmptyObject(e))e="";else for(k in e){e=e[k];break}return e&&(t+="-"+e,t=t.split("_").join("-"),t=t.split("field-field-").join("field-")),t},get_fields:function(e,t,i){e=e||"",t=t||!1,i=i||!1;var a=this.get_selector(e),n=$(a,t);return!1!==t&&t.each(function(){$(this).is(a)&&(n=n.add($(this)))}),i||(n=n.not(".acf-clone .acf-field"),n=acf.apply_filters("get_fields",n)),n},get_field:function(e,t){e=e||"",t=t||!1;var i=this.get_fields(e,t,!0);return!!i.exists()&&i.first()},get_closest_field:function(e,t){return t=t||"",e.closest(this.get_selector(t))},get_field_wrap:function(e){return e.closest(this.get_selector())},get_field_key:function(e){return e.data("key")},get_field_type:function(e){return e.data("type")},get_data:function(e,t){var i=e.data();return"object"==typeof t&&(i=this.parse_args(i,t)),i},get_uniqid:function(e,t){void 0===e&&(e="");var i,a=function(e,t){return e=parseInt(e,10).toString(16),t<e.length?e.slice(e.length-t):t>e.length?Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,i=e,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(this.php_js.uniqidSeed,5),t&&(i+=(10*Math.random()).toFixed(8).toString()),i},serialize_form:function(){return this.serialize.apply(this,arguments)},serialize:function(e,t){t=t||"";var i={},a={},n=e.find("select, textarea, input").serializeArray();return $.each(n,function(e,n){var s=n.name,o=n.value;if(t){if(0!==s.indexOf(t))return;s=s.slice(t.length),"["==s.slice(0,1)&&(s=s.slice(1).replace("]",""))}"[]"===s.slice(-2)&&(s=s.slice(0,-2),void 0===a[s]&&(a[s]=-1),a[s]++,s+="["+a[s]+"]"),i[s]=o}),i},disable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;if(e.prop("disabled",!0),t){var i=e.data("acf_disabled")||[];i.indexOf(t)<0&&(i.push(t),e.data("acf_disabled",i))}return!0},enable:function(e,t){if(t=t||"",e.hasClass("acf-disabled"))return!1;var i=e.data("acf_disabled")||[];if(t){var a=i.indexOf(t);a>-1&&(i.splice(a,1),e.data("acf_disabled",i))}return!i.length&&(e.prop("disabled",!1),!0)},disable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.disable($(this),t)})},disable_form:function(e,t){this.disable_el.apply(this,arguments)},enable_el:function(e,t){t=t||"",e.find("select, textarea, input").each(function(){acf.enable($(this),t)})},enable_form:function(e,t){this.enable_el.apply(this,arguments)},remove_tr:function(e,t){var i=e.height(),a=e.children().length;e.addClass("acf-remove-element"),setTimeout(function(){e.removeClass("acf-remove-element"),e.html('<td style="padding:0; height:'+i+'px" colspan="'+a+'"></td>'),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0;var a=e.height(),n=e.width(),s=e.css("margin"),o=e.outerHeight(!0);acf.do_action("remove",e),e.wrap('<div class="acf-temp-remove" style="height:'+o+'px"></div>');var r=e.parent();e.css({height:a,width:n,margin:s,position:"absolute"}),setTimeout(function(){r.css({opacity:0,height:i})},50),setTimeout(function(){r.remove(),"function"==typeof t&&t.apply(this,arguments)},301)},isset:function(){var e=arguments,t=e.length,a=null,n;if(0===t)throw new Error("Empty isset");for(a=e[0],i=1;i<t;i++){if(e[i]===n||a[e[i]]===n)return!1;a=a[e[i]]}return!0},maybe_get:function(e,t,i){void 0===i&&(i=null),keys=String(t).split(".");for(var a in keys){var t=keys[a];if(void 0===e[t])return i;e=e[t]}return e},open_popup:function(e){if($popup=$("body > #acf-popup"),$popup.exists())return update_popup(e);var t=['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey acf-close-popup"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg"></div>',"</div>"].join("");return $("body").append(t),$("#acf-popup").on("click",".bg, .acf-close-popup",function(e){e.preventDefault(),acf.close_popup()}),this.update_popup(e)},update_popup:function(e){return $popup=$("#acf-popup"),!!$popup.exists()&&(e=$.extend({},{title:"",content:"",width:0,height:0,loading:!1},e),e.title&&$popup.find(".title h3").html(e.title),e.content&&($inner=$popup.find(".inner:first"),$inner.html(e.content),acf.do_action("append",$inner),$inner.attr("style","position: relative;"),e.height=$inner.outerHeight(),$inner.removeAttr("style")),e.width&&$popup.find(".acf-popup-box").css({width:e.width,"margin-left":0-e.width/2}),e.height&&(e.height+=44,$popup.find(".acf-popup-box").css({height:e.height,"margin-top":0-e.height/2})),e.loading?$popup.find(".loading").show():$popup.find(".loading").hide(),$popup)},close_popup:function(){$popup=$("#acf-popup"),$popup.exists()&&$popup.remove()},update_user_setting:function(e,t){$.ajax({url:acf.get("ajaxurl"),dataType:"html",type:"post",data:acf.prepare_for_ajax({action:"acf/update_user_setting",name:e,value:t})})},prepare_for_ajax:function(e){var t={};return $.each(e,function(e,i){$.isPlainObject(i)&&!$.isEmptyObject(i)?$.each(i,function(i,a){i+="";var n=i.indexOf("[");i=0==n?e+i:n>0?e+"["+i.slice(0,n)+"]"+i.slice(n):e+"["+i+"]",t[i]=a}):t[e]=i}),t.nonce=acf.get("nonce"),t.post_id=acf.get("post_id"),t=acf.apply_filters("prepare_for_ajax",t)},is_ajax_success:function(e){return!(!e||!e.success)},get_ajax_message:function(e){var t={text:"",type:"error"};return e?(e.success&&(t.type="success"),e.data&&e.data.message&&(t.text=e.data.message),e.data&&e.data.error&&(t.text=e.data.error),t):t},is_in_view:function(e){var t=e.offset().top,i=t+e.height();if(t===i)return!1;var a=$(window).scrollTop();return i<=a+$(window).height()&&t>=a},val:function(e,t){var i=e.val();e.val(t),t!=i&&e.trigger("change")},str_replace:function(e,t,i){return i.split(e).join(t)},str_sanitize:function(e){var t={"À":"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"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,a=function(e){return void 0!==t[e]?t[e]:e};return e=e.replace(i,a),e=e.toLowerCase()},addslashes:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},esc_html:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})},render_select:function(e,t){var i=e.val();e.html(""),t&&$.each(t,function(t,a){var n=e;a.group&&(n=e.find('optgroup[label="'+a.group+'"]'),n.exists()||(n=$('<optgroup label="'+a.group+'"></optgroup>'),e.append(n))),n.append('<option value="'+a.value+'">'+acf.esc_html(a.label)+"</option>"),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e){void 0!==e.length&&(e={$el:e}),e=acf.parse_args(e,{$el:!1,search:"",replace:"",before:function(e){},after:function(e,t){},append:function(e,t){e.after(t)}});var t=e.$el,i;e.search||(e.search=t.attr("data-id")),e.replace||(e.replace=acf.get_uniqid()),e.before.apply(this,[t]),acf.do_action("before_duplicate",t);var i=t.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),e.search&&(i.attr("data-id",e.replace),i.find('[id*="'+e.search+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(e.search,e.replace))}),i.find('[name*="'+e.search+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(e.search,e.replace))}),i.find('label[for*="'+e.search+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(e.search,e.replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",t,i),e.after.apply(this,[t,i]),e.append.apply(this,[t,i]),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("<textarea/>").html(e).text()},parse_args:function(e,t){return"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={}),$.extend({},t,e)},enqueue_script:function(e,t){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,i.readyState?i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(i.onreadystatechange=null,t())}:i.onload=function(){t()},document.body.appendChild(i)}},acf.model={actions:{},filters:{},events:{},extend:function(e){var t=$.extend({},this,e);return $.each(t.actions,function(e,i){t._add_action(e,i)}),$.each(t.filters,function(e,i){t._add_filter(e,i)}),$.each(t.events,function(e,i){t._add_event(e,i)}),t},_add_action:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_action(e,i[t],n,i)},_add_filter:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_filter(e,i[t],n,i)},_add_event:function(e,t){var i=this,a=e.indexOf(" "),n=a>0?e.substr(0,a):e,s=a>0?e.substr(a+1):"",o=function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,arguments)};s?$(document).on(n,s,o):$(document).on(n,o)},get:function(e,t){return t=t||null,void 0!==this[e]&&(t=this[e]),t},set:function(e,t){return this[e]=t,"function"==typeof this["_set_"+e]&&this["_set_"+e].apply(this),this}},acf.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_action(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_filter(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),s=acf.get_selector(i.type);$(document).on(a,s+" "+n,function(e){var a=$(this),n=acf.get_closest_field(a,i.type);n.length&&(n.is(i.$field)||i.set("$field",n),e.$el=a,e.$field=n,i[t].apply(i,[e]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(e){return this.set("$field",e)}}),acf.fields=acf.model.extend({actions:{prepare:"_prepare",prepare_field:"_prepare_field",ready:"_ready",ready_field:"_ready_field",append:"_append",append_field:"_append_field",load:"_load",load_field:"_load_field",remove:"_remove",remove_field:"_remove_field",sortstart:"_sortstart",sortstart_field:"_sortstart_field",sortstop:"_sortstop",sortstop_field:"_sortstop_field",show:"_show",show_field:"_show_field",hide:"_hide",hide_field:"_hide_field"},_prepare:function(e){acf.get_fields("",e).each(function(){acf.do_action("prepare_field",$(this))})},_prepare_field:function(e){acf.do_action("prepare_field/type="+e.data("type"),e)},_ready:function(e){acf.get_fields("",e).each(function(){acf.do_action("ready_field",$(this))})},_ready_field:function(e){acf.do_action("ready_field/type="+e.data("type"),e)},_append:function(e){acf.get_fields("",e).each(function(){acf.do_action("append_field",$(this))})},_append_field:function(e){acf.do_action("append_field/type="+e.data("type"),e)},_load:function(e){acf.get_fields("",e).each(function(){acf.do_action("load_field",$(this))})},_load_field:function(e){acf.do_action("load_field/type="+e.data("type"),e)},_remove:function(e){acf.get_fields("",e).each(function(){acf.do_action("remove_field",$(this))})},_remove_field:function(e){acf.do_action("remove_field/type="+e.data("type"),e)},_sortstart:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstart_field",$(this),t)})},_sortstart_field:function(e,t){acf.do_action("sortstart_field/type="+e.data("type"),e,t)},_sortstop:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstop_field",$(this),t)})},_sortstop_field:function(e,t){acf.do_action("sortstop_field/type="+e.data("type"),e,t)},_hide:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("hide_field",$(this),t)})},_hide_field:function(e,t){acf.do_action("hide_field/type="+e.data("type"),e,t)},_show:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("show_field",$(this),t)})},_show_field:function(e,t){acf.do_action("show_field/type="+e.data("type"),e,t)}}),$(document).ready(function(){acf.do_action("ready",$("body"))}),$(window).on("load",function(){acf.do_action("load",$("body"))}),acf.layout=acf.model.extend({actions:{"refresh 99":"refresh"},refresh:function(e){e=e||$("body"),this.render_tables(e),this.render_groups(e)},render_tables:function(e){var t=this,i=e.find(".acf-table:visible");e.is("table")?i=i.add(e):e.is("tr")&&(i=i.add(e.closest("table"))),i.each(function(){t.render_table($(this))})},render_table:function(e){var t=e.find("> thead th.acf-th"),i=1,a=100;if(t.exists()){var n=e.find("> tbody > tr"),s=n.find("> td.acf-field");n.hasClass("acf-clone")&&n.length>1&&(s=n.not(".acf-clone").find("> td.acf-field")),t.each(function(){var e=$(this),t=e.attr("data-key"),i=s.filter('[data-key="'+t+'"]');i.removeClass("appear-empty"),e.removeClass("hidden-by-conditional-logic"),i.exists()&&(0==i.not(".hidden-by-conditional-logic").length?e.addClass("hidden-by-conditional-logic"):i.filter(".hidden-by-conditional-logic").addClass("appear-empty"))}),t.css("width","auto"),t=t.not(".hidden-by-conditional-logic"),i=t.length,t.filter("[data-width]").each(function(){var e=parseInt($(this).attr("data-width"));a-=e,$(this).css("width",e+"%")}),t=t.not("[data-width]"),t.each(function(){var e=a/t.length;$(this).css("width",e+"%")}),e.find(".acf-row .acf-field.-collapsed-target").removeAttr("colspan"),e.find(".acf-row.-collapsed .acf-field.-collapsed-target").attr("colspan",i)}},render_groups:function(e){var t=this,i=e.find(".acf-fields:visible");e&&e.is(".acf-fields")&&(i=i.add(e)),i.each(function(){t.render_group($(this))})},render_group:function(e){var t=$(),i=0,a=0,n=-1,s=e.children(".acf-field[data-width]:visible");if(s.exists()){if(e.hasClass("-left"))return s.removeAttr("data-width"),void s.css("width","auto");s.removeClass("-r0 -c0").css({"min-height":0}),s.each(function(e){var s=$(this),o=s.position().top;0==e&&(i=o),o!=i&&(t.css({"min-height":a+1+"px"}),t=$(),i=s.position().top,a=0,n=-1),n++,a=s.outerHeight()>a?s.outerHeight():a,t=t.add(s),0==o?s.addClass("-r0"):0==n&&s.addClass("-c0")}),t.exists()&&t.css({"min-height":a+1+"px"})}}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){var e=$("#_acf_changed");e.length&&e.val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({locked:1,active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{ready:"ready",change:"on",submit:"off"},ready:function(){setTimeout(function(){acf.unload.locked=0},1e3)},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){this.changed||!this.active||this.locked||(this.changed=1,$(window).on("beforeunload",this.unload))},off:function(){this.changed=0,$(window).off("beforeunload",this.unload)},unload:function(){return acf._e("unload")}}),acf.tooltip=acf.model.extend({events:{"mouseenter .acf-js-tooltip":"_on","mouseup .acf-js-tooltip":"_off","mouseleave .acf-js-tooltip":"_off"},tooltip:function(e,t){var i=$('<div class="acf-tooltip">'+e+"</div>");$("body").append(i);var a=10;target_w=t.outerWidth(),target_h=t.outerHeight(),target_t=t.offset().top,target_l=t.offset().left,tooltip_w=i.outerWidth(),tooltip_h=i.outerHeight();var n=target_t-tooltip_h,s=target_l+target_w/2-tooltip_w/2;return s<10?(i.addClass("right"),s=target_l+target_w,n=target_t+target_h/2-tooltip_h/2):s+tooltip_w+10>$(window).width()?(i.addClass("left"),s=target_l-tooltip_w,n=target_t+target_h/2-tooltip_h/2):n-$(window).scrollTop()<10?(i.addClass("bottom"),n=target_t+target_h):i.addClass("top"),i.css({top:n,left:s}),i},temp:function(e,t){var t=this.tooltip(e,t),i=0;i+=250,setTimeout(function(){t.addClass("acf-fade-up")},i),i+=250,setTimeout(function(){t.remove()},i)},confirm:function(e,t,i,a,n){i=i||acf._e("are_you_sure"),a=a||'<a href="#" class="acf-confirm-y">'+acf._e("yes")+"</a>",n=n||'<a href="#" class="acf-confirm-n">'+acf._e("No")+"</a>";var s=this.tooltip(i+" "+a+" "+n,e);s.addClass("-confirm");var o=function(i,a){i.preventDefault(),i.stopImmediatePropagation(),e.off("click",r),s.off("click",".acf-confirm-y",r),s.off("click",".acf-confirm-n",l),$("body").off("click",l),s.remove(),t.apply(null,[a])},r=function(e){o(e,!0)},l=function(e){o(e,!1)};s.on("click",".acf-confirm-y",r),s.on("click",".acf-confirm-n",l),e.on("click",r),$("body").on("click",l)},confirm_remove:function(e,t){text=!1,button_y='<a href="#" class="acf-confirm-y -red">'+acf._e("remove")+"</a>",button_n='<a href="#" class="acf-confirm-n">'+acf._e("cancel")+"</a>",this.confirm(e,t,!1,button_y,button_n)},_on:function(e){var t=e.$el.attr("title");if(t){var i=this.tooltip(t,e.$el);e.$el.data("acf-tooltip",{title:t,$el:i}),e.$el.attr("title","")}},_off:function(e){var t=e.$el.data("acf-tooltip");t&&(t.$el.remove(),e.$el.attr("title",t.title))}}),acf.postbox=acf.model.extend({events:{"mouseenter .acf-postbox .handlediv":"on","mouseleave .acf-postbox .handlediv":"off"},on:function(e){e.$el.siblings(".hndle").addClass("hover")},off:function(e){e.$el.siblings(".hndle").removeClass("hover")},render:function(e){e=$.extend({},{id:"",key:"",style:"default",label:"top",edit_url:"",edit_title:"",visibility:!0},e);var t=$("#"+e.id),i=$("#"+e.id+"-hide"),a=i.parent();t.addClass("acf-postbox"),a.addClass("acf-postbox-toggle"),t.removeClass("hide-if-js"),a.removeClass("hide-if-js"),"default"!==e.style&&t.addClass(e.style),t.children(".inside").addClass("acf-fields").addClass("-"+e.label),e.visibility?i.prop("checked",!0):(t.addClass("acf-hidden"),a.addClass("acf-hidden")),e.edit_url&&t.children(".hndle").append('<a href="'+e.edit_url+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+e.edit_title+'"></a>')}});var e=acf.model.extend({events:{"click .acf-panel-title":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el.parent())},is_open:function(e){return e.hasClass("-open")},toggle:function(e){this.is_open(e)?this.close(e):this.open(e)},open:function(e){e.addClass("-open"),e.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(e){e.removeClass("-open"),e.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}});acf.notice=acf.model.extend({actions:{prepare:"prepare"},prepare:function(){var e=$(".acf-notice");e.length&&$("h1:first").after(e)},html:function(e,t){},success:function(e){},error:function(e){},warning:function(e){},information:function(e){}});var t=localStorage.getItem("acf");t=t?JSON.parse(t):{};var a=function(e){return"this."===e.substr(0,5)&&(e=e.substr(5)+"-"+acf.get("post_id")),e};acf.getPreference=function(e){return e=a(e),t[e]||null},acf.setPreference=function(e,i){e=a(e),null===i?delete t[e]:t[e]=i,localStorage.setItem("acf",JSON.stringify(t))},acf.removePreference=function(e){acf.setPreference(e,null)},acf.lock=function(e,t,i){var a=n(e,t);a.indexOf(i)<0&&(a.push(i),s(e,t,a))},acf.unlock=function(e,t,i){var a=n(e,t),o=a.indexOf(i);o>-1&&(a.splice(o,1),s(e,t,a))},acf.isLocked=function(e,t){return n(e,t).length>0};var n=function(e,t){return e.data("acf-lock-"+t)||[]},s=function(e,t,i){e.data("acf-lock-"+t,i)};$(document).on("sortstart",function(e,t){acf.do_action("sortstart",t.item,t.placeholder)}),$(document).on("sortstop",function(e,t){acf.do_action("sortstop",t.item,t.placeholder)}),acf.add_action("sortstart",function(e,t){e.is("tr")&&(e.css("position","relative"),e.children().each(function(){$(this).width($(this).width())}),e.css("position","absolute"),t.html('<td style="height:'+e.height()+'px; padding:0;" colspan="'+e.children("td").length+'"></td>'))}),acf.add_action("before_duplicate",function(e){e.find("select option:selected").addClass("selected")}),acf.add_action("after_duplicate",function(e,t){t.find("select").each(function(){var e=$(this),t=[];e.find("option.selected").each(function(){t.push($(this).val())}),e.val(t)}),e.find("select option.selected").removeClass("selected"),t.find("select option.selected").removeClass("selected")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return $.inArray(e,this)})}(jQuery),function($){acf.ajax=acf.model.extend({active:!1,actions:{ready:"ready"},events:{"change #page_template":"_change_template","change #parent_id":"_change_parent","change #post-formats-select input":"_change_format","change .categorychecklist input":"_change_term","change .categorychecklist select":"_change_term",'change .acf-taxonomy-field[data-save="1"] input':"_change_term",'change .acf-taxonomy-field[data-save="1"] select':"_change_term"},o:{},xhr:null,update:function(e,t){return this.o[e]=t,this},get:function(e){return this.o[e]||null},ready:function(){this.update("post_id",acf.get("post_id")),this.active=!0},fetch:function(){if(this.active&&"post"===acf.get("screen")&&acf.get("ajax")){this.xhr&&this.xhr.abort();var e=this,t=this.o;t.action="acf/post/get_field_groups",t.exists=[],$(".acf-postbox").not(".acf-hidden").each(function(){t.exists.push($(this).attr("id").substr(4))}),this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(t),type:"post",dataType:"json",success:function(t){acf.is_ajax_success(t)&&e.render(t.data)}})}},render:function(e){$(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),$.each(e,function(e,t){var i=$("#acf-"+t.key),a=$("#acf-"+t.key+"-hide"),n=a.parent();i.removeClass("acf-hidden hide-if-js").show(),n.removeClass("acf-hidden hide-if-js").show(),a.prop("checked",!0);var s=i.find(".acf-replace-with-fields");s.exists()&&(s.replaceWith(t.html),acf.do_action("append",i)),0===e&&$("#acf-style").html(t.style),i.find(".acf-hidden-by-postbox").prop("disabled",!1)}),$(".acf-postbox.acf-hidden").find("select, textarea, input").not(":disabled").each(function(){$(this).addClass("acf-hidden-by-postbox").prop("disabled",!0)})},sync_taxonomy_terms:function(){var e=[""];$(".categorychecklist, .acf-taxonomy-field").each(function(){var t=$(this),i=t.find('input[type="checkbox"]').not(":disabled"),a=t.find('input[type="radio"]').not(":disabled"),n=t.find("select").not(":disabled"),s=t.find('input[type="hidden"]').not(":disabled");t.is(".acf-taxonomy-field")&&"1"!=t.attr("data-save")||t.closest(".media-frame").exists()||(i.exists()?i.filter(":checked").each(function(){e.push($(this).val())}):a.exists()?a.filter(":checked").each(function(){e.push($(this).val())}):n.exists()?n.find("option:selected").each(function(){e.push($(this).val())}):s.exists()&&s.each(function(){$(this).val()&&e.push($(this).val())}))}),e=e.filter(function(e,t,i){return i.indexOf(e)==t}),this.update("post_taxonomy",e).fetch()},_change_template:function(e){var t=e.$el.val();this.update("page_template",t).fetch()},_change_parent:function(e){var t="parent",i=0;""!=e.$el.val()&&(t="child",i=e.$el.val()),this.update("page_type",t).update("page_parent",i).fetch()},_change_format:function(e){var t=e.$el.val();"0"==t&&(t="standard"),this.update("post_format",t).fetch()},_change_term:function(e){var t=this;e.$el.closest(".media-frame").exists()||setTimeout(function(){t.sync_taxonomy_terms()},1)}})}(jQuery),function($){acf.fields.button_group=acf.field.extend({type:"button_group",$div:null,events:{'click input[type="radio"]':"click"},focus:function(){this.$div=this.$field.find(".acf-button-group"),this.o=acf.get_data(this.$div,{allow_null:0})},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected");this.$div.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),e.$el.trigger("change"))}})}(jQuery),function($){acf.fields.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"_change","click .acf-add-checkbox":"_add"},focus:function(){this.$ul=this.$field.find("ul"),this.$input=this.$field.find('input[type="hidden"]')},add:function(){var e=this.$input.attr("name")+"[]",t='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+e+'" /></li>';this.$ul.find(".acf-add-checkbox").parent("li").before(t)},_change:function(e){var t=this.$ul,i=t.find('input[type="checkbox"]').not(".acf-checkbox-toggle"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a).trigger("change");if(e.$el.hasClass("acf-checkbox-custom")){var n=e.$el.next('input[type="text"]');e.$el.next('input[type="text"]').prop("disabled",!a),a||""!=n.val()||e.$el.parent("li").remove()}if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}},_add:function(e){this.add()}})}(jQuery),function($){acf.fields.color_picker=acf.field.extend({type:"color_picker",$input:null,$hidden:null,actions:{ready:"initialize",append:"initialize"},focus:function(){this.$input=this.$field.find('input[type="text"]'),this.$hidden=this.$field.find('input[type="hidden"]')},initialize:function(){var e=this.$input,t=this.$hidden,i=function(){setTimeout(function(){acf.val(t,e.val())},1)},a={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},a=acf.apply_filters("color_picker_args",a,this.$field);this.$input.wpColorPicker(a)}})}(jQuery),function($,e){var t="hidden-by-conditional-logic",i="conditional_logic",a=acf.conditional_logic=acf.model.extend({conditions:{},triggers:{},$parent:!1,actions:{"prepare 20":"render","append 20":"render",change:"change"},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n];this.addTrigger(s.field,e)}}this.setCondition(e,t)},getTrigger:function(e){return this.triggers[e]||null},setTrigger:function(e,t){this.triggers[e]=t},addTrigger:function(e,t){var i=this.getTrigger(e)||{};i[t]=1,this.setTrigger(e,i)},getConditions:function(){return this.conditions},getCondition:function(e){return this.conditions[e]||null},setCondition:function(e,t){this.conditions[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.renderFields(t),acf.do_action("refresh",e)},findTarget:function(e,t){var i=this;this.$parent=!1;var a=acf.get_selector(t),n=e.siblings(a);if(n.length)return this.$parent=e.parent(),n;var n=acf.get_fields(t,!1,!0);return n.length>1&&e.parents(".acf-row, .acf-table, .acf-fields").each(function(){var e=$(this),t=e.find(n);if(t.length)return n=t,i.$parent=e,!1}),n},change:function(e){var t=acf.get_field_wrap(e),i=t.data("key"),a=this.getTrigger(i);if(!a)return!1;for(var n in a){var s=this.findTarget(t,n);this.renderFields(s)}acf.do_action("refresh",this.$parent)},renderFields:function(e){var t=this;e.each(function(){t.renderField($(this))})},renderField:function(e){var t=!1,i=e.data("key"),a=this.getCondition(i);if(!a)return!1;for(var n=0;n<a.length;n++){for(var s=a[n],o=!0,r=0;r<s.length;r++){var l=s[r],c=this.findTarget(e,l.field);if(!this.calculate(l,c,e)){o=!1;break}}if(o){t=!0;break}}t?this.showField(e):this.hideField(e)},showField:function(e,a){return a=a||"default",!!acf.isLocked(e,i)&&(acf.unlock(e,i,a),!acf.isLocked(e,i)&&(e.removeClass(t),acf.enable_form(e,i),void acf.do_action("show_field",e,i)))},hideField:function(e,a){a=a||"default";var n=acf.isLocked(e,i);if(acf.lock(e,i,a),n)return!1;e.addClass(t),acf.disable_form(e,i),acf.do_action("hide_field",e,i)},calculate:function(e,t,i){if(!t||!i)return!1;var a=!1,n=t.data("type");return"true_false"==n||"checkbox"==n||"radio"==n||"button_group"==n?a=this.calculate_checkbox(e,t):"select"==n&&(a=this.calculate_select(e,t)),"!="===e.operator&&(a=!a),a},calculate_checkbox:function(e,t){var i=t.find('input[value="'+e.value+'"]:checked').exists();return""!==e.value||t.find("input:checked").exists()||(i=!0),i},calculate_select:function(e,t){var i=t.find("select"),a=i.val();return a||$.isNumeric(a)||(a=""),$.isArray(a)||(a=[a]),match=$.inArray(e.value,a)>-1,match}});a.show_field=a.showField,a.hide_field=a.hideField}(jQuery),
|
2 |
-
function($){acf.datepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_picker"),l10n&&void 0!==$.datepicker&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){void 0!==$.datepicker&&(t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'))},destroy:function(e){}}),acf.fields.date_picker=acf.field.extend({type:"date_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(this.o.save_format)return this.initialize2();var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field),acf.datepicker.init(this.$input,e),acf.do_action("date_picker_init",this.$input,e,this.$field)},initialize2:function(){this.$input.val(this.$hidden.val());var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:this.o.save_format,changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field);var t=e.dateFormat;e.dateFormat=this.o.save_format,acf.datepicker.init(this.$input,e),this.$input.datepicker("option","dateFormat",t),acf.do_action("date_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&void 0!==$.timepicker&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){void 0!==$.timepicker&&(t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'))},destroy:function(e){}}),acf.fields.date_time_picker=acf.field.extend({type:"date_time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){var e={dateFormat:this.o.date_format,timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day,controlType:"select",oneLine:!0};e=acf.apply_filters("date_time_picker_args",e,this.$field),acf.datetimepicker.init(this.$input,e),acf.do_action("date_time_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.file=acf.field.extend({type:"file",$el:null,$input:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-file-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"};return e.id&&(t=e.attributes),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$el.find("img").attr({src:e.icon,alt:e.alt,title:e.title}),this.$el.find('[data-name="title"]').text(e.title),this.$el.find('[data-name="filename"]').text(e.filename).attr("href",e.url),this.$el.find('[data-name="filesize"]').text(e.filesizeHumanReadable);var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(t,"repeater"),a=acf.media.popup({title:acf._e("file","select"),mode:"select",type:"",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-file-uploader.has-value").exists()&&void(t=!1)}),!t){if(!(o=acf.fields.repeater.doFocus(i).add()))return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("file","edit"),button:acf._e("file","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},get_file_info:function(e,t){var i=e.val(),a={};if(!i)return void t.val("");a.url=i;var n=e[0].files;if(n.length){var s=n[0];if(a.size=s.size,a.type=s.type,s.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,r=new Image;r.onload=function(){a.width=this.width,a.height=this.height,t.val(jQuery.param(a))},r.src=o.createObjectURL(s)}}t.val(jQuery.param(a))},change:function(e){this.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.google_map=acf.field.extend({type:"google_map",url:"",$el:null,$search:null,timeout:null,status:"",geocoder:!1,map:!1,maps:{},$pending:$(),actions:{ready:"initialize",append:"initialize",show:"show"},events:{'click a[data-name="clear"]':"_clear",'click a[data-name="locate"]':"_locate",'click a[data-name="search"]':"_search","keydown .search":"_keydown","keyup .search":"_keyup","focus .search":"_focus","blur .search":"_blur","mousedown .acf-google-map":"_mousedown"},focus:function(){this.$el=this.$field.find(".acf-google-map"),this.$search=this.$el.find(".search"),this.o=acf.get_data(this.$el),this.o.id=this.$el.attr("id"),this.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status||"loading"!=this.status&&(acf.isset(window,"google","maps","places")?(this.status="ready",!0):(acf.isset(window,"google","maps")&&(this.status="ready"),this.url&&(this.status="loading",acf.enqueue_script(this.url,function(){e.status="ready",e.initialize_pending()})),"ready"==this.status))},initialize_pending:function(){var e=this;this.$pending.each(function(){e.set("$field",$(this)).initialize()}),this.$pending=$()},initialize:function(){if(!this.is_ready())return this.$pending=this.$pending.add(this.$field),!1;this.geocoder||(this.geocoder=new google.maps.Geocoder);var e=this,t=this.$field,i=this.$el;this.$search.val(this.$el.find(".input-address").val());var a=acf.apply_filters("google_map_args",{scrollwheel:!1,zoom:parseInt(this.o.zoom),center:new google.maps.LatLng(this.o.lat,this.o.lng),mapTypeId:google.maps.MapTypeId.ROADMAP},this.$field);if(this.map=new google.maps.Map(this.$el.find(".canvas")[0],a),acf.isset(window,"google","maps","places","Autocomplete")){var n=new google.maps.places.Autocomplete(this.$search[0]);n.bindTo("bounds",this.map),google.maps.event.addListener(n,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=n}var s=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(s),this.map.$el=i,this.map.$field=t;var o=i.find(".input-lat").val(),r=i.find(".input-lng").val();o&&r&&this.update(o,r).center(),google.maps.event.addListener(this.map.marker,"dragend",function(){var t=this.map.marker.getPosition(),i=t.lat(),a=t.lng();e.update(i,a).sync()}),google.maps.event.addListener(this.map,"click",function(t){var i=t.latLng.lat(),a=t.latLng.lng();e.update(i,a).sync()}),acf.do_action("google_map_init",this.map,this.map.marker,this.$field),this.maps[this.o.id]=this.map},search:function(e){var t=this,i=this.$search.val();if(!i)return!1;this.$el.find(".input-address").val(i);var a=i.split(",");if(2==a.length){var n=a[0],s=a[1];if($.isNumeric(n)&&$.isNumeric(s))return n=parseFloat(n),s=parseFloat(s),void t.update(n,s).center()}if(e&&e.geometry){var n=e.geometry.location.lat(),s=e.geometry.location.lng();return void t.update(n,s).center()}this.$el.addClass("-loading"),t.geocoder.geocode({address:i},function(i,a){if(t.$el.removeClass("-loading"),a!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+a);if(!i[0])return void console.log("No results found");e=i[0];var n=e.geometry.location.lat(),s=e.geometry.location.lng();t.update(n,s).center()})},update:function(e,t){var i=new google.maps.LatLng(e,t);return acf.val(this.$el.find(".input-lat"),e),acf.val(this.$el.find(".input-lng"),t),this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.$el.addClass("-value"),this.$field.removeClass("error"),acf.do_action("google_map_change",i,this.map,this.$field),this.$search.blur(),this},center:function(){var e=this.map.marker.getPosition(),t=this.o.lat,i=this.o.lng;e&&(t=e.lat(),i=e.lng());var a=new google.maps.LatLng(t,i);this.map.setCenter(a)},sync:function(){var e=this,t=this.map.marker.getPosition(),i=new google.maps.LatLng(t.lat(),t.lng());return this.$el.addClass("-loading"),this.geocoder.geocode({latLng:i},function(t,i){if(e.$el.removeClass("-loading"),i!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+i);if(!t[0])return void console.log("No results found");var a=t[0];e.$search.val(a.formatted_address),acf.val(e.$el.find(".input-address"),a.formatted_address)}),this},refresh:function(){if(!this.is_ready())return!1;google.maps.event.trigger(this.map,"resize"),this.center()},show:function(){var e=this,t=this.$field;setTimeout(function(){e.set("$field",t).refresh()},10)},_clear:function(e){this.$el.removeClass("-value -loading -search"),this.$search.val(""),acf.val(this.$el.find(".input-address"),""),acf.val(this.$el.find(".input-lat"),""),acf.val(this.$el.find(".input-lng"),""),this.map.marker.setVisible(!1)},_locate:function(e){var t=this;if(!navigator.geolocation)return alert(acf._e("google_map","browser_support")),this;this.$el.addClass("-loading"),navigator.geolocation.getCurrentPosition(function(e){t.$el.removeClass("-loading");var i=e.coords.latitude,a=e.coords.longitude;t.update(i,a).sync().center()})},_search:function(e){this.search()},_focus:function(e){this.$el.removeClass("-value"),this._keyup()},_blur:function(e){var t=this,i=this.$el.find(".input-address").val();i&&(this.timeout=setTimeout(function(){t.$el.addClass("-value"),t.$search.val(i)},100))},_keydown:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()?this.$el.addClass("-search"):this.$el.removeClass("-search")},_mousedown:function(e){var t=this;setTimeout(function(){clearTimeout(t.timeout)},1)}})}(jQuery),function($){acf.fields.image=acf.field.extend({type:"image",$el:null,$input:null,$img:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-image-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.$img=this.$el.find("img"),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",caption:"",description:"",width:0,height:0};return e.id&&(t=e.attributes,t.url=acf.maybe_get(t,"sizes."+this.o.preview_size+".url",t.url)),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$img.attr({src:e.url,alt:e.alt,title:e.title});var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(this.$field,"repeater"),a=acf.media.popup({title:acf._e("image","select"),mode:"select",type:"image",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-image-uploader.has-value").exists()&&void(t=!1)}),!t){if(!(o=acf.fields.repeater.doFocus(i).add()))return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("image","edit"),button:acf._e("image","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},change:function(e){acf.fields.file.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.link=acf.field.extend({type:"link",active:!1,$el:null,$node:null,events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove","change .link-node":"change"},focus:function(){this.$el=this.$field.find(".acf-link"),this.$node=this.$el.find(".link-node")},add:function(e){acf.link.open(this.$node)},edit:function(e){this.add()},remove:function(e){this.val("")},change:function(e,t){var i={title:this.$node.html(),url:this.$node.attr("href"),target:this.$node.attr("target")};this.val(i)},val:function(e){e=acf.parse_args(e,{title:"",url:"",target:""}),this.$el.removeClass("-value -external"),e.url&&this.$el.addClass("-value"),"_blank"===e.target&&this.$el.addClass("-external"),this.$el.find(".link-title").html(e.title),this.$el.find(".link-url").attr("href",e.url).html(e.url),this.$el.find(".input-title").val(e.title),this.$el.find(".input-target").val(e.target),this.$el.find(".input-url").val(e.url).trigger("change"),this.$node.html(e.title),this.$node.attr("href",e.url),this.$node.attr("target",e.target)}}),acf.link=acf.model.extend({active:!1,$textarea:null,$node:null,events:{"click #wp-link-submit":"_update","wplink-open":"_open","wplink-close":"_close"},atts:function(e){return void 0!==e?(this.$node.html(e.title),this.$node.attr("href",e.url),this.$node.attr("target",e.target),this.$node.trigger("change",[e]),!0):{title:this.$node.html(),url:this.$node.attr("href"),target:this.$node.attr("target")}},inputs:function(e){return void 0!==e?($("#wp-link-text").val(e.title),$("#wp-link-url").val(e.url),$("#wp-link-target").prop("checked","_blank"===e.target),!0):{title:$("#wp-link-text").val(),url:$("#wp-link-url").val(),target:$("#wp-link-target").prop("checked")?"_blank":""}},open:function(e){var t=$('<textarea id="acf-link-textarea"></textarea>');e.before(t),this.active=!0,this.$node=e,this.$textarea=t;var i=this.atts();wpLink.open("acf-link-textarea",i.url,i.title,null),$("#wp-link-wrap").addClass("has-text-field")},reset:function(){this.active=!1,this.$textarea.remove(),this.$textarea=null,this.$node=null},_select:function(e,t){var i=this.inputs();i.title||(i.title=t.find(".item-title").text(),this.inputs(i),console.log(i))},_open:function(e){if(this.active){var t=this.atts();this.inputs(t)}},_close:function(e){this.active&&setTimeout(function(){acf.link.reset()},100)},_update:function(e){if(this.active){var t=this.inputs();this.atts(t)}}})}(jQuery),function($){acf.media=acf.model.extend({frames:[],mime_types:{},actions:{ready:"ready"},frame:function(){var e=this.frames.length-1;return!(e<0)&&this.frames[e]},destroy:function(e){e.detach(),e.dispose(),e=null,this.frames.pop()},popup:function(e){var t=acf.get("post_id"),i=!1;$.isNumeric(t)||(t=0);var a=acf.parse_args(e,{mode:"select",title:"",button:"",type:"",field:"",mime_types:"",library:"all",multiple:!1,attachment:0,post_id:t,select:function(){}});a.id&&(a.attachment=a.id);var i=this.new_media_frame(a);return this.frames.push(i),setTimeout(function(){i.open()},1),i},_get_media_frame_settings:function(e,t){return"select"===t.mode?e=this._get_select_frame_settings(e,t):"edit"===t.mode&&(e=this._get_edit_frame_settings(e,t)),e},_get_select_frame_settings:function(e,t){return t.type&&(e.library.type=t.type),"uploadedTo"===t.library&&(e.library.uploadedTo=t.post_id),e._button=acf._e("media","select"),e},_get_edit_frame_settings:function(e,t){return e.library.post__in=[t.attachment],e._button=acf._e("media","update"),e},_add_media_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+t.mode)},e),e.on("content:render:edit-image",function(){var e=this.state().get("image"),t=new wp.media.view.EditImage({model:e,controller:this}).render();this.content.set(t),t.loadEditor()},e),e.on("toolbar:create:select",function(t){t.view=new wp.media.view.Toolbar.Select({text:e.options._button,controller:this})},e),e.on("select",function(){var i=e.state(),a=i.get("image"),n=i.get("selection");if(a)return void t.select.apply(e,[a,0]);if(n){var s=0;return void n.each(function(i){t.select.apply(e,[i,s]),s++})}}),e.on("close",function(){setTimeout(function(){acf.media.destroy(e)},500)}),"select"===t.mode?e=this._add_select_frame_events(e,t):"edit"===t.mode&&(e=this._add_edit_frame_events(e,t)),e},_add_select_frame_events:function(e,t){var i=this;return acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=t.field,e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){try{var a=e.content.get().toolbar,n=a.get("filters"),s=a.get("search")}catch(e){return}if("image"==t.type&&(n.filters.all.text=acf._e("image","all"),delete n.filters.audio,delete n.filters.video,$.each(n.filters,function(e,t){null===t.props.type&&(t.props.type="image")})),t.mime_types){var o=t.mime_types.split(" ").join("").split(".").join("").split(",");$.each(o,function(e,t){$.each(i.mime_types,function(e,i){if(-1!==e.indexOf(t)){var a={text:t,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};n.filters[i]=a}})})}"uploadedTo"==t.library&&(delete n.filters.unattached,delete n.filters.uploaded,n.$el.parent().append('<span class="acf-uploadedTo">'+acf._e("image","uploadedTo")+"</span>"),$.each(n.filters,function(e,i){i.props.uploadedTo=t.post_id})),$.each(n.filters,function(e,i){i.props._acfuploader=t.field}),s.model.attributes._acfuploader=t.field,"function"==typeof n.refresh&&n.refresh()}),e},_add_edit_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),a=wp.media.attachment(t.attachment);i.add(a)},e),e},new_media_frame:function(e){var t={title:e.title,multiple:e.multiple,library:{},states:[]};t=this._get_media_frame_settings(t,e);var i=wp.media.query(t.library);acf.isset(i,"mirroring","args")&&(i.mirroring.args._acfuploader=e.field),t.states=[new wp.media.controller.Library({library:i,multiple:t.multiple,title:t.title,priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})],acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage);var a=wp.media(t);return a.acf=e,a=this._add_media_frame_events(a,e)},ready:function(){var e=acf.get("wp_version"),t=acf.get("browser"),i=acf.get("post_id");acf.isset(window,"wp","media","view","settings","post")&&$.isNumeric(i)&&(wp.media.view.settings.post.id=i),t&&$("body").addClass("browser-"+t),e&&(e+="",major=e.substr(0,1),$("body").addClass("major-"+major)),acf.isset(window,"wp","media","view")&&(this.customize_Attachment(),this.customize_AttachmentFiltersAll(),this.customize_AttachmentCompat())},customize_Attachment:function(){var e=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=e.extend({render:function(){var t=acf.media.frame(),i=acf.maybe_get(this,"model.attributes.acf_errors");return t&&i&&this.$el.addClass("acf-disabled"),e.prototype.render.apply(this,arguments)},toggleSelection:function(t){var i=this.collection,a=this.options.selection,n=this.model,s=a.single(),o=acf.media.frame(),r=acf.maybe_get(this,"model.attributes.acf_errors"),l=this.controller.$el.find(".media-frame-content .media-sidebar");if(l.children(".acf-selection-error").remove(),l.children().removeClass("acf-hidden"),o&&r){var c=acf.maybe_get(this,"model.attributes.filename","");return l.children().addClass("acf-hidden"),l.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf._e("restricted")+"</span>",'<span class="selection-error-filename">'+c+"</span>",'<span class="selection-error-message">'+r+"</span>","</div>"].join("")),a.reset(),void a.single(n)}e.prototype.toggleSelection.apply(this,arguments)}})},customize_AttachmentFiltersAll:function(){wp.media.view.AttachmentFilters.All.prototype.refresh=function(){this.$el.html(_.chain(this.filters).map(function(e,t){return{el:$("<option></option>").val(t).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())}},customize_AttachmentCompat:function(){var e=wp.media.view.AttachmentCompat;wp.media.view.AttachmentCompat=e.extend({add_acf_expand_button:function(){var e=this.$el.closest(".media-modal");if(!e.find(".media-frame-router .acf-expand-details").exists()){var t=$(['<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(""));t.on("click",function(t){t.preventDefault(),e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),e.find(".media-frame-router").append(t)}},render:function(){if(this.ignore_render)return this;var t=this;return setTimeout(function(){t.add_acf_expand_button()},0),clearTimeout(acf.media.render_timout),acf.media.render_timout=setTimeout(function(){acf.do_action("append",t.$el)},50),e.prototype.render.apply(this,arguments)},dispose:function(){return acf.do_action("remove",this.$el),e.prototype.dispose.apply(this,arguments)},save:function(e){e&&e.preventDefault();var t=acf.serialize(this.$el);this.ignore_render=!0,this.model.saveCompat(t)}})}})}(jQuery),function($){acf.fields.oembed=acf.field.extend({type:"oembed",$el:null,events:{'click [data-name="search-button"]':"_search",'click [data-name="clear-button"]':"_clear",'click [data-name="value-title"]':"_edit",'keypress [data-name="search-input"]':"_keypress",'keyup [data-name="search-input"]':"_keyup",'blur [data-name="search-input"]':"_blur"},focus:function(){this.$el=this.$field.find(".acf-oembed"),this.$search=this.$el.find('[data-name="search-input"]'),this.$input=this.$el.find('[data-name="value-input"]'),this.$title=this.$el.find('[data-name="value-title"]'),this.$embed=this.$el.find('[data-name="value-embed"]'),this.o=acf.get_data(this.$el)},maybe_search:function(){var e=this.$input.val(),t=this.$search.val();if(!t)return void this.clear();t!=e&&this.search()},search:function(){var e=this.$search.val();"http"!=e.substr(0,4)&&(e="http://"+e,this.$search.val(e)),this.$el.addClass("is-loading");var t=acf.prepare_for_ajax({action:"acf/fields/oembed/search",s:e,field_key:this.$field.data("key")});this.$el.data("xhr")&&this.$el.data("xhr").abort();var i=$.ajax({url:acf.get("ajaxurl"),data:t,type:"post",dataType:"json",context:this,success:this.search_success});this.$el.data("xhr",i)},search_success:function(e){var t=this.$search.val();if(this.$el.removeClass("is-loading"),!e||!e.html)return void this.$el.removeClass("has-value").addClass("has-error");this.$el.removeClass("has-error").addClass("has-value"),this.$input.val(t),this.$title.html(t),this.$embed.html(e.html)},clear:function(){this.$el.removeClass("has-error has-value"),this.$el.find('[data-name="search-input"]').val(""),this.$input.val(""),this.$title.html(""),this.$embed.html("")},edit:function(){this.$el.addClass("is-editing"),this.$search.val(this.$title.text()).focus()},blur:function(e){this.$el.removeClass("is-editing"),this.maybe_search()},_search:function(e){this.search()},_clear:function(e){this.clear()},_edit:function(e){this.edit()},_keypress:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()&&this.maybe_search()},_blur:function(e){this.blur()}})}(jQuery),function($){acf.fields.radio=acf.field.extend({type:"radio",$ul:null,actions:{ready:"initialize",append:"initialize"},events:{'click input[type="radio"]':"click"},focus:function(){this.$ul=this.$field.find(".acf-radio-list"),this.o=acf.get_data(this.$ul)},initialize:function(){this.$ul.find(".selected input").prop("checked",!0)},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected"),n=t.val();if(this.$ul.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),n=!1,e.$el.trigger("change")),this.o.other_choice){var s=this.$ul.find('input[type="text"]');"other"===n?s.prop("disabled",!1).attr("name",t.attr("name")):s.prop("disabled",!0).attr("name","")}}})}(jQuery),function($){acf.fields.range=acf.field.extend({type:"range",$el:null,$range:null,$input:null,events:{"input input":"onInput","change input":"onChange"},focus:function(){this.$el=this.$field.find(".acf-range-wrap"),this.$range=this.$el.children('input[type="range"]'),this.$input=this.$el.children('input[type="number"]')},setValue:function(e){this.$input.val(e),this.$range.val(e)},onInput:function(e){this.setValue(e.$el.val())},onChange:function(e){this.setValue(e.$el.val()),"number"==e.$el.attr("type")&&this.$range.trigger("change")}})}(jQuery),function($){acf.fields.relationship=acf.field.extend({type:"relationship",$el:null,$input:null,$filters:null,$choices:null,$values:null,actions:{ready:"initialize",append:"initialize"},events:{"keypress [data-filter]":"submit_filter","change [data-filter]":"change_filter","keyup [data-filter]":"change_filter","click .choices .acf-rel-item":"add_item",'click [data-name="remove_item"]':"remove_item"},focus:function(){this.$el=this.$field.find(".acf-relationship"),this.$input=this.$el.children('input[type="hidden"]'),this.$choices=this.$el.find(".choices"),this.$values=this.$el.find(".values"),this.o=acf.get_data(this.$el)},initialize:function(){var e=this,t=this.$field,i=this.$el,a=this.$input;this.$values.children(".list").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){a.trigger("change")}}),this.$choices.children(".list").scrollTop(0).on("scroll",function(a){if(!i.hasClass("is-loading")&&!i.hasClass("is-empty")&&Math.ceil($(this).scrollTop())+$(this).innerHeight()>=$(this).get(0).scrollHeight){var n=i.data("paged")||1;i.data("paged",n+1),e.set("$field",t).fetch()}}),this.fetch()},maybe_fetch:function(){var e=this,t=this.$field;this.o.timeout&&clearTimeout(this.o.timeout);var i=setTimeout(function(){e.doFocus(t),e.fetch()},300);this.$el.data("timeout",i)},fetch:function(){var e=this,t=this.$field;this.$el.addClass("is-loading"),this.o.xhr&&(this.o.xhr.abort(),this.o.xhr=!1),this.o.action="acf/fields/relationship/query",this.o.field_key=t.data("key"),this.o.post_id=acf.get("post_id");var i=acf.prepare_for_ajax(this.o);1==i.paged&&this.$choices.children(".list").html(""),this.$choices.find("ul:last").append('<p><i class="acf-loading"></i> '+acf._e("relationship","loading")+"</p>");var a=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:i,success:function(i){e.set("$field",t).render(i)}});this.$el.data("xhr",a)},render:function(e){if(this.$el.removeClass("is-loading is-empty"),this.$choices.find("p").remove(),!e||!e.results||!e.results.length)return this.$el.addClass("is-empty"),void(1==this.o.paged&&this.$choices.children(".list").append("<p>"+acf._e("relationship","empty")+"</p>"));var t=$(this.walker(e.results));this.$values.find(".acf-rel-item").each(function(){t.find('.acf-rel-item[data-id="'+$(this).data("id")+'"]').addClass("disabled")}),this.$choices.children(".list").append(t);var i="",a=null;this.$choices.find(".acf-rel-label").each(function(){if($(this).text()==i)return a.append($(this).siblings("ul").html()),void $(this).parent().remove();i=$(this).text(),a=$(this).siblings("ul")})},walker:function(e){var t="";if($.isArray(e))for(var i in e)t+=this.walker(e[i]);else $.isPlainObject(e)&&(void 0!==e.children?(t+='<li><span class="acf-rel-label">'+e.text+'</span><ul class="acf-bl">',t+=this.walker(e.children),t+="</ul></li>"):t+='<li><span class="acf-rel-item" data-id="'+e.id+'">'+e.text+"</span></li>");return t},submit_filter:function(e){13==e.which&&e.preventDefault()},change_filter:function(e){var t=e.$el.val(),i=e.$el.data("filter");this.$el.data(i)!=t&&(this.$el.data(i,t),this.$el.data("paged",1),e.$el.is("select")?this.fetch():this.maybe_fetch())},add_item:function(e){if(this.o.max>0&&this.$values.find(".acf-rel-item").length>=this.o.max)return void alert(acf._e("relationship","max").replace("{max}",this.o.max));if(e.$el.hasClass("disabled"))return!1;e.$el.addClass("disabled");var t=["<li>",'<input type="hidden" name="'+this.$input.attr("name")+'[]" value="'+e.$el.data("id")+'" />','<span data-id="'+e.$el.data("id")+'" class="acf-rel-item">'+e.$el.html(),'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("");this.$values.children(".list").append(t),this.$input.trigger("change"),acf.validation.remove_error(this.$field)},remove_item:function(e){var t=e.$el.parent(),i=t.data("id");t.parent("li").remove(),this.$choices.find('.acf-rel-item[data-id="'+i+'"]').removeClass("disabled"),this.$input.trigger("change")}})}(jQuery),function($){var e,t,i;e=acf.select2=acf.model.extend({version:0,version3:null,version4:null,actions:{"ready 1":"ready"},ready:function(){this.version=this.get_version(),this.do_function("ready")},get_version:function(){return acf.maybe_get(window,"Select2")?3:acf.maybe_get(window,"jQuery.fn.select2.amd")?4:0},do_function:function(e,t){t=t||[];var i="version"+this.version;return void 0!==this[i]&&void 0!==this[i][e]&&this[i][e].apply(this,t)},get_data:function(e,t){var i=this;return t=t||[],e.children().each(function(){var e=$(this);e.is("optgroup")?t.push({text:e.attr("label"),children:i.get_data(e)}):t.push({id:e.attr("value"),text:e.text()})}),t},decode_data:function(t){return t?($.each(t,function(i,a){t[i].text=acf.decode(a.text),void 0!==a.children&&(t[i].children=e.decode_data(a.children))}),t):[]},count_data:function(e){var t=0;return e?($.each(e,function(e,i){t++,void 0!==i.children&&(t+=i.children.length)}),t):t},get_ajax_data:function(e,t,i,a){var n=acf.prepare_for_ajax({action:e.ajax_action,field_key:e.key,s:t.term||"",paged:t.page||1});return n=acf.apply_filters("select2_ajax_data",n,e,i,a)},get_ajax_results:function(e,t){var i={results:[]};return e||(e=i),void 0===e.results&&(i.results=e,e=i),e.results=this.decode_data(e.results),e=acf.apply_filters("select2_ajax_results",e,t)},get_value:function(e){var t=[],i=e.find("option:selected");return i.exists()?(i=i.sort(function(e,t){return+e.getAttribute("data-i")-+t.getAttribute("data-i")}),i.each(function(){var e=$(this);t.push({id:e.attr("value"),text:e.text(),$el:e})}),t):t},get_input_value:function(e){return e.val().split("||")},sync_input_value:function(e,t){e.val(t.val().join("||"))},add_option:function(e,t,i){e.find('option[value="'+t+'"]').length||e.append('<option value="'+t+'">'+i+"</option>")},select_option:function(e,t){e.find('option[value="'+t+'"]').prop("selected",!0),e.trigger("change")},unselect_option:function(e,t){
|
3 |
-
e.find('option[value="'+t+'"]').prop("selected",!1),e.trigger("change")},init:function(e,t,i){this.do_function("init",arguments)},destroy:function(e){this.do_function("destroy",arguments)},add_value:function(e,t,i){this.do_function("add_value",arguments)},remove_value:function(e,t){this.do_function("remove_value",arguments)}}),t=e.version3={ready:function(){var e=acf.get("locale"),t=acf.get("rtl");if(l10n=acf._e("select"),l10n){var i={formatMatches:function(e){return 1===e?l10n.matches_1:l10n.matches_n.replace("%d",e)},formatNoMatches:function(){return l10n.matches_0},formatAjaxError:function(){return l10n.load_fail},formatInputTooShort:function(e,t){var i=t-e.length;return 1===i?l10n.input_too_short_1:l10n.input_too_short_n.replace("%d",i)},formatInputTooLong:function(e,t){var i=e.length-t;return 1===i?l10n.input_too_long_1:l10n.input_too_long_n.replace("%d",i)},formatSelectionTooBig:function(e){return 1===e?l10n.selection_too_long_1:l10n.selection_too_long_n.replace("%d",e)},formatLoadMore:function(){return l10n.load_more},formatSearching:function(){return l10n.searching}};$.fn.select2.locales=acf.maybe_get(window,"jQuery.fn.select2.locales",{}),$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}},set_data:function(e,t){3==this.version&&(e=e.siblings("input")),e.select2("data",t)},append_data:function(e,t){3==this.version&&(e=e.siblings("input"));var i=e.select2("data")||[];i.push(t),e.select2("data",i)},init:function(i,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=i.siblings("input");if(s.exists()){var o={width:"100%",containerCssClass:"-acf",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e},formatResult:function(e,t,i,a){var n=$.fn.select2.defaults.formatResult(e,t,i,a);return e.description&&(n+=' <span class="select2-result-description">'+e.description+"</span>"),n}},r=this.get_value(i);if(a.multiple){var l=i.attr("name");o.formatSelection=function(e,t){var i='<input type="hidden" class="select2-search-choice-hidden" name="'+l+'" value="'+e.id+'"'+(s.prop("disabled")?'disabled="disabled"':"")+" />";return t.parent().append(i),e.text}}else r=acf.maybe_get(r,0,!1),!a.allow_null&&r&&s.val(r.id);a.allow_null&&i.find('option[value=""]').remove(),o.data=this.get_data(i),o.initSelection=function(e,t){t(r)},a.ajax&&(o.ajax={url:acf.get("ajaxurl"),dataType:"json",type:"post",cache:!1,quietMillis:250,data:function(t,i){var o={term:t,page:i};return e.get_ajax_data(a,o,s,n)},results:function(i,a){var n={page:a};return setTimeout(function(){t.merge_results()},1),e.get_ajax_results(i,n)}}),o.dropdownCss={"z-index":"999999999"},o.acf=a,o=acf.apply_filters("select2_args",o,i,a,n),s.select2(o);var c=s.select2("container");c.before(i),c.before(s),a.multiple&&c.find("ul.select2-choices").sortable({start:function(){s.select2("onSortStart")},stop:function(){s.select2("onSortEnd")}}),i.prop("disabled",!0).addClass("acf-disabled acf-hidden"),s.on("change",function(t){t.added&&e.add_option(i,t.added.id,t.added.text),e.select_option(i,t.val)}),acf.do_action("select2_init",s,o,a,n)}},merge_results:function(){var e="",t=null;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children(".select2-result-label"),a=$(this).children(".select2-result-sub");if(i.text()==e)return t.append(a.children()),void $(this).remove();e=i.text(),t=a})},destroy:function(e){var t=e.siblings("input");t.data("select2")&&t.select2("destroy"),e.siblings(".select2-container").remove(),e.prop("disabled",!1).removeClass("acf-disabled acf-hidden"),t.attr("style","")},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i);var n=t.siblings("input"),s={id:i,text:a};if(!t.data("multiple"))return n.select2("data",s);var o=n.select2("data")||[];return o.push(s),n.select2("data",o)},remove_value:function(t,i){e.unselect_option(t,i);var a=t.siblings("input"),n=a.select2("data");t.data("multiple")?(n=$.grep(n,function(e){return e.id!=i}),a.select2("data",n)):n&&n.id==i&&a.select2("data",null)}},i=e.version4={init:function(t,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=t.siblings("input");if(s.exists()){var o={width:"100%",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e}},r=this.get_value(t);a.multiple?$.each(r,function(e,i){i.$el.detach().appendTo(t)}):r=acf.maybe_get(r,0,""),a.ajax?o.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:function(i){return e.get_ajax_data(a,i,t,n)},processResults:function(t,a){var n=e.get_ajax_results(t,a);return n.more&&(n.pagination={more:!0}),setTimeout(function(){i.merge_results()},1),n}}:(t.removeData("ajax"),t.removeAttr("data-ajax")),o=acf.apply_filters("select2_args",o,t,a,n),t.select2(o);var l=t.next(".select2-container");if(a.multiple){var c=l.find("ul");c.sortable({stop:function(e){c.find(".select2-selection__choice").each(function(){$($(this).data("data").element).detach().appendTo(t),s.trigger("change")})}}),t.on("select2:select",function(e){$(e.params.data.element).detach().appendTo(t)})}s.val(""),l.addClass("-acf"),acf.do_action("select2_init",t,o,a,n)}},merge_results:function(){var e=null,t=null;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),a=$(this).children("strong");if(null!==t&&a.text()==t.text())return e.append(i.children()),void $(this).remove();e=i,t=a})},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i)},remove_value:function(t,i){e.unselect_option(t,i)},destroy:function(e){e.data("select2")&&e.select2("destroy"),e.siblings(".select2-container").remove()}},acf.add_select2=function(t,i){e.init(t,i)},acf.remove_select2=function(t){e.destroy(t)}}(jQuery),function($){acf.fields.select=acf.field.extend({type:"select",$select:null,actions:{ready:"render",append:"render",remove:"remove"},focus:function(){this.$select=this.$field.find("select"),this.$select.exists()&&(this.o=acf.get_data(this.$select),this.o=acf.parse_args(this.o,{ajax_action:"acf/fields/"+this.type+"/query",key:this.$field.data("key")}))},render:function(){if(!this.$select.exists()||!this.o.ui)return!1;acf.select2.init(this.$select,this.o,this.$field)},remove:function(){if(!this.$select.exists()||!this.o.ui)return!1;acf.select2.destroy(this.$select)}}),acf.fields.user=acf.fields.select.extend({type:"user"}),acf.fields.post_object=acf.fields.select.extend({type:"post_object"}),acf.fields.page_link=acf.fields.select.extend({type:"page_link"})}(jQuery),function($,e){var t=0;acf.fields.accordion=acf.field.extend({type:"accordion",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize"},focus:function(){},initialize:function(){var e=this.$field,i=e.children(".acf-label"),a=e.children(".acf-input"),n=a.children(".acf-fields"),s=n.data();if(!e.is("td")){if(s.endpoint)return void e.remove();var o=a.children(".description");if(o.length&&i.append(o),e.is("tr")){var r=e.closest("table"),l=$('<div class="acf-accordion-title"/>'),c=$('<div class="acf-accordion-content"/>'),d=$('<table class="'+r.attr("class")+'"/>'),f=$("<tbody/>");l.append(i.html()),d.append(f),c.append(d),a.append(l),a.append(c),i.remove(),n.remove(),a.attr("colspan",2),i=l,a=c,n=f}e.addClass("acf-accordion"),i.addClass("acf-accordion-title"),a.addClass("acf-accordion-content"),t++,s.multi_expand&&e.data("multi-expand",1);var u=acf.getPreference("this.accordions")||[];void 0!==u[t-1]&&(s.open=u[t-1]),s.open&&(e.addClass("-open"),a.css("display","block")),i.prepend('<i class="acf-accordion-icon dashicons dashicons-arrow-'+(s.open?"down":"right")+'"></i>');var h=e.parent();n.addClass(h.hasClass("-left")?"-left":""),n.addClass(h.hasClass("-clear")?"-clear":""),n.append(e.nextUntil(".acf-field-accordion",".acf-field")),n.removeAttr("data-open data-multi_expand data-endpoint")}}});var i=acf.model.extend({events:{"click .acf-accordion-title":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el.closest(".acf-accordion"))},isOpen:function(e){return e.hasClass("-open")},toggle:function(e){this.isOpen(e)?this.close(e):this.open(e)},open:function(e){e.find(".acf-accordion-content:first").slideDown().css("display","block"),e.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down"),e.addClass("-open"),acf.do_action("show",e),e.data("multi-expand")||e.siblings(".acf-accordion.-open").each(function(){i.close($(this))}),acf.do_action("refresh",e)},close:function(e){e.find(".acf-accordion-content:first").slideUp(),e.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right"),e.removeClass("-open"),acf.do_action("hide",e)}});$(window).on("unload",function(){var e=[];$(".acf-accordion").each(function(){var t=$(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)});var a=acf.model.extend({active:1,events:{"invalidField .acf-accordion":"invalidField"},invalidField:function(e){this.active&&(this.block(),i.open(e.$el))},block:function(){var e=this;this.active=0,setTimeout(function(){e.active=1},1e3)}})}(jQuery),function($){var e="hidden-by-conditional-logic",t=0,i=0,a=acf.model.extend({$fields:[],actions:{"prepare 15":"initialize","append 15":"initialize","refresh 15":"refresh"},events:{"click .acf-tab-button":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el)},isOpen:function(e){return e.hasClass("-open")},toggle:function(e){var t=e.data("key"),i=e.parent(),a=e.closest(".acf-tab-wrap"),n=a.find(".active a"),s=a.siblings('.acf-field[data-key="'+t+'"]');if(!this.isOpen(s)){if(n.length){var o=n.data("key"),r=n.parent(),l=a.siblings('.acf-field[data-key="'+o+'"]');r.removeClass("active"),this.close(l)}i.addClass("active"),this.open(s),acf.do_action("refresh",a.parent())}},getFields:function(e){return e.nextUntil(".acf-field-tab",".acf-field")},getWrap:function(e){return e.prevAll(".acf-tab-wrap:first")},getTab:function(e,t){return e.find('a[data-key="'+t+'"]')},open:function(e){this.getFields(e).each(function(){$(this).removeClass("hidden-by-tab"),acf.do_action("show_field",$(this),"tab")})},close:function(e){this.getFields(e).each(function(){$(this).addClass("hidden-by-tab"),acf.do_action("hide_field",$(this),"tab")})},addTab:function(e){this.$fields.push(e)},initialize:function(){if(this.$fields.length){for(var e=0;e<this.$fields.length;e++)this.createTab(this.$fields[e]);this.$fields=[]}},createTab:function(e){if(e.is("td"))return!1;var a=e.children(".acf-label"),n=e.children(".acf-input"),s=this.getWrap(e),o=e.find(".acf-tab-button"),r=o.data(),l=!1;e.hide(),a.remove(),n.remove(),s.exists()&&!r.endpoint||(s=this.createTabWrap(e,r),l=!0);var c=$("<li></li>").append(o);return l?(c.addClass("active"),this.open(e)):this.close(e),""==o.html()&&c.hide(),s.find("ul").append(c),i++,((acf.getPreference("this.tabs")||[])[t-1]||0)!=i-1||l||this.toggle(o),c},createTabWrap:function(e,a){var n=e.parent(),s=!1;return n.hasClass("acf-fields")&&"left"==a.placement&&n.addClass("-sidebar"),s=$(e.is("tr")?'<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>':'<div class="acf-tab-wrap -'+a.placement+'"><ul class="acf-hl acf-tab-group"></ul></div>'),e.before(s),t++,i=0,s},refresh:function(e){$(".acf-tab-wrap",e).each(function(){var e=$(this);if(e.hasClass("-left")){var t=e.parent(),i=t.is("td")?"height":"min-height",a=e.position().top+e.children("ul").outerHeight(!0)-1;t.css(i,a)}})}});acf.fields.tab=acf.field.extend({type:"tab",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize",hide:"hide",show:"show"},focus:function(){},initialize:function(){a.addTab(this.$field)},hide:function(t,i){if("conditional_logic"==i){var n=t.data("key"),s=a.getWrap(t),o=a.getTab(s,n),r=o.parent();s.exists()&&(r.addClass(e),a.getFields(t).each(function(){acf.conditional_logic.hide_field($(this),n)}),r.hasClass("active")&&s.find("li:not(."+e+"):first a").trigger("click"))}},show:function(t,i){if("conditional_logic"==i){var n=t.data("key"),s=a.getWrap(t),o=a.getTab(s,n),r=o.parent();if(s.exists()){r.removeClass(e),a.getFields(t).each(function(){acf.conditional_logic.show_field($(this),n)});var l=r.siblings(".active");l.exists()&&!l.hasClass(e)||a.toggle(o)}}}}),$(window).on("unload",function(){var e=[];$(".acf-tab-wrap").each(function(){var t=$(this).find(".active").index()||0;e.push(t)}),e.length&&acf.setPreference("this.tabs",e)});var n=acf.model.extend({active:1,actions:{invalid_field:"invalid_field"},invalid_field:function(e){if(this.active&&e.hasClass("hidden-by-tab")){var t=this,i=e.prevAll(".acf-field-tab:first");e.prevAll(".acf-tab-wrap:first").find('a[data-key="'+i.data("key")+'"]').trigger("click"),this.active=0,setTimeout(function(){t.active=1},1e3)}}})}(jQuery),function($){acf.fields.time_picker=acf.field.extend({type:"time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(void 0!==$.timepicker){var e={timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf._e("date_time_picker","selectText")};e.onClose=function(e,t){var i=t.dpDiv,a=i.find(".ui-datepicker-close");if(!e&&a.is(":hover")){if(!(e=acf.maybe_get(t,"settings.timepicker.formattedTime")))return;$.datepicker._setTime(t)}},e=acf.apply_filters("time_picker_args",e,this.$field),this.$input.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'),acf.do_action("time_picker_init",this.$input,e,this.$field)}},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.true_false=acf.field.extend({type:"true_false",$switch:null,$input:null,actions:{prepare:"render",append:"render",show:"render"},events:{"change .acf-switch-input":"_change","focus .acf-switch-input":"_focus","blur .acf-switch-input":"_blur","keypress .acf-switch-input":"_keypress"},focus:function(){this.$input=this.$field.find(".acf-switch-input"),this.$switch=this.$field.find(".acf-switch")},render:function(){if(this.$switch.exists()){var e=this.$switch.children(".acf-switch-on"),t=this.$switch.children(".acf-switch-off");width=Math.max(e.width(),t.width()),width&&(e.css("min-width",width),t.css("min-width",width))}},on:function(){this.$input.prop("checked",!0),this.$switch.addClass("-on")},off:function(){this.$input.prop("checked",!1),this.$switch.removeClass("-on")},_change:function(e){e.$el.prop("checked")?this.on():this.off()},_focus:function(e){this.$switch.addClass("-focus")},_blur:function(e){this.$switch.removeClass("-focus")},_keypress:function(e){return 37===e.keyCode?this.off():39===e.keyCode?this.on():void 0}})}(jQuery),function($){acf.fields.taxonomy=acf.field.extend({type:"taxonomy",$el:null,actions:{ready:"render",append:"render",remove:"remove"},events:{'click a[data-name="add"]':"add_term"},focus:function(){this.$el=this.$field.find(".acf-taxonomy-field"),this.o=acf.get_data(this.$el,{save:"",type:"",taxonomy:""}),this.o.key=this.$field.data("key")},render:function(){var e=this.$field.find("select");if(e.exists()){var t=acf.get_data(e);t=acf.parse_args(t,{pagination:!0,ajax_action:"acf/fields/taxonomy/query",key:this.o.key}),acf.select2.init(e,t)}},remove:function(){var e=this.$field.find("select");if(!e.exists())return!1;acf.select2.destroy(e)},add_term:function(e){var t=this;acf.open_popup({title:e.$el.attr("title")||e.$el.data("title"),loading:!0,height:220});var i=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key});$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(e){t.add_term_confirm(e)}})},add_term_confirm:function(e){var t=this;acf.update_popup({content:e}),$('#acf-popup input[name="term_name"]').focus(),$("#acf-popup form").on("submit",function(e){e.preventDefault(),t.add_term_submit($(this))})},add_term_submit:function(e){var t=this,i=e.find(".acf-submit"),a=e.find('input[name="term_name"]'),n=e.find('select[name="term_parent"]');if(""===a.val())return a.focus(),!1;i.find("button").attr("disabled","disabled"),i.find(".acf-spinner").addClass("is-active");var s=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key,term_name:a.val(),term_parent:n.exists()?n.val():0});$.ajax({url:acf.get("ajaxurl"),data:s,type:"post",dataType:"json",success:function(e){var n=acf.get_ajax_message(e);acf.is_ajax_success(e)&&(a.val(""),t.append_new_term(e.data)),n.text&&i.find("span").html(n.text)},complete:function(){i.find("button").removeAttr("disabled"),i.find(".acf-spinner").removeClass("is-active"),i.find("span").delay(1500).fadeOut(250,function(){$(this).html(""),$(this).show()}),a.focus()}})},append_new_term:function(e){var t={id:e.term_id,text:e.term_label};switch($('.acf-taxonomy-field[data-taxonomy="'+this.o.taxonomy+'"]').each(function(){var t=$(this).data("type");if("radio"==t||"checkbox"==t){var i=$(this).children('input[type="hidden"]'),a=$(this).find("ul:first"),n=i.attr("name");"checkbox"==t&&(n+="[]");var s=$(['<li data-id="'+e.term_id+'">',"<label>",'<input type="'+t+'" value="'+e.term_id+'" name="'+n+'" /> ',"<span>"+e.term_label+"</span>","</label>","</li>"].join(""));if(e.term_parent){var o=a.find('li[data-id="'+e.term_parent+'"]');a=o.children("ul"),a.exists()||(a=$('<ul class="children acf-bl"></ul>'),o.append(a))}a.append(s)}}),$("#acf-popup #term_parent").each(function(){var t=$('<option value="'+e.term_id+'">'+e.term_label+"</option>");e.term_parent?$(this).children('option[value="'+e.term_parent+'"]').after(t):$(this).append(t)}),this.o.type){case"select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"multi_select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"checkbox":case"radio":var a=this.$el.find(".categorychecklist-holder"),n=a.find('li[data-id="'+e.term_id+'"]'),s=a.get(0).scrollTop+(n.offset().top-a.offset().top);n.find("input").prop("checked",!0),a.animate({scrollTop:s},"250");break}}})}(jQuery),function($){acf.fields.url=acf.field.extend({type:"url",$input:null,actions:{ready:"render",append:"render"},events:{'keyup input[type="url"]':"render"},focus:function(){this.$input=this.$field.find('input[type="url"]')},is_valid:function(){var e=this.$input.val();if(-1!==e.indexOf("://"));else if(0!==e.indexOf("//"))return!1;return!0},render:function(){this.is_valid()?this.$input.parent().addClass("-valid"):this.$input.parent().removeClass("-valid")}})}(jQuery),function($){acf.validation=acf.model.extend({actions:{ready:"ready",append:"ready"},filters:{validation_complete:"validation_complete"},events:{"click #save-post":"click_ignore",'click [type="submit"]':"click_publish","submit form":"submit_form","click .acf-error-message a":"click_message"},active:1,ignore:0,busy:0,valid:!0,errors:[],error_class:"acf-error",message_class:"acf-error-message",$trigger:null,ready:function(e){var t=$(".acf-field input, .acf-field textarea, .acf-field select");if(t.length){var i=this;t.on("invalid",function(e){var t=$(this),i=acf.get_field_wrap(t);i.trigger("invalidField"),acf.do_action("invalid",t),acf.do_action("invalid_field",i),acf.validation.ignore||(e.preventDefault(),acf.validation.errors.push({input:t.attr("name"),message:e.target.validationMessage}),acf.validation.fetch(t.closest("form")))})}},validation_complete:function(e,t){if(!this.errors.length)return e;e.valid=0,e.errors=e.errors||[];var a=[];if(e.errors.length)for(i in e.errors)a.push(e.errors[i].input);if(this.errors.length)for(i in this.errors){var n=this.errors[i];-1===$.inArray(n.input,a)&&e.errors.push(n)}return this.errors=[],e},click_message:function(e){e.preventDefault(),acf.remove_el(e.$el.parent())},click_ignore:function(e){var t=this;this.ignore=1,this.$trigger=e.$el,this.$form=e.$el.closest("form"),$("."+this.message_class).each(function(){acf.remove_el($(this))}),this.ignore_required_inputs(),setTimeout(function(){t.ignore=0},100)},ignore_required_inputs:function(){var e=$(".acf-field input[required], .acf-field textarea[required], .acf-field select[required]");e.length&&(e.prop("required",!1),setTimeout(function(){e.prop("required",!0)},100))},click_publish:function(e){this.$trigger=e.$el},submit_form:function(e){if(!this.active)return!0;if(this.ignore)return this.ignore=0,!0;if(!e.$el.find("#acf-form-data").exists())return!0;var t=e.$el.find("#wp-preview");if(t.exists()&&t.val())return this.toggle(e.$el,"unlock"),!0;e.preventDefault(),this.fetch(e.$el)},toggle:function(e,t){t=t||"unlock";var i=null,a=null,n=$("#submitdiv");n.exists()||(n=$("#submitpost")),n.exists()||(n=e.find("p.submit").last()),n.exists()||(n=e.find(".acf-form-submit")),n.exists()||(n=e),i=n.find('input[type="submit"], .button'),a=n.find(".spinner, .acf-spinner"),this.hide_spinner(a),"unlock"==t?this.enable_submit(i):"lock"==t&&(this.disable_submit(i),this.show_spinner(a.last()))},fetch:function(e){if(this.busy)return!1;var t=this;acf.do_action("validation_begin");var i=acf.serialize(e);i.action="acf/validate_save_post",i=acf.prepare_for_ajax(i),this.busy=1,this.toggle(e,"lock"),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"json",success:function(i){acf.is_ajax_success(i)&&t.fetch_success(e,i.data)},complete:function(){t.fetch_complete(e)}})},fetch_complete:function(e){if(this.busy=0,this.toggle(e,"unlock"),this.valid){this.ignore=1;var t=e.children(".acf-error-message");t.exists()&&(t.addClass("-success"),t.children("p").html(acf._e("validation_successful")),setTimeout(function(){acf.remove_el(t)},2e3)),e.find(".acf-postbox.acf-hidden").remove(),acf.do_action("submit",e),this.$trigger?this.$trigger.click():e.submit(),this.toggle(e,"lock")}},fetch_success:function(e,t){if(!(t=acf.apply_filters("validation_complete",t,e))||t.valid||!t.errors)return this.valid=!0,void acf.do_action("validation_success");this.valid=!1,this.$trigger=null,this.display_errors(t.errors,e),acf.do_action("validation_failure")},display_errors:function(e,t){if(e&&e.length){var a=t.children(".acf-error-message"),n=acf._e("validation_failed"),s=0,o=null;for(i=0;i<e.length;i++){var r=e[i];if(r.input){var l=t.find('[name="'+r.input+'"]').first();if(l.exists()||(l=t.find('[name^="'+r.input+'"]').first()),l.exists()){s++;var c=acf.get_field_wrap(l);this.add_error(c,r.message),null===o&&(o=c)}}else n+=". "+r.message}1==s?n+=". "+acf._e("validation_failed_1"):s>1&&(n+=". "+acf._e("validation_failed_2").replace("%d",s)),a.exists()||(a=$('<div class="acf-error-message"><p></p><a href="#" class="acf-icon -cancel small"></a></div>'),t.prepend(a)),a.children("p").html(n),null===o&&(o=a),setTimeout(function(){$("html, body").animate({scrollTop:o.offset().top-$(window).height()/2},500)},10)}},add_error:function(e,t){var i=this;e.addClass(this.error_class),void 0!==t&&(e.children(".acf-input").children("."+this.message_class).remove(),e.children(".acf-input").prepend('<div class="'+this.message_class+'"><p>'+t+"</p></div>"));var a=function(){i.remove_error(e),e.off("focus change","input, textarea, select",a)};e.on("focus change","input, textarea, select",a),e.trigger("invalidField"),acf.do_action("add_field_error",e),acf.do_action("invalid_field",e)},remove_error:function(e){var t=e.children(".acf-input").children("."+this.message_class);e.removeClass(this.error_class),setTimeout(function(){acf.remove_el(t)},250),acf.do_action("remove_field_error",e),acf.do_action("valid_field",e)},add_warning:function(e,t){this.add_error(e,t),setTimeout(function(){acf.validation.remove_error(e)},1e3)},show_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.addClass("is-active"):e.css("display","inline-block")}},hide_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.removeClass("is-active"):e.css("display","none")}},disable_submit:function(e){e.exists()&&e.addClass("disabled button-disabled button-primary-disabled")},enable_submit:function(e){e.exists()&&e.removeClass("disabled button-disabled button-primary-disabled")}})}(jQuery),function($){acf.fields.wysiwyg=acf.field.extend({type:"wysiwyg",$el:null,$textarea:null,toolbars:{},events:{"mousedown .acf-editor-wrap.delay":"mousedown"},actions:{load:"initialize",append:"initialize",remove:"disable",sortstart:"disable",sortstop:"enable"},focus:function(){this.$el=this.$field.find(".wp-editor-wrap").last(),this.$textarea=this.$el.find("textarea"),this.o=acf.get_data(this.$el,{toolbar:"",active:this.$el.hasClass("tmce-active"),id:this.$textarea.attr("id")})},mousedown:function(e){e.preventDefault(),this.$el.removeClass("delay"),this.$el.find(".acf-editor-toolbar").remove(),this.initialize()},initialize:function(){if(!this.$el.hasClass("delay")){var e={tinymce:!0,quicktags:!0,toolbar:this.o.toolbar,mode:this.o.active?"visual":"text"},t=this.o.id,i=acf.get_uniqid("acf-editor-"),a=this.$el.outerHTML();a=acf.str_replace(t,i,a),this.$el.replaceWith(a),this.o.id=i,acf.tinymce.initialize(this.o.id,e,this.$field)}},disable:function(){acf.tinymce.destroy(this.o.id)},enable:function(){this.o.active&&acf.tinymce.enable(this.o.id)}}),acf.tinymce=acf.model.extend({toolbars:{},actions:{ready:"ready"},ready:function(){var e=$("#acf-hidden-wp-editor");e.exists()&&(e.appendTo("body"),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(e){var t=e.editor;"acf"===t.id.substr(0,3)&&(t=tinymce.editors.content||t,tinymce.activeEditor=t,wpActiveEditor=t.id)}))},defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content}},initialize:function(e,t,i){t=t||{},i=i||null,t=acf.parse_args(t,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual"}),t.tinymce&&this.initialize_tinymce(e,t,i),t.quicktags&&this.initialize_quicktags(e,t,i)},initialize_tinymce:function(e,t,i){var a=$("#"+e),n=this.defaults(),s=this.toolbars;if("undefined"==typeof tinymce)return!1;if(!n)return!1;if(tinymce.get(e))return this.enable(e);init=$.extend({},n.tinymce,t.tinymce),init.id=e,init.selector="#"+e;var o=t.toolbar;if(o&&void 0!==s[o])for(var r=1;r<=4;r++)init["toolbar"+r]=s[o][r]||"";if(init.setup=function(t){t.on("focus",function(e){acf.validation.remove_error(i)}),t.on("change",function(e){t.save(),a.trigger("change")}),$(t.getWin()).on("unload",function(){acf.tinymce.remove(e)})},init.wp_autoresize_on=!1,init=acf.apply_filters("wysiwyg_tinymce_settings",init,e,i),tinyMCEPreInit.mceInit[e]=init,"visual"==t.mode){tinymce.init(init);var l=tinymce.get(e);acf.do_action("wysiwyg_tinymce_init",l,l.id,init,i)}},initialize_quicktags:function(e,t,i){var a=this.defaults();if("undefined"==typeof quicktags)return!1;if(!a)return!1;init=$.extend({},a.quicktags,t.quicktags),init.id=e,init=acf.apply_filters("wysiwyg_quicktags_settings",init,init.id,i),tinyMCEPreInit.qtInit[e]=init;var n=quicktags(init);this.build_quicktags(n),acf.do_action("wysiwyg_quicktags_init",n,n.id,init,i)},build_quicktags:function(e){var t,i,a,n,s,e,o,r,l,c,d=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";t=e.canvas,i=e.name,a=e.settings,s="",n={},l="",c=e.id,a.buttons&&(l=","+a.buttons+",");for(r in edButtons)edButtons[r]&&(o=edButtons[r].id,l&&-1!==d.indexOf(","+o+",")&&-1===l.indexOf(","+o+",")||edButtons[r].instance&&edButtons[r].instance!==c||(n[o]=edButtons[r],edButtons[r].html&&(s+=edButtons[r].html(i+"_"))));l&&-1!==l.indexOf(",dfw,")&&(n.dfw=new QTags.DFWButton,s+=n.dfw.html(i+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(n.textdirection=new QTags.TextDirectionButton,s+=n.textdirection.html(i+"_")),e.toolbar.innerHTML=s,e.theButtons=n,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[e])},disable:function(e){this.destroy(e)},destroy:function(e){this.destroy_tinymce(e)},destroy_tinymce:function(e){if("undefined"==typeof tinymce)return!1;var t=tinymce.get(e);return!!t&&(t.save(),t.destroy(),!0)},enable:function(e){this.enable_tinymce(e)},enable_tinymce:function(e){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[e]&&(switchEditors.go(e,"tmce"),!0))}})}(jQuery);
|
1 |
+
!function(e,t){"use strict";var i=function(){function e(){return u}function t(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("actions",e,t,i,a)),f}function i(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&d("actions",t,e),f}function a(e,t){return"string"==typeof e&&r("actions",e,t),f}function n(e,t,i,a){return"string"==typeof e&&"function"==typeof t&&(i=parseInt(i||10,10),l("filters",e,t,i,a)),f}function s(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?d("filters",t,e):f}function o(e,t){return"string"==typeof e&&r("filters",e,t),f}function r(e,t,i,a){if(u[e][t])if(i){var n=u[e][t],s;if(a)for(s=n.length;s--;){var o=n[s];o.callback===i&&o.context===a&&n.splice(s,1)}else for(s=n.length;s--;)n[s].callback===i&&n.splice(s,1)}else u[e][t]=[]}function l(e,t,i,a,n){var s={callback:i,priority:a,context:n},o=u[e][t];o?(o.push(s),o=c(o)):o=[s],u[e][t]=o}function c(e){for(var t,i,a,n=1,s=e.length;n<s;n++){for(t=e[n],i=n;(a=e[i-1])&&a.priority>t.priority;)e[i]=e[i-1],--i;e[i]=t}return e}function d(e,t,i){var a=u[e][t];if(!a)return"filters"===e&&i[0];var n=0,s=a.length;if("filters"===e)for(;n<s;n++)i[0]=a[n].callback.apply(a[n].context,i);else for(;n<s;n++)a[n].callback.apply(a[n].context,i);return"filters"!==e||i[0]}var f={removeFilter:o,applyFilters:s,addFilter:n,removeAction:a,doAction:i,addAction:t,storage:e},u={actions:{},filters:{}};return f};e.wp=e.wp||{},e.wp.hooks=e.wp.hooks||new i}(window);var acf;!function($){$.fn.exists=function(){return $(this).length>0},$.fn.outerHTML=function(){return $(this).get(0).outerHTML},acf={l10n:{},o:{},update:function(e,t){this.o[e]=t},get:function(e){return void 0!==this.o[e]?this.o[e]:null},_e:function(e,t){t=t||!1;var i=this.l10n[e]||"";return t&&(i=i[t]||""),i},add_action:function(){for(var e=arguments[0].split(" "),t=e.length,i=0;i<t;i++)arguments[0]="acf/"+e[i],wp.hooks.addAction.apply(this,arguments);return this},remove_action:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.removeAction.apply(this,arguments),this},do_action:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.doAction.apply(this,arguments),this},add_filter:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.addFilter.apply(this,arguments),this},remove_filter:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.removeFilter.apply(this,arguments),this},apply_filters:function(){return arguments[0]="acf/"+arguments[0],wp.hooks.applyFilters.apply(this,arguments)},get_selector:function(e){e=e||"";var t=".acf-field";if($.isPlainObject(e))if($.isEmptyObject(e))e="";else for(k in e){e=e[k];break}return e&&(t+="-"+e,t=t.split("_").join("-"),t=t.split("field-field-").join("field-")),t},get_fields:function(e,t,i){e=e||"",t=t||!1,i=i||!1;var a=this.get_selector(e),n=$(a,t);return!1!==t&&t.each(function(){$(this).is(a)&&(n=n.add($(this)))}),i||(n=n.not(".acf-clone .acf-field"),n=acf.apply_filters("get_fields",n)),n},get_field:function(e,t){e=e||"",t=t||!1;var i=this.get_fields(e,t,!0);return!!i.exists()&&i.first()},get_closest_field:function(e,t){return t=t||"",e.closest(this.get_selector(t))},get_field_wrap:function(e){return e.closest(this.get_selector())},get_field_key:function(e){return e.data("key")},get_field_type:function(e){return e.data("type")},get_data:function(e,t){var i=e.data();return"object"==typeof t&&(i=this.parse_args(i,t)),i},get_uniqid:function(e,t){void 0===e&&(e="");var i,a=function(e,t){return e=parseInt(e,10).toString(16),t<e.length?e.slice(e.length-t):t>e.length?Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,i=e,i+=a(parseInt((new Date).getTime()/1e3,10),8),i+=a(this.php_js.uniqidSeed,5),t&&(i+=(10*Math.random()).toFixed(8).toString()),i},serialize_form:function(){return this.serialize.apply(this,arguments)},serialize:function(e,t){t=t||"";var i={},a={},n=e.find("select, textarea, input").serializeArray();return $.each(n,function(e,n){var s=n.name,o=n.value;if(t){if(0!==s.indexOf(t))return;s=s.slice(t.length),"["==s.slice(0,1)&&(s=s.slice(1).replace("]",""))}"[]"===s.slice(-2)&&(s=s.slice(0,-2),void 0===a[s]&&(a[s]=-1),a[s]++,s+="["+a[s]+"]"),i[s]=o}),i},remove_tr:function(e,t){var i=e.height(),a=e.children().length;e.addClass("acf-remove-element"),setTimeout(function(){e.removeClass("acf-remove-element"),e.html('<td style="padding:0; height:'+i+'px" colspan="'+a+'"></td>'),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0;var a=e.height(),n=e.width(),s=e.css("margin"),o=e.outerHeight(!0);acf.do_action("remove",e),e.wrap('<div class="acf-temp-remove" style="height:'+o+'px"></div>');var r=e.parent();e.css({height:a,width:n,margin:s,position:"absolute"}),setTimeout(function(){r.css({opacity:0,height:i})},50),setTimeout(function(){r.remove(),"function"==typeof t&&t.apply(this,arguments)},301)},isset:function(){var e=arguments,t=e.length,a=null,n;if(0===t)throw new Error("Empty isset");for(a=e[0],i=1;i<t;i++){if(e[i]===n||a[e[i]]===n)return!1;a=a[e[i]]}return!0},maybe_get:function(e,t,i){void 0===i&&(i=null),keys=String(t).split(".");for(var a in keys){var t=keys[a];if(void 0===e[t])return i;e=e[t]}return e},open_popup:function(e){if($popup=$("body > #acf-popup"),$popup.exists())return update_popup(e);var t=['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey acf-close-popup"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg"></div>',"</div>"].join("");return $("body").append(t),$("#acf-popup").on("click",".bg, .acf-close-popup",function(e){e.preventDefault(),acf.close_popup()}),this.update_popup(e)},update_popup:function(e){return $popup=$("#acf-popup"),!!$popup.exists()&&(e=$.extend({},{title:"",content:"",width:0,height:0,loading:!1},e),e.title&&$popup.find(".title h3").html(e.title),e.content&&($inner=$popup.find(".inner:first"),$inner.html(e.content),acf.do_action("append",$inner),$inner.attr("style","position: relative;"),e.height=$inner.outerHeight(),$inner.removeAttr("style")),e.width&&$popup.find(".acf-popup-box").css({width:e.width,"margin-left":0-e.width/2}),e.height&&(e.height+=44,$popup.find(".acf-popup-box").css({height:e.height,"margin-top":0-e.height/2})),e.loading?$popup.find(".loading").show():$popup.find(".loading").hide(),$popup)},close_popup:function(){$popup=$("#acf-popup"),$popup.exists()&&$popup.remove()},update_user_setting:function(e,t){$.ajax({url:acf.get("ajaxurl"),dataType:"html",type:"post",data:acf.prepare_for_ajax({action:"acf/update_user_setting",name:e,value:t})})},prepare_for_ajax:function(e){var t={};return $.each(e,function(e,i){$.isPlainObject(i)&&!$.isEmptyObject(i)?$.each(i,function(i,a){i+="";var n=i.indexOf("[");i=0==n?e+i:n>0?e+"["+i.slice(0,n)+"]"+i.slice(n):e+"["+i+"]",t[i]=a}):t[e]=i}),t.nonce=acf.get("nonce"),t.post_id=acf.get("post_id"),t=acf.apply_filters("prepare_for_ajax",t)},is_ajax_success:function(e){return!(!e||!e.success)},get_ajax_message:function(e){var t={text:"",type:"error"};return e?(e.success&&(t.type="success"),e.data&&e.data.message&&(t.text=e.data.message),e.data&&e.data.error&&(t.text=e.data.error),t):t},is_in_view:function(e){var t=e.offset().top,i=t+e.height();if(t===i)return!1;var a=$(window).scrollTop();return i<=a+$(window).height()&&t>=a},val:function(e,t){var i=e.val();e.val(t),t!=i&&e.trigger("change")},str_replace:function(e,t,i){return i.split(e).join(t)},str_sanitize:function(e){var t={"À":"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"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,a=function(e){return void 0!==t[e]?t[e]:e};return e=e.replace(i,a),e=e.toLowerCase()},addslashes:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},esc_html:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})},render_select:function(e,t){var i=e.val();e.html(""),t&&$.each(t,function(t,a){var n=e;a.group&&(n=e.find('optgroup[label="'+a.group+'"]'),n.exists()||(n=$('<optgroup label="'+a.group+'"></optgroup>'),e.append(n))),n.append('<option value="'+a.value+'">'+acf.esc_html(a.label)+"</option>"),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e){void 0!==e.length&&(e={$el:e}),e=acf.parse_args(e,{$el:!1,search:"",replace:"",before:function(e){},after:function(e,t){},append:function(e,t){e.after(t)}});var t=e.$el,i;e.search||(e.search=t.attr("data-id")),e.replace||(e.replace=acf.get_uniqid()),e.before.apply(this,[t]),acf.do_action("before_duplicate",t);var i=t.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),e.search&&(i.attr("data-id",e.replace),i.find('[id*="'+e.search+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(e.search,e.replace))}),i.find('[name*="'+e.search+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(e.search,e.replace))}),i.find('label[for*="'+e.search+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(e.search,e.replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",t,i),e.after.apply(this,[t,i]),e.append.apply(this,[t,i]),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("<textarea/>").html(e).text()},parse_args:function(e,t){return"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={}),$.extend({},t,e)},enqueue_script:function(e,t){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,i.readyState?i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(i.onreadystatechange=null,t())}:i.onload=function(){t()},document.body.appendChild(i)}},acf.model={actions:{},filters:{},events:{},extend:function(e){var t=$.extend({},this,e);return $.each(t.actions,function(e,i){t._add_action(e,i)}),$.each(t.filters,function(e,i){t._add_filter(e,i)}),$.each(t.events,function(e,i){t._add_event(e,i)}),t},_add_action:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_action(e,i[t],n,i)},_add_filter:function(e,t){var i=this,a=e.split(" "),e=a[0]||"",n=a[1]||10;acf.add_filter(e,i[t],n,i)},_add_event:function(e,t){var i=this,a=e.indexOf(" "),n=a>0?e.substr(0,a):e,s=a>0?e.substr(a+1):"",o=function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,arguments)};s?$(document).on(n,s,o):$(document).on(n,o)},get:function(e,t){return t=t||null,void 0!==this[e]&&(t=this[e]),t},set:function(e,t){return this[e]=t,"function"==typeof this["_set_"+e]&&this["_set_"+e].apply(this),this}},acf.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_action(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;e=e+"_field/type="+i.type,acf.add_filter(e,function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,a=e.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1),s=acf.get_selector(i.type);$(document).on(a,s+" "+n,function(e){var a=$(this),n=acf.get_closest_field(a,i.type);n.length&&(n.is(i.$field)||i.set("$field",n),e.$el=a,e.$field=n,i[t].apply(i,[e]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(e){return this.set("$field",e)}}),acf.fields=acf.model.extend({actions:{prepare:"_prepare",prepare_field:"_prepare_field",ready:"_ready",ready_field:"_ready_field",append:"_append",append_field:"_append_field",load:"_load",load_field:"_load_field",remove:"_remove",remove_field:"_remove_field",sortstart:"_sortstart",sortstart_field:"_sortstart_field",sortstop:"_sortstop",sortstop_field:"_sortstop_field",show:"_show",show_field:"_show_field",hide:"_hide",hide_field:"_hide_field"},_prepare:function(e){acf.get_fields("",e).each(function(){acf.do_action("prepare_field",$(this))})},_prepare_field:function(e){acf.do_action("prepare_field/type="+e.data("type"),e)},_ready:function(e){acf.get_fields("",e).each(function(){acf.do_action("ready_field",$(this))})},_ready_field:function(e){acf.do_action("ready_field/type="+e.data("type"),e)},_append:function(e){acf.get_fields("",e).each(function(){acf.do_action("append_field",$(this))})},_append_field:function(e){acf.do_action("append_field/type="+e.data("type"),e)},_load:function(e){acf.get_fields("",e).each(function(){acf.do_action("load_field",$(this))})},_load_field:function(e){acf.do_action("load_field/type="+e.data("type"),e)},_remove:function(e){acf.get_fields("",e).each(function(){acf.do_action("remove_field",$(this))})},_remove_field:function(e){acf.do_action("remove_field/type="+e.data("type"),e)},_sortstart:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstart_field",$(this),t)})},_sortstart_field:function(e,t){acf.do_action("sortstart_field/type="+e.data("type"),e,t)},_sortstop:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("sortstop_field",$(this),t)})},_sortstop_field:function(e,t){acf.do_action("sortstop_field/type="+e.data("type"),e,t)},_hide:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("hide_field",$(this),t)})},_hide_field:function(e,t){acf.do_action("hide_field/type="+e.data("type"),e,t)},_show:function(e,t){acf.get_fields("",e).each(function(){acf.do_action("show_field",$(this),t)})},_show_field:function(e,t){acf.do_action("show_field/type="+e.data("type"),e,t)}}),$(document).ready(function(){acf.do_action("ready",$("body"))}),$(window).on("load",function(){acf.do_action("load",$("body"))}),acf.layout=acf.model.extend({actions:{"refresh 99":"refresh"},refresh:function(e){e=e||$("body"),this.render_tables(e),this.render_groups(e)},render_tables:function(e){var t=this,i=e.find(".acf-table:visible");e.is("table")?i=i.add(e):e.is("tr")&&(i=i.add(e.closest("table"))),i.each(function(){t.render_table($(this))})},render_table:function(e){var t=e.find("> thead th.acf-th"),i=1,a=100;if(t.exists()){var n=e.find("> tbody > tr"),s=n.find("> td.acf-field");n.hasClass("acf-clone")&&n.length>1&&(s=n.not(".acf-clone").find("> td.acf-field")),t.each(function(){var e=$(this),t=e.attr("data-key"),i=s.filter('[data-key="'+t+'"]');i.removeClass("appear-empty"),e.removeClass("hidden-by-conditional-logic"),i.exists()&&(0==i.not(".hidden-by-conditional-logic").length?e.addClass("hidden-by-conditional-logic"):i.filter(".hidden-by-conditional-logic").addClass("appear-empty"))}),t.css("width","auto"),t=t.not(".hidden-by-conditional-logic"),i=t.length,t.filter("[data-width]").each(function(){var e=parseInt($(this).attr("data-width"));a-=e,$(this).css("width",e+"%")}),t=t.not("[data-width]"),t.each(function(){var e=a/t.length;$(this).css("width",e+"%")}),e.find(".acf-row .acf-field.-collapsed-target").removeAttr("colspan"),e.find(".acf-row.-collapsed .acf-field.-collapsed-target").attr("colspan",i)}},render_groups:function(e){var t=this,i=e.find(".acf-fields:visible");e&&e.is(".acf-fields")&&(i=i.add(e)),i.each(function(){t.render_group($(this))})},render_group:function(e){var t=$(),i=0,a=0,n=-1,s=e.children(".acf-field[data-width]:visible");if(s.exists()){if(e.hasClass("-left"))return s.removeAttr("data-width"),void s.css("width","auto");s.removeClass("-r0 -c0").css({"min-height":0}),s.each(function(e){var s=$(this),o=s.position().top;0==e&&(i=o),o!=i&&(t.css({"min-height":a+1+"px"}),t=$(),i=s.position().top,a=0,n=-1),n++,a=s.outerHeight()>a?s.outerHeight():a,t=t.add(s),0==o?s.addClass("-r0"):0==n&&s.addClass("-c0")}),t.exists()&&t.css({"min-height":a+1+"px"})}}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){var e=$("#_acf_changed");e.length&&e.val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({locked:1,active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{ready:"ready",change:"on",submit:"off"},ready:function(){setTimeout(function(){acf.unload.locked=0},1e3)},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){this.changed||!this.active||this.locked||(this.changed=1,$(window).on("beforeunload",this.unload))},off:function(){this.changed=0,$(window).off("beforeunload",this.unload)},unload:function(){return acf._e("unload")}}),acf.tooltip=acf.model.extend({events:{"mouseenter .acf-js-tooltip":"_on","mouseup .acf-js-tooltip":"_off","mouseleave .acf-js-tooltip":"_off"},tooltip:function(e,t){var i=$('<div class="acf-tooltip">'+e+"</div>");$("body").append(i);var a=10;target_w=t.outerWidth(),target_h=t.outerHeight(),target_t=t.offset().top,target_l=t.offset().left,tooltip_w=i.outerWidth(),tooltip_h=i.outerHeight();var n=target_t-tooltip_h,s=target_l+target_w/2-tooltip_w/2;return s<10?(i.addClass("right"),s=target_l+target_w,n=target_t+target_h/2-tooltip_h/2):s+tooltip_w+10>$(window).width()?(i.addClass("left"),s=target_l-tooltip_w,n=target_t+target_h/2-tooltip_h/2):n-$(window).scrollTop()<10?(i.addClass("bottom"),n=target_t+target_h):i.addClass("top"),i.css({top:n,left:s}),i},temp:function(e,t){var t=this.tooltip(e,t),i=0;i+=250,setTimeout(function(){t.addClass("acf-fade-up")},i),i+=250,setTimeout(function(){t.remove()},i)},confirm:function(e,t,i,a,n){i=i||acf._e("are_you_sure"),a=a||'<a href="#" class="acf-confirm-y">'+acf._e("yes")+"</a>",n=n||'<a href="#" class="acf-confirm-n">'+acf._e("No")+"</a>";var s=this.tooltip(i+" "+a+" "+n,e);s.addClass("-confirm");var o=function(i,a){i.preventDefault(),i.stopImmediatePropagation(),e.off("click",r),s.off("click",".acf-confirm-y",r),s.off("click",".acf-confirm-n",l),$("body").off("click",l),s.remove(),t.apply(null,[a])},r=function(e){o(e,!0)},l=function(e){o(e,!1)};s.on("click",".acf-confirm-y",r),s.on("click",".acf-confirm-n",l),e.on("click",r),$("body").on("click",l)},confirm_remove:function(e,t){text=!1,button_y='<a href="#" class="acf-confirm-y -red">'+acf._e("remove")+"</a>",button_n='<a href="#" class="acf-confirm-n">'+acf._e("cancel")+"</a>",this.confirm(e,t,!1,button_y,button_n)},_on:function(e){var t=e.$el.attr("title");if(t){var i=this.tooltip(t,e.$el);e.$el.data("acf-tooltip",{title:t,$el:i}),e.$el.attr("title","")}},_off:function(e){var t=e.$el.data("acf-tooltip");t&&(t.$el.remove(),e.$el.attr("title",t.title))}}),acf.postbox=acf.model.extend({events:{"mouseenter .acf-postbox .handlediv":"on","mouseleave .acf-postbox .handlediv":"off"},on:function(e){e.$el.siblings(".hndle").addClass("hover")},off:function(e){e.$el.siblings(".hndle").removeClass("hover")},render:function(e){e=$.extend({},{id:"",key:"",style:"default",label:"top",edit_url:"",edit_title:"",visibility:!0},e);var t=$("#"+e.id),i=$("#"+e.id+"-hide"),a=i.parent();t.addClass("acf-postbox"),a.addClass("acf-postbox-toggle"),t.removeClass("hide-if-js"),a.removeClass("hide-if-js"),"default"!==e.style&&t.addClass(e.style),t.children(".inside").addClass("acf-fields").addClass("-"+e.label),e.visibility?i.prop("checked",!0):(t.addClass("acf-hidden"),a.addClass("acf-hidden")),e.edit_url&&t.children(".hndle").append('<a href="'+e.edit_url+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+e.edit_title+'"></a>')}});var e=acf.model.extend({events:{"click .acf-panel-title":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el.parent())},is_open:function(e){return e.hasClass("-open")},toggle:function(e){this.is_open(e)?this.close(e):this.open(e)},open:function(e){e.addClass("-open"),e.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(e){e.removeClass("-open"),e.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}});acf.notice=acf.model.extend({actions:{prepare:"prepare"},prepare:function(){var e=$(".acf-notice");e.length&&$("h1:first").after(e)},html:function(e,t){},success:function(e){},error:function(e){},warning:function(e){},information:function(e){}});var t=localStorage.getItem("acf");t=t?JSON.parse(t):{};var a=function(e){return"this."===e.substr(0,5)&&(e=e.substr(5)+"-"+acf.get("post_id")),e};acf.getPreference=function(e){return e=a(e),t[e]||null},acf.setPreference=function(e,i){e=a(e),null===i?delete t[e]:t[e]=i,localStorage.setItem("acf",JSON.stringify(t))},acf.removePreference=function(e){acf.setPreference(e,null)};var n=function(e,t){return e.data("acf-lock-"+t)||[]},s=function(e,t,i){e.data("acf-lock-"+t,i)};acf.lock=function(e,t,i){var a=n(e,t);a.indexOf(i)<0&&(a.push(i),s(e,t,a))},acf.unlock=function(e,t,i){var a=n(e,t),o=a.indexOf(i);return o>-1&&(a.splice(o,1),s(e,t,a)),0===a.length},acf.isLocked=function(e,t){return n(e,t).length>0},acf.show=function(e,t){return t&&acf.unlock(e,"hidden",t),!acf.isLocked(e,"hidden")&&(!!e.hasClass("acf-hidden")&&(e.removeClass("acf-hidden"),!0))};var o=function(e,t){return!e.hasClass("acf-disabled")&&(t&&acf.unlock(e,"disabled",t),!acf.isLocked(e,"disabled")&&(!!e.prop("disabled")&&(e.prop("disabled",!1),!0)))};acf.enable=function(e,t){if(e.attr("name"))return o(e,t);var i=!0;return e.find("[name]").each(function(){o($(this),t)||(i=!1)}),i};var r=function(e,t){return t&&acf.lock(e,"disabled",t),!e.prop("disabled")&&(e.prop("disabled",!0),!0)};acf.disable=function(e,t){if(e.attr("name"))return r(e,t);var i=!0;return e.find("[name]").each(function(){r($(this),t)||(i=!1)}),i},acf.enable_el=acf.enable,acf.enable_form=acf.enable,acf.disable_el=acf.disable,acf.disable_form=acf.disable,acf.hide=function(e,t){return t&&acf.lock(e,"hidden",t),!e.hasClass("acf-hidden")&&(e.addClass("acf-hidden"),!0)},acf.isHidden=function(e){return e.hasClass("acf-hidden")},acf.isVisible=function(e){return!acf.isHidden(e)},$(document).on("sortstart",function(e,t){acf.do_action("sortstart",t.item,t.placeholder)}),$(document).on("sortstop",function(e,t){acf.do_action("sortstop",t.item,t.placeholder)}),acf.add_action("sortstart",function(e,t){e.is("tr")&&(e.css("position","relative"),e.children().each(function(){$(this).width($(this).width())}),e.css("position","absolute"),t.html('<td style="height:'+e.height()+'px; padding:0;" colspan="'+e.children("td").length+'"></td>'))}),acf.add_action("before_duplicate",function(e){e.find("select option:selected").addClass("selected")}),acf.add_action("after_duplicate",function(e,t){t.find("select").each(function(){var e=$(this),t=[];e.find("option.selected").each(function(){t.push($(this).val())}),e.val(t)}),e.find("select option.selected").removeClass("selected"),t.find("select option.selected").removeClass("selected")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return $.inArray(e,this)})}(jQuery),function($){acf.ajax=acf.model.extend({active:!1,actions:{ready:"ready"},events:{"change #page_template":"_change_template","change #parent_id":"_change_parent","change #post-formats-select input":"_change_format","change .categorychecklist input":"_change_term","change .categorychecklist select":"_change_term",'change .acf-taxonomy-field[data-save="1"] input':"_change_term",'change .acf-taxonomy-field[data-save="1"] select':"_change_term"},o:{},xhr:null,update:function(e,t){return this.o[e]=t,this},get:function(e){return this.o[e]||null},ready:function(){this.update("post_id",acf.get("post_id")),this.active=!0},fetch:function(){if(this.active&&"post"===acf.get("screen")&&acf.get("ajax")){this.xhr&&this.xhr.abort();var e=this,t=this.o;t.action="acf/post/get_field_groups",t.exists=[],$(".acf-postbox").not(".acf-hidden").each(function(){t.exists.push($(this).attr("id").substr(4))}),this.xhr=$.ajax({url:acf.get("ajaxurl"),data:acf.prepare_for_ajax(t),type:"post",dataType:"json",success:function(t){acf.is_ajax_success(t)&&e.render(t.data)}})}},render:function(e){$(".acf-postbox").addClass("acf-hidden"),$(".acf-postbox-toggle").addClass("acf-hidden"),$("#acf-style").html(""),$.each(e,function(e,t){var i=$("#acf-"+t.key),a=$("#acf-"+t.key+"-hide"),n=a.parent();i.removeClass("acf-hidden hide-if-js").show(),n.removeClass("acf-hidden hide-if-js").show(),a.prop("checked",!0);var s=i.find(".acf-replace-with-fields");s.exists()&&(s.replaceWith(t.html),acf.do_action("append",i)),0===e&&$("#acf-style").html(t.style),i.find(".acf-hidden-by-postbox").prop("disabled",!1)}),$(".acf-postbox.acf-hidden").find("select, textarea, input").not(":disabled").each(function(){$(this).addClass("acf-hidden-by-postbox").prop("disabled",!0)})},sync_taxonomy_terms:function(){var e=[""];$(".categorychecklist, .acf-taxonomy-field").each(function(){var t=$(this),i=t.find('input[type="checkbox"]').not(":disabled"),a=t.find('input[type="radio"]').not(":disabled"),n=t.find("select").not(":disabled"),s=t.find('input[type="hidden"]').not(":disabled");t.is(".acf-taxonomy-field")&&"1"!=t.attr("data-save")||t.closest(".media-frame").exists()||(i.exists()?i.filter(":checked").each(function(){e.push($(this).val())}):a.exists()?a.filter(":checked").each(function(){e.push($(this).val())}):n.exists()?n.find("option:selected").each(function(){e.push($(this).val())}):s.exists()&&s.each(function(){$(this).val()&&e.push($(this).val())}))}),e=e.filter(function(e,t,i){return i.indexOf(e)==t}),this.update("post_taxonomy",e).fetch()},_change_template:function(e){var t=e.$el.val();this.update("page_template",t).fetch()},_change_parent:function(e){var t="parent",i=0;""!=e.$el.val()&&(t="child",i=e.$el.val()),this.update("page_type",t).update("page_parent",i).fetch()},_change_format:function(e){var t=e.$el.val();"0"==t&&(t="standard"),this.update("post_format",t).fetch()},_change_term:function(e){var t=this;e.$el.closest(".media-frame").exists()||setTimeout(function(){t.sync_taxonomy_terms()},1)}})}(jQuery),function($){acf.fields.button_group=acf.field.extend({type:"button_group",$div:null,events:{'click input[type="radio"]':"click"},focus:function(){this.$div=this.$field.find(".acf-button-group"),this.o=acf.get_data(this.$div,{allow_null:0})},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected");this.$div.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),e.$el.trigger("change"))}})}(jQuery),function($){acf.fields.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"_change","click .acf-add-checkbox":"_add"},focus:function(){this.$ul=this.$field.find("ul"),this.$input=this.$field.find('input[type="hidden"]')},add:function(){var e=this.$input.attr("name")+"[]",t='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+e+'" /></li>';this.$ul.find(".acf-add-checkbox").parent("li").before(t)},_change:function(e){var t=this.$ul,i=t.find('input[type="checkbox"]').not(".acf-checkbox-toggle"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a).trigger("change");if(e.$el.hasClass("acf-checkbox-custom")){var n=e.$el.next('input[type="text"]');e.$el.next('input[type="text"]').prop("disabled",!a),a||""!=n.val()||e.$el.parent("li").remove()}if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}},_add:function(e){this.add()}})}(jQuery),function($){acf.fields.color_picker=acf.field.extend({type:"color_picker",$input:null,$hidden:null,actions:{ready:"initialize",append:"initialize"},focus:function(){this.$input=this.$field.find('input[type="text"]'),this.$hidden=this.$field.find('input[type="hidden"]')},initialize:function(){var e=this.$input,t=this.$hidden,i=function(){setTimeout(function(){acf.val(t,e.val())},1)},a={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},a=acf.apply_filters("color_picker_args",a,this.$field);this.$input.wpColorPicker(a)}})}(jQuery),function($,e){var t="hidden-by-conditional-logic",i="conditional_logic",a=acf.conditional_logic=acf.model.extend({conditions:{},triggers:{},$parent:!1,actions:{"prepare 20":"render","append 20":"render",change:"change"},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n];this.addTrigger(s.field,e)}}this.setCondition(e,t)},getTrigger:function(e){return this.triggers[e]||null},setTrigger:function(e,t){this.triggers[e]=t},addTrigger:function(e,t){var i=this.getTrigger(e)||{};i[t]=1,this.setTrigger(e,i)},getConditions:function(){return this.conditions},getCondition:function(e){return this.conditions[e]||null},setCondition:function(e,t){this.conditions[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.renderFields(t),acf.do_action("refresh",e)},findTarget:function(e,t){var i=this;this.$parent=!1;var a=acf.get_selector(t),n=e.siblings(a);if(n.length)return this.$parent=e.parent(),n;var n=acf.get_fields(t,!1,!0);return n.length>1&&e.parents(".acf-row, .acf-table, .acf-fields").each(function(){var e=$(this),t=e.find(n);if(t.length)return n=t,i.$parent=e,!1}),n},change:function(e){var t=acf.get_field_wrap(e),i=t.data("key"),a=this.getTrigger(i);if(!a)return!1;for(var n in a){var s=this.findTarget(t,n);this.renderFields(s)}acf.do_action("refresh",this.$parent)},renderFields:function(e){var t=this;e.each(function(){t.renderField($(this))})},renderField:function(e){var t=!1,i=e.data("key"),a=this.getCondition(i);if(!a)return!1;for(var n=0;n<a.length;n++){for(var s=a[n],o=!0,r=0;r<s.length;r++){var l=s[r],c=this.findTarget(e,l.field);if(!this.calculate(l,c,e)){o=!1;break}}if(o){t=!0;break}}t?this.showField(e,i):this.hideField(e,i)},showField:function(e,a){acf.enable(e,a);var n=acf.show(e,a);return n&&e.removeClass(t),acf.do_action("show_field",e,i),n},hideField:function(e,a){acf.disable(e,a);var n=acf.hide(e,a);return n&&e.addClass(t),acf.do_action("hide_field",e,i),n},calculate:function(e,t,i){if(!t||!i)return!1;var a=!1,n=t.data("type");return"true_false"==n||"checkbox"==n||"radio"==n||"button_group"==n?a=this.calculate_checkbox(e,t):"select"==n&&(a=this.calculate_select(e,t)),"!="===e.operator&&(a=!a),a},calculate_checkbox:function(e,t){var i=t.find('input[value="'+e.value+'"]:checked').exists();return""!==e.value||t.find("input:checked").exists()||(i=!0),i},
|
2 |
+
calculate_select:function(e,t){var i=t.find("select"),a=i.val();return a||$.isNumeric(a)||(a=""),$.isArray(a)||(a=[a]),match=$.inArray(e.value,a)>-1,match}});a.show_field=a.showField,a.hide_field=a.hideField}(jQuery),function($){acf.datepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_picker"),l10n&&void 0!==$.datepicker&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){void 0!==$.datepicker&&(t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'))},destroy:function(e){}}),acf.fields.date_picker=acf.field.extend({type:"date_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(this.o.save_format)return this.initialize2();var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field),acf.datepicker.init(this.$input,e),acf.do_action("date_picker_init",this.$input,e,this.$field)},initialize2:function(){this.$input.val(this.$hidden.val());var e={dateFormat:this.o.date_format,altField:this.$hidden,altFormat:this.o.save_format,changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day};e=acf.apply_filters("date_picker_args",e,this.$field);var t=e.dateFormat;e.dateFormat=this.o.save_format,acf.datepicker.init(this.$input,e),this.$input.datepicker("option","dateFormat",t),acf.do_action("date_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&void 0!==$.timepicker&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){void 0!==$.timepicker&&(t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'))},destroy:function(e){}}),acf.fields.date_time_picker=acf.field.extend({type:"date_time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-date-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){var e={dateFormat:this.o.date_format,timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.o.first_day,controlType:"select",oneLine:!0};e=acf.apply_filters("date_time_picker_args",e,this.$field),acf.datetimepicker.init(this.$input,e),acf.do_action("date_time_picker_init",this.$input,e,this.$field)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.file=acf.field.extend({type:"file",$el:null,$input:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-file-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"};return e.id&&(t=e.attributes),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$el.find("img").attr({src:e.icon,alt:e.alt,title:e.title}),this.$el.find('[data-name="title"]').text(e.title),this.$el.find('[data-name="filename"]').text(e.filename).attr("href",e.url),this.$el.find('[data-name="filesize"]').text(e.filesizeHumanReadable);var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(t,"repeater"),a=acf.media.popup({title:acf._e("file","select"),mode:"select",type:"",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-file-uploader.has-value").exists()&&void(t=!1)}),!t){if(!(o=acf.fields.repeater.doFocus(i).add()))return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("file","edit"),button:acf._e("file","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},get_file_info:function(e,t){var i=e.val(),a={};if(!i)return void t.val("");a.url=i;var n=e[0].files;if(n.length){var s=n[0];if(a.size=s.size,a.type=s.type,s.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,r=new Image;r.onload=function(){a.width=this.width,a.height=this.height,t.val(jQuery.param(a))},r.src=o.createObjectURL(s)}}t.val(jQuery.param(a))},change:function(e){this.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.google_map=acf.field.extend({type:"google_map",url:"",$el:null,$search:null,timeout:null,status:"",geocoder:!1,map:!1,maps:{},$pending:$(),actions:{ready:"initialize",append:"initialize",show:"show"},events:{'click a[data-name="clear"]':"_clear",'click a[data-name="locate"]':"_locate",'click a[data-name="search"]':"_search","keydown .search":"_keydown","keyup .search":"_keyup","focus .search":"_focus","blur .search":"_blur","mousedown .acf-google-map":"_mousedown"},focus:function(){this.$el=this.$field.find(".acf-google-map"),this.$search=this.$el.find(".search"),this.o=acf.get_data(this.$el),this.o.id=this.$el.attr("id"),this.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status||"loading"!=this.status&&(acf.isset(window,"google","maps","places")?(this.status="ready",!0):(acf.isset(window,"google","maps")&&(this.status="ready"),this.url&&(this.status="loading",acf.enqueue_script(this.url,function(){e.status="ready",e.initialize_pending()})),"ready"==this.status))},initialize_pending:function(){var e=this;this.$pending.each(function(){e.set("$field",$(this)).initialize()}),this.$pending=$()},initialize:function(){if(!this.is_ready())return this.$pending=this.$pending.add(this.$field),!1;this.geocoder||(this.geocoder=new google.maps.Geocoder);var e=this,t=this.$field,i=this.$el;this.$search.val(this.$el.find(".input-address").val());var a=acf.apply_filters("google_map_args",{scrollwheel:!1,zoom:parseInt(this.o.zoom),center:new google.maps.LatLng(this.o.lat,this.o.lng),mapTypeId:google.maps.MapTypeId.ROADMAP},this.$field);if(this.map=new google.maps.Map(this.$el.find(".canvas")[0],a),acf.isset(window,"google","maps","places","Autocomplete")){var n=new google.maps.places.Autocomplete(this.$search[0]);n.bindTo("bounds",this.map),google.maps.event.addListener(n,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=n}var s=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(s),this.map.$el=i,this.map.$field=t;var o=i.find(".input-lat").val(),r=i.find(".input-lng").val();o&&r&&this.update(o,r).center(),google.maps.event.addListener(this.map.marker,"dragend",function(){var t=this.map.marker.getPosition(),i=t.lat(),a=t.lng();e.update(i,a).sync()}),google.maps.event.addListener(this.map,"click",function(t){var i=t.latLng.lat(),a=t.latLng.lng();e.update(i,a).sync()}),acf.do_action("google_map_init",this.map,this.map.marker,this.$field),this.maps[this.o.id]=this.map},search:function(e){var t=this,i=this.$search.val();if(!i)return!1;this.$el.find(".input-address").val(i);var a=i.split(",");if(2==a.length){var n=a[0],s=a[1];if($.isNumeric(n)&&$.isNumeric(s))return n=parseFloat(n),s=parseFloat(s),void t.update(n,s).center()}if(e&&e.geometry){var n=e.geometry.location.lat(),s=e.geometry.location.lng();return void t.update(n,s).center()}this.$el.addClass("-loading"),t.geocoder.geocode({address:i},function(i,a){if(t.$el.removeClass("-loading"),a!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+a);if(!i[0])return void console.log("No results found");e=i[0];var n=e.geometry.location.lat(),s=e.geometry.location.lng();t.update(n,s).center()})},update:function(e,t){var i=new google.maps.LatLng(e,t);return acf.val(this.$el.find(".input-lat"),e),acf.val(this.$el.find(".input-lng"),t),this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.$el.addClass("-value"),this.$field.removeClass("error"),acf.do_action("google_map_change",i,this.map,this.$field),this.$search.blur(),this},center:function(){var e=this.map.marker.getPosition(),t=this.o.lat,i=this.o.lng;e&&(t=e.lat(),i=e.lng());var a=new google.maps.LatLng(t,i);this.map.setCenter(a)},sync:function(){var e=this,t=this.map.marker.getPosition(),i=new google.maps.LatLng(t.lat(),t.lng());return this.$el.addClass("-loading"),this.geocoder.geocode({latLng:i},function(t,i){if(e.$el.removeClass("-loading"),i!=google.maps.GeocoderStatus.OK)return void console.log("Geocoder failed due to: "+i);if(!t[0])return void console.log("No results found");var a=t[0];e.$search.val(a.formatted_address),acf.val(e.$el.find(".input-address"),a.formatted_address)}),this},refresh:function(){if(!this.is_ready())return!1;google.maps.event.trigger(this.map,"resize"),this.center()},show:function(){var e=this,t=this.$field;setTimeout(function(){e.set("$field",t).refresh()},10)},_clear:function(e){this.$el.removeClass("-value -loading -search"),this.$search.val(""),acf.val(this.$el.find(".input-address"),""),acf.val(this.$el.find(".input-lat"),""),acf.val(this.$el.find(".input-lng"),""),this.map.marker.setVisible(!1)},_locate:function(e){var t=this;if(!navigator.geolocation)return alert(acf._e("google_map","browser_support")),this;this.$el.addClass("-loading"),navigator.geolocation.getCurrentPosition(function(e){t.$el.removeClass("-loading");var i=e.coords.latitude,a=e.coords.longitude;t.update(i,a).sync().center()})},_search:function(e){this.search()},_focus:function(e){this.$el.removeClass("-value"),this._keyup()},_blur:function(e){var t=this,i=this.$el.find(".input-address").val();i&&(this.timeout=setTimeout(function(){t.$el.addClass("-value"),t.$search.val(i)},100))},_keydown:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()?this.$el.addClass("-search"):this.$el.removeClass("-search")},_mousedown:function(e){var t=this;setTimeout(function(){clearTimeout(t.timeout)},1)}})}(jQuery),function($){acf.fields.image=acf.field.extend({type:"image",$el:null,$input:null,$img:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change"},focus:function(){this.$el=this.$field.find(".acf-image-uploader"),this.$input=this.$el.find('input[type="hidden"]'),this.$img=this.$el.find("img"),this.o=acf.get_data(this.$el)},initialize:function(){"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data")},prepare:function(e){if(e=e||{},e._valid)return e;var t={url:"",alt:"",title:"",caption:"",description:"",width:0,height:0};return e.id&&(t=e.attributes,t.url=acf.maybe_get(t,"sizes."+this.o.preview_size+".url",t.url)),t._valid=!0,t},render:function(e){e=this.prepare(e),this.$img.attr({src:e.url,alt:e.alt,title:e.title});var t="";e.id&&(t=e.id),acf.val(this.$input,t),t?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,t=this.$field,i=acf.get_closest_field(this.$field,"repeater"),a=acf.media.popup({title:acf._e("image","select"),mode:"select",type:"image",field:t.data("key"),multiple:i.exists(),library:this.o.library,mime_types:this.o.mime_types,select:function(a,n){if(n>0){var s=t.data("key"),o=t.closest(".acf-row");if(t=!1,o.nextAll(".acf-row:visible").each(function(){if(t=acf.get_field(s,$(this)))return!!t.find(".acf-image-uploader.has-value").exists()&&void(t=!1)}),!t){if(!(o=acf.fields.repeater.doFocus(i).add()))return!1;t=acf.get_field(s,o)}}e.set("$field",t).render(a)}})},edit:function(){var e=this,t=this.$field,i=this.$input.val();if(i)var a=acf.media.popup({title:acf._e("image","edit"),button:acf._e("image","update"),mode:"edit",attachment:i,select:function(i,a){e.set("$field",t).render(i)}})},remove:function(){var e={};this.render(e)},change:function(e){acf.fields.file.get_file_info(e.$el,this.$input)}})}(jQuery),function($){acf.fields.link=acf.field.extend({type:"link",active:!1,$el:null,$node:null,events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove","change .link-node":"change"},focus:function(){this.$el=this.$field.find(".acf-link"),this.$node=this.$el.find(".link-node")},add:function(e){acf.link.open(this.$node)},edit:function(e){this.add()},remove:function(e){this.val("")},change:function(e,t){var i={title:this.$node.html(),url:this.$node.attr("href"),target:this.$node.attr("target")};this.val(i)},val:function(e){e=acf.parse_args(e,{title:"",url:"",target:""}),this.$el.removeClass("-value -external"),e.url&&this.$el.addClass("-value"),"_blank"===e.target&&this.$el.addClass("-external"),this.$el.find(".link-title").html(e.title),this.$el.find(".link-url").attr("href",e.url).html(e.url),this.$el.find(".input-title").val(e.title),this.$el.find(".input-target").val(e.target),this.$el.find(".input-url").val(e.url).trigger("change"),this.$node.html(e.title),this.$node.attr("href",e.url),this.$node.attr("target",e.target)}}),acf.link=acf.model.extend({active:!1,$textarea:null,$node:null,events:{"click #wp-link-submit":"_update","wplink-open":"_open","wplink-close":"_close"},atts:function(e){return void 0!==e?(this.$node.html(e.title),this.$node.attr("href",e.url),this.$node.attr("target",e.target),this.$node.trigger("change",[e]),!0):{title:this.$node.html(),url:this.$node.attr("href"),target:this.$node.attr("target")}},inputs:function(e){return void 0!==e?($("#wp-link-text").val(e.title),$("#wp-link-url").val(e.url),$("#wp-link-target").prop("checked","_blank"===e.target),!0):{title:$("#wp-link-text").val(),url:$("#wp-link-url").val(),target:$("#wp-link-target").prop("checked")?"_blank":""}},open:function(e){var t=$('<textarea id="acf-link-textarea"></textarea>');e.before(t),this.active=!0,this.$node=e,this.$textarea=t;var i=this.atts();wpLink.open("acf-link-textarea",i.url,i.title,null),$("#wp-link-wrap").addClass("has-text-field")},reset:function(){this.active=!1,this.$textarea.remove(),this.$textarea=null,this.$node=null},_select:function(e,t){var i=this.inputs();i.title||(i.title=t.find(".item-title").text(),this.inputs(i),console.log(i))},_open:function(e){if(this.active){var t=this.atts();this.inputs(t)}},_close:function(e){this.active&&setTimeout(function(){acf.link.reset()},100)},_update:function(e){if(this.active){var t=this.inputs();this.atts(t)}}})}(jQuery),function($){acf.media=acf.model.extend({frames:[],mime_types:{},actions:{ready:"ready"},frame:function(){var e=this.frames.length-1;return!(e<0)&&this.frames[e]},destroy:function(e){e.detach(),e.dispose(),e=null,this.frames.pop()},popup:function(e){var t=acf.get("post_id"),i=!1;$.isNumeric(t)||(t=0);var a=acf.parse_args(e,{mode:"select",title:"",button:"",type:"",field:"",mime_types:"",library:"all",multiple:!1,attachment:0,post_id:t,select:function(){}});a.id&&(a.attachment=a.id);var i=this.new_media_frame(a);return this.frames.push(i),setTimeout(function(){i.open()},1),i},_get_media_frame_settings:function(e,t){return"select"===t.mode?e=this._get_select_frame_settings(e,t):"edit"===t.mode&&(e=this._get_edit_frame_settings(e,t)),e},_get_select_frame_settings:function(e,t){return t.type&&(e.library.type=t.type),"uploadedTo"===t.library&&(e.library.uploadedTo=t.post_id),e._button=acf._e("media","select"),e},_get_edit_frame_settings:function(e,t){return e.library.post__in=[t.attachment],e._button=acf._e("media","update"),e},_add_media_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+t.mode)},e),e.on("content:render:edit-image",function(){var e=this.state().get("image"),t=new wp.media.view.EditImage({model:e,controller:this}).render();this.content.set(t),t.loadEditor()},e),e.on("toolbar:create:select",function(t){t.view=new wp.media.view.Toolbar.Select({text:e.options._button,controller:this})},e),e.on("select",function(){var i=e.state(),a=i.get("image"),n=i.get("selection");if(a)return void t.select.apply(e,[a,0]);if(n){var s=0;return void n.each(function(i){t.select.apply(e,[i,s]),s++})}}),e.on("close",function(){setTimeout(function(){acf.media.destroy(e)},500)}),"select"===t.mode?e=this._add_select_frame_events(e,t):"edit"===t.mode&&(e=this._add_edit_frame_events(e,t)),e},_add_select_frame_events:function(e,t){var i=this;return acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=t.field,e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){try{var a=e.content.get().toolbar,n=a.get("filters"),s=a.get("search")}catch(e){return}if("image"==t.type&&(n.filters.all.text=acf._e("image","all"),delete n.filters.audio,delete n.filters.video,$.each(n.filters,function(e,t){null===t.props.type&&(t.props.type="image")})),t.mime_types){var o=t.mime_types.split(" ").join("").split(".").join("").split(",");$.each(o,function(e,t){$.each(i.mime_types,function(e,i){if(-1!==e.indexOf(t)){var a={text:t,props:{status:null,type:i,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};n.filters[i]=a}})})}"uploadedTo"==t.library&&(delete n.filters.unattached,delete n.filters.uploaded,n.$el.parent().append('<span class="acf-uploadedTo">'+acf._e("image","uploadedTo")+"</span>"),$.each(n.filters,function(e,i){i.props.uploadedTo=t.post_id})),$.each(n.filters,function(e,i){i.props._acfuploader=t.field}),s.model.attributes._acfuploader=t.field,"function"==typeof n.refresh&&n.refresh()}),e},_add_edit_frame_events:function(e,t){return e.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e=this.state(),i=e.get("selection"),a=wp.media.attachment(t.attachment);i.add(a)},e),e},new_media_frame:function(e){var t={title:e.title,multiple:e.multiple,library:{},states:[]};t=this._get_media_frame_settings(t,e);var i=wp.media.query(t.library);acf.isset(i,"mirroring","args")&&(i.mirroring.args._acfuploader=e.field),t.states=[new wp.media.controller.Library({library:i,multiple:t.multiple,title:t.title,priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})],acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage);var a=wp.media(t);return a.acf=e,a=this._add_media_frame_events(a,e)},ready:function(){var e=acf.get("wp_version"),t=acf.get("browser"),i=acf.get("post_id");acf.isset(window,"wp","media","view","settings","post")&&$.isNumeric(i)&&(wp.media.view.settings.post.id=i),t&&$("body").addClass("browser-"+t),e&&(e+="",major=e.substr(0,1),$("body").addClass("major-"+major)),acf.isset(window,"wp","media","view")&&(this.customize_Attachment(),this.customize_AttachmentFiltersAll(),this.customize_AttachmentCompat())},customize_Attachment:function(){var e=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=e.extend({render:function(){var t=acf.media.frame(),i=acf.maybe_get(this,"model.attributes.acf_errors");return t&&i&&this.$el.addClass("acf-disabled"),e.prototype.render.apply(this,arguments)},toggleSelection:function(t){var i=this.collection,a=this.options.selection,n=this.model,s=a.single(),o=acf.media.frame(),r=acf.maybe_get(this,"model.attributes.acf_errors"),l=this.controller.$el.find(".media-frame-content .media-sidebar");if(l.children(".acf-selection-error").remove(),l.children().removeClass("acf-hidden"),o&&r){var c=acf.maybe_get(this,"model.attributes.filename","");return l.children().addClass("acf-hidden"),l.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf._e("restricted")+"</span>",'<span class="selection-error-filename">'+c+"</span>",'<span class="selection-error-message">'+r+"</span>","</div>"].join("")),a.reset(),void a.single(n)}e.prototype.toggleSelection.apply(this,arguments)}})},customize_AttachmentFiltersAll:function(){wp.media.view.AttachmentFilters.All.prototype.refresh=function(){this.$el.html(_.chain(this.filters).map(function(e,t){return{el:$("<option></option>").val(t).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())}},customize_AttachmentCompat:function(){var e=wp.media.view.AttachmentCompat;wp.media.view.AttachmentCompat=e.extend({add_acf_expand_button:function(){var e=this.$el.closest(".media-modal");if(!e.find(".media-frame-router .acf-expand-details").exists()){var t=$(['<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(""));t.on("click",function(t){t.preventDefault(),e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),e.find(".media-frame-router").append(t)}},render:function(){if(this.ignore_render)return this;var t=this;return setTimeout(function(){t.add_acf_expand_button()},0),clearTimeout(acf.media.render_timout),acf.media.render_timout=setTimeout(function(){acf.do_action("append",t.$el)},50),e.prototype.render.apply(this,arguments)},dispose:function(){return acf.do_action("remove",this.$el),e.prototype.dispose.apply(this,arguments)},save:function(e){e&&e.preventDefault();var t=acf.serialize(this.$el);this.ignore_render=!0,this.model.saveCompat(t)}})}})}(jQuery),function($){acf.fields.oembed=acf.field.extend({type:"oembed",$el:null,events:{'click [data-name="search-button"]':"_search",'click [data-name="clear-button"]':"_clear",'click [data-name="value-title"]':"_edit",'keypress [data-name="search-input"]':"_keypress",'keyup [data-name="search-input"]':"_keyup",'blur [data-name="search-input"]':"_blur"},focus:function(){this.$el=this.$field.find(".acf-oembed"),this.$search=this.$el.find('[data-name="search-input"]'),this.$input=this.$el.find('[data-name="value-input"]'),this.$title=this.$el.find('[data-name="value-title"]'),this.$embed=this.$el.find('[data-name="value-embed"]'),this.o=acf.get_data(this.$el)},maybe_search:function(){var e=this.$input.val(),t=this.$search.val();if(!t)return void this.clear();t!=e&&this.search()},search:function(){var e=this.$search.val();"http"!=e.substr(0,4)&&(e="http://"+e,this.$search.val(e)),this.$el.addClass("is-loading");var t=acf.prepare_for_ajax({action:"acf/fields/oembed/search",s:e,field_key:this.$field.data("key")});this.$el.data("xhr")&&this.$el.data("xhr").abort();var i=$.ajax({url:acf.get("ajaxurl"),data:t,type:"post",dataType:"json",context:this,success:this.search_success});this.$el.data("xhr",i)},search_success:function(e){var t=this.$search.val();if(this.$el.removeClass("is-loading"),!e||!e.html)return void this.$el.removeClass("has-value").addClass("has-error");this.$el.removeClass("has-error").addClass("has-value"),this.$input.val(t),this.$title.html(t),this.$embed.html(e.html)},clear:function(){this.$el.removeClass("has-error has-value"),this.$el.find('[data-name="search-input"]').val(""),this.$input.val(""),this.$title.html(""),this.$embed.html("")},edit:function(){this.$el.addClass("is-editing"),this.$search.val(this.$title.text()).focus()},blur:function(e){this.$el.removeClass("is-editing"),this.maybe_search()},_search:function(e){this.search()},_clear:function(e){this.clear()},_edit:function(e){this.edit()},_keypress:function(e){13==e.which&&e.preventDefault()},_keyup:function(e){this.$search.val()&&this.maybe_search()},_blur:function(e){this.blur()}})}(jQuery),function($){acf.fields.radio=acf.field.extend({type:"radio",$ul:null,actions:{ready:"initialize",append:"initialize"},events:{'click input[type="radio"]':"click"},focus:function(){this.$ul=this.$field.find(".acf-radio-list"),this.o=acf.get_data(this.$ul)},initialize:function(){this.$ul.find(".selected input").prop("checked",!0)},click:function(e){var t=e.$el,i=t.parent("label"),a=i.hasClass("selected"),n=t.val();if(this.$ul.find(".selected").removeClass("selected"),i.addClass("selected"),this.o.allow_null&&a&&(e.$el.prop("checked",!1),i.removeClass("selected"),n=!1,e.$el.trigger("change")),this.o.other_choice){var s=this.$ul.find('input[type="text"]');"other"===n?s.prop("disabled",!1).attr("name",t.attr("name")):s.prop("disabled",!0).attr("name","")}}})}(jQuery),function($){acf.fields.range=acf.field.extend({type:"range",$el:null,$range:null,$input:null,events:{"input input":"onInput","change input":"onChange"},focus:function(){this.$el=this.$field.find(".acf-range-wrap"),this.$range=this.$el.children('input[type="range"]'),this.$input=this.$el.children('input[type="number"]')},setValue:function(e){this.$input.val(e),this.$range.val(e)},onInput:function(e){this.setValue(e.$el.val())},onChange:function(e){this.setValue(e.$el.val()),"number"==e.$el.attr("type")&&this.$range.trigger("change")}})}(jQuery),function($){acf.fields.relationship=acf.field.extend({type:"relationship",$el:null,$input:null,$filters:null,$choices:null,$values:null,actions:{ready:"initialize",append:"initialize"},events:{"keypress [data-filter]":"submit_filter","change [data-filter]":"change_filter","keyup [data-filter]":"change_filter","click .choices .acf-rel-item":"add_item",'click [data-name="remove_item"]':"remove_item"},focus:function(){this.$el=this.$field.find(".acf-relationship"),this.$input=this.$el.children('input[type="hidden"]'),this.$choices=this.$el.find(".choices"),this.$values=this.$el.find(".values"),this.o=acf.get_data(this.$el)},initialize:function(){var e=this,t=this.$field,i=this.$el,a=this.$input;this.$values.children(".list").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){a.trigger("change")}}),this.$choices.children(".list").scrollTop(0).on("scroll",function(a){if(!i.hasClass("is-loading")&&!i.hasClass("is-empty")&&Math.ceil($(this).scrollTop())+$(this).innerHeight()>=$(this).get(0).scrollHeight){var n=i.data("paged")||1;i.data("paged",n+1),e.set("$field",t).fetch()}}),this.fetch()},maybe_fetch:function(){var e=this,t=this.$field;this.o.timeout&&clearTimeout(this.o.timeout);var i=setTimeout(function(){e.doFocus(t),e.fetch()},300);this.$el.data("timeout",i)},fetch:function(){var e=this,t=this.$field;this.$el.addClass("is-loading"),this.o.xhr&&(this.o.xhr.abort(),this.o.xhr=!1),this.o.action="acf/fields/relationship/query",this.o.field_key=t.data("key"),this.o.post_id=acf.get("post_id");var i=acf.prepare_for_ajax(this.o);1==i.paged&&this.$choices.children(".list").html(""),this.$choices.find("ul:last").append('<p><i class="acf-loading"></i> '+acf._e("relationship","loading")+"</p>");var a=$.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:i,success:function(i){e.set("$field",t).render(i)}});this.$el.data("xhr",a)},render:function(e){if(this.$el.removeClass("is-loading is-empty"),this.$choices.find("p").remove(),!e||!e.results||!e.results.length)return this.$el.addClass("is-empty"),void(1==this.o.paged&&this.$choices.children(".list").append("<p>"+acf._e("relationship","empty")+"</p>"));var t=$(this.walker(e.results));this.$values.find(".acf-rel-item").each(function(){t.find('.acf-rel-item[data-id="'+$(this).data("id")+'"]').addClass("disabled")}),this.$choices.children(".list").append(t);var i="",a=null;this.$choices.find(".acf-rel-label").each(function(){if($(this).text()==i)return a.append($(this).siblings("ul").html()),void $(this).parent().remove();i=$(this).text(),a=$(this).siblings("ul")})},walker:function(e){var t="";if($.isArray(e))for(var i in e)t+=this.walker(e[i]);else $.isPlainObject(e)&&(void 0!==e.children?(t+='<li><span class="acf-rel-label">'+e.text+'</span><ul class="acf-bl">',t+=this.walker(e.children),t+="</ul></li>"):t+='<li><span class="acf-rel-item" data-id="'+e.id+'">'+e.text+"</span></li>");return t},submit_filter:function(e){13==e.which&&e.preventDefault()},change_filter:function(e){var t=e.$el.val(),i=e.$el.data("filter");this.$el.data(i)!=t&&(this.$el.data(i,t),this.$el.data("paged",1),e.$el.is("select")?this.fetch():this.maybe_fetch())},add_item:function(e){if(this.o.max>0&&this.$values.find(".acf-rel-item").length>=this.o.max)return void alert(acf._e("relationship","max").replace("{max}",this.o.max));if(e.$el.hasClass("disabled"))return!1;e.$el.addClass("disabled");var t=["<li>",'<input type="hidden" name="'+this.$input.attr("name")+'[]" value="'+e.$el.data("id")+'" />','<span data-id="'+e.$el.data("id")+'" class="acf-rel-item">'+e.$el.html(),'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("");this.$values.children(".list").append(t),this.$input.trigger("change"),acf.validation.remove_error(this.$field)},remove_item:function(e){var t=e.$el.parent(),i=t.data("id");t.parent("li").remove(),this.$choices.find('.acf-rel-item[data-id="'+i+'"]').removeClass("disabled"),this.$input.trigger("change")}})}(jQuery),function($){var e,t,i;e=acf.select2=acf.model.extend({version:0,version3:null,version4:null,actions:{"ready 1":"ready"},ready:function(){this.version=this.get_version(),this.do_function("ready")},get_version:function(){return acf.maybe_get(window,"Select2")?3:acf.maybe_get(window,"jQuery.fn.select2.amd")?4:0},do_function:function(e,t){t=t||[];var i="version"+this.version;return void 0!==this[i]&&void 0!==this[i][e]&&this[i][e].apply(this,t)},get_data:function(e,t){var i=this;return t=t||[],e.children().each(function(){var e=$(this);e.is("optgroup")?t.push({text:e.attr("label"),children:i.get_data(e)}):t.push({id:e.attr("value"),text:e.text()})}),t},decode_data:function(t){return t?($.each(t,function(i,a){t[i].text=acf.decode(a.text),void 0!==a.children&&(t[i].children=e.decode_data(a.children))}),t):[]},count_data:function(e){var t=0;return e?($.each(e,function(e,i){t++,void 0!==i.children&&(t+=i.children.length)}),t):t},get_ajax_data:function(e,t,i,a){var n=acf.prepare_for_ajax({action:e.ajax_action,field_key:e.key,s:t.term||"",paged:t.page||1});return n=acf.apply_filters("select2_ajax_data",n,e,i,a)},get_ajax_results:function(e,t){var i={results:[]};return e||(e=i),void 0===e.results&&(i.results=e,e=i),e.results=this.decode_data(e.results),e=acf.apply_filters("select2_ajax_results",e,t)},get_value:function(e){var t=[],i=e.find("option:selected");return i.exists()?(i=i.sort(function(e,t){return+e.getAttribute("data-i")-+t.getAttribute("data-i")}),i.each(function(){var e=$(this);t.push({id:e.attr("value"),text:e.text(),$el:e})}),t):t},get_input_value:function(e){return e.val().split("||")},sync_input_value:function(e,t){e.val(t.val().join("||"))},add_option:function(e,t,i){
|
3 |
+
e.find('option[value="'+t+'"]').length||e.append('<option value="'+t+'">'+i+"</option>")},select_option:function(e,t){e.find('option[value="'+t+'"]').prop("selected",!0),e.trigger("change")},unselect_option:function(e,t){e.find('option[value="'+t+'"]').prop("selected",!1),e.trigger("change")},init:function(e,t,i){this.do_function("init",arguments)},destroy:function(e){this.do_function("destroy",arguments)},add_value:function(e,t,i){this.do_function("add_value",arguments)},remove_value:function(e,t){this.do_function("remove_value",arguments)}}),t=e.version3={ready:function(){var e=acf.get("locale"),t=acf.get("rtl");if(l10n=acf._e("select"),l10n){var i={formatMatches:function(e){return 1===e?l10n.matches_1:l10n.matches_n.replace("%d",e)},formatNoMatches:function(){return l10n.matches_0},formatAjaxError:function(){return l10n.load_fail},formatInputTooShort:function(e,t){var i=t-e.length;return 1===i?l10n.input_too_short_1:l10n.input_too_short_n.replace("%d",i)},formatInputTooLong:function(e,t){var i=e.length-t;return 1===i?l10n.input_too_long_1:l10n.input_too_long_n.replace("%d",i)},formatSelectionTooBig:function(e){return 1===e?l10n.selection_too_long_1:l10n.selection_too_long_n.replace("%d",e)},formatLoadMore:function(){return l10n.load_more},formatSearching:function(){return l10n.searching}};$.fn.select2.locales=acf.maybe_get(window,"jQuery.fn.select2.locales",{}),$.fn.select2.locales[e]=i,$.extend($.fn.select2.defaults,i)}},set_data:function(e,t){3==this.version&&(e=e.siblings("input")),e.select2("data",t)},append_data:function(e,t){3==this.version&&(e=e.siblings("input"));var i=e.select2("data")||[];i.push(t),e.select2("data",i)},init:function(i,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=i.siblings("input");if(s.exists()){var o={width:"100%",containerCssClass:"-acf",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e},formatResult:function(e,t,i,a){var n=$.fn.select2.defaults.formatResult(e,t,i,a);return e.description&&(n+=' <span class="select2-result-description">'+e.description+"</span>"),n}},r=this.get_value(i);if(a.multiple){var l=i.attr("name");o.formatSelection=function(e,t){var i='<input type="hidden" class="select2-search-choice-hidden" name="'+l+'" value="'+e.id+'"'+(s.prop("disabled")?'disabled="disabled"':"")+" />";return t.parent().append(i),e.text}}else r=acf.maybe_get(r,0,!1),!a.allow_null&&r&&s.val(r.id);a.allow_null&&i.find('option[value=""]').remove(),o.data=this.get_data(i),o.initSelection=function(e,t){t(r)},a.ajax&&(o.ajax={url:acf.get("ajaxurl"),dataType:"json",type:"post",cache:!1,quietMillis:250,data:function(t,i){var o={term:t,page:i};return e.get_ajax_data(a,o,s,n)},results:function(i,a){var n={page:a};return setTimeout(function(){t.merge_results()},1),e.get_ajax_results(i,n)}}),o.dropdownCss={"z-index":"999999999"},o.acf=a,o=acf.apply_filters("select2_args",o,i,a,n),s.select2(o);var c=s.select2("container");c.before(i),c.before(s),a.multiple&&c.find("ul.select2-choices").sortable({start:function(){s.select2("onSortStart")},stop:function(){s.select2("onSortEnd")}}),i.prop("disabled",!0).addClass("acf-disabled acf-hidden"),s.on("change",function(t){t.added&&e.add_option(i,t.added.id,t.added.text),e.select_option(i,t.val)}),acf.do_action("select2_init",s,o,a,n)}},merge_results:function(){var e="",t=null;$("#select2-drop .select2-result-with-children").each(function(){var i=$(this).children(".select2-result-label"),a=$(this).children(".select2-result-sub");if(i.text()==e)return t.append(a.children()),void $(this).remove();e=i.text(),t=a})},destroy:function(e){var t=e.siblings("input");t.data("select2")&&t.select2("destroy"),e.siblings(".select2-container").remove(),e.prop("disabled",!1).removeClass("acf-disabled acf-hidden"),t.attr("style","")},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i);var n=t.siblings("input"),s={id:i,text:a};if(!t.data("multiple"))return n.select2("data",s);var o=n.select2("data")||[];return o.push(s),n.select2("data",o)},remove_value:function(t,i){e.unselect_option(t,i);var a=t.siblings("input"),n=a.select2("data");t.data("multiple")?(n=$.grep(n,function(e){return e.id!=i}),a.select2("data",n)):n&&n.id==i&&a.select2("data",null)}},i=e.version4={init:function(t,a,n){a=a||{},n=n||null,a=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},a);var s=t.siblings("input");if(s.exists()){var o={width:"100%",allowClear:a.allow_null,placeholder:a.placeholder,multiple:a.multiple,separator:"||",data:[],escapeMarkup:function(e){return e}},r=this.get_value(t);a.multiple?$.each(r,function(e,i){i.$el.detach().appendTo(t)}):r=acf.maybe_get(r,0,""),a.ajax?o.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:function(i){return e.get_ajax_data(a,i,t,n)},processResults:function(t,a){var n=e.get_ajax_results(t,a);return n.more&&(n.pagination={more:!0}),setTimeout(function(){i.merge_results()},1),n}}:(t.removeData("ajax"),t.removeAttr("data-ajax")),o=acf.apply_filters("select2_args",o,t,a,n),t.select2(o);var l=t.next(".select2-container");if(a.multiple){var c=l.find("ul");c.sortable({stop:function(e){c.find(".select2-selection__choice").each(function(){$($(this).data("data").element).detach().appendTo(t),s.trigger("change")})}}),t.on("select2:select",function(e){$(e.params.data.element).detach().appendTo(t)})}s.val(""),l.addClass("-acf"),acf.do_action("select2_init",t,o,a,n)}},merge_results:function(){var e=null,t=null;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),a=$(this).children("strong");if(null!==t&&a.text()==t.text())return e.append(i.children()),void $(this).remove();e=i,t=a})},add_value:function(t,i,a){e.add_option(t,i,a),e.select_option(t,i)},remove_value:function(t,i){e.unselect_option(t,i)},destroy:function(e){e.data("select2")&&e.select2("destroy"),e.siblings(".select2-container").remove()}},acf.add_select2=function(t,i){e.init(t,i)},acf.remove_select2=function(t){e.destroy(t)}}(jQuery),function($){acf.fields.select=acf.field.extend({type:"select",$select:null,actions:{ready:"render",append:"render",remove:"remove"},focus:function(){this.$select=this.$field.find("select"),this.$select.exists()&&(this.o=acf.get_data(this.$select),this.o=acf.parse_args(this.o,{ajax_action:"acf/fields/"+this.type+"/query",key:this.$field.data("key")}))},render:function(){if(!this.$select.exists()||!this.o.ui)return!1;acf.select2.init(this.$select,this.o,this.$field)},remove:function(){if(!this.$select.exists()||!this.o.ui)return!1;acf.select2.destroy(this.$select)}}),acf.fields.user=acf.fields.select.extend({type:"user"}),acf.fields.post_object=acf.fields.select.extend({type:"post_object"}),acf.fields.page_link=acf.fields.select.extend({type:"page_link"})}(jQuery),function($,e){var t=0;acf.fields.accordion=acf.field.extend({type:"accordion",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize"},focus:function(){},initialize:function(){var e=this.$field,i=e.children(".acf-label"),a=e.children(".acf-input"),n=a.children(".acf-fields"),s=n.data();if(!e.is("td")){if(s.endpoint)return void e.remove();var o=a.children(".description");if(o.length&&i.append(o),e.is("tr")){var r=e.closest("table"),l=$('<div class="acf-accordion-title"/>'),c=$('<div class="acf-accordion-content"/>'),d=$('<table class="'+r.attr("class")+'"/>'),f=$("<tbody/>");l.append(i.html()),d.append(f),c.append(d),a.append(l),a.append(c),i.remove(),n.remove(),a.attr("colspan",2),i=l,a=c,n=f}e.addClass("acf-accordion"),i.addClass("acf-accordion-title"),a.addClass("acf-accordion-content"),t++,s.multi_expand&&e.data("multi-expand",1);var u=acf.getPreference("this.accordions")||[];void 0!==u[t-1]&&(s.open=u[t-1]),s.open&&(e.addClass("-open"),a.css("display","block")),i.prepend('<i class="acf-accordion-icon dashicons dashicons-arrow-'+(s.open?"down":"right")+'"></i>');var h=e.parent();n.addClass(h.hasClass("-left")?"-left":""),n.addClass(h.hasClass("-clear")?"-clear":""),n.append(e.nextUntil(".acf-field-accordion",".acf-field")),n.removeAttr("data-open data-multi_expand data-endpoint")}}});var i=acf.model.extend({events:{"click .acf-accordion-title":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el.closest(".acf-accordion"))},isOpen:function(e){return e.hasClass("-open")},toggle:function(e){this.isOpen(e)?this.close(e):this.open(e)},open:function(e){e.find(".acf-accordion-content:first").slideDown().css("display","block"),e.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down"),e.addClass("-open"),acf.do_action("show",e),e.data("multi-expand")||e.siblings(".acf-accordion.-open").each(function(){i.close($(this))}),acf.do_action("refresh",e)},close:function(e){e.find(".acf-accordion-content:first").slideUp(),e.find(".acf-accordion-icon:first").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right"),e.removeClass("-open"),acf.do_action("hide",e)}});$(window).on("unload",function(){var e=[];$(".acf-accordion").each(function(){var t=$(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)});var a=acf.model.extend({active:1,events:{"invalidField .acf-accordion":"invalidField"},invalidField:function(e){this.active&&(this.block(),i.open(e.$el))},block:function(){var e=this;this.active=0,setTimeout(function(){e.active=1},1e3)}})}(jQuery),function($){var e="hidden-by-conditional-logic",t=0,i=0,a=acf.model.extend({$fields:[],actions:{"prepare 15":"initialize","append 15":"initialize","refresh 15":"refresh"},events:{"click .acf-tab-button":"_click"},_click:function(e){e.preventDefault(),this.toggle(e.$el)},isOpen:function(e){return e.hasClass("-open")},toggle:function(e){var t=e.data("key"),i=e.parent(),a=e.closest(".acf-tab-wrap"),n=a.find(".active a"),s=a.siblings('.acf-field[data-key="'+t+'"]');if(!this.isOpen(s)){if(n.length){var o=n.data("key"),r=n.parent(),l=a.siblings('.acf-field[data-key="'+o+'"]');r.removeClass("active"),this.close(l)}i.addClass("active"),this.open(s),acf.do_action("refresh",a.parent())}},getFields:function(e){return e.nextUntil(".acf-field-tab",".acf-field")},getWrap:function(e){return e.prevAll(".acf-tab-wrap:first")},getTab:function(e,t){return e.find('a[data-key="'+t+'"]')},open:function(e){this.getFields(e).each(function(){$(this).removeClass("hidden-by-tab"),acf.do_action("show_field",$(this),"tab")})},close:function(e){this.getFields(e).each(function(){$(this).addClass("hidden-by-tab"),acf.do_action("hide_field",$(this),"tab")})},addTab:function(e){this.$fields.push(e)},initialize:function(){if(this.$fields.length){for(var e=0;e<this.$fields.length;e++)this.createTab(this.$fields[e]);this.$fields=[]}},createTab:function(e){if(e.is("td"))return!1;var a=e.children(".acf-label"),n=e.children(".acf-input"),s=this.getWrap(e),o=e.find(".acf-tab-button"),r=o.data(),l=!1;e.hide(),a.remove(),n.remove(),s.exists()&&!r.endpoint||(s=this.createTabWrap(e,r),l=!0);var c=$("<li></li>").append(o);return l?(c.addClass("active"),this.open(e)):this.close(e),""==o.html()&&c.hide(),s.find("ul").append(c),i++,((acf.getPreference("this.tabs")||[])[t-1]||0)!=i-1||l||this.toggle(o),c},createTabWrap:function(e,a){var n=e.parent(),s=!1;return n.hasClass("acf-fields")&&"left"==a.placement&&n.addClass("-sidebar"),s=$(e.is("tr")?'<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>':'<div class="acf-tab-wrap -'+a.placement+'"><ul class="acf-hl acf-tab-group"></ul></div>'),e.before(s),t++,i=0,s},refresh:function(e){$(".acf-tab-wrap",e).each(function(){var e=$(this);if(e.hasClass("-left")){var t=e.parent(),i=t.is("td")?"height":"min-height",a=e.position().top+e.children("ul").outerHeight(!0)-1;t.css(i,a)}})}});acf.fields.tab=acf.field.extend({type:"tab",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize",hide:"hide",show:"show"},focus:function(){},initialize:function(){a.addTab(this.$field)},hide:function(t,i){if("conditional_logic"==i){var n=t.data("key"),s=a.getWrap(t),o=a.getTab(s,n),r=o.parent();s.exists()&&(r.addClass(e),a.getFields(t).each(function(){acf.conditional_logic.hide_field($(this),n)}),r.hasClass("active")&&s.find("li:not(."+e+"):first a").trigger("click"))}},show:function(t,i){if("conditional_logic"==i){var n=t.data("key"),s=a.getWrap(t),o=a.getTab(s,n),r=o.parent();if(s.exists()){r.removeClass(e),a.getFields(t).each(function(){acf.conditional_logic.show_field($(this),n)});var l=r.siblings(".active");l.exists()&&!l.hasClass(e)||a.toggle(o)}}}}),$(window).on("unload",function(){var e=[];$(".acf-tab-wrap").each(function(){var t=$(this).find(".active").index()||0;e.push(t)}),e.length&&acf.setPreference("this.tabs",e)});var n=acf.model.extend({active:1,actions:{invalid_field:"invalid_field"},invalid_field:function(e){if(this.active&&e.hasClass("hidden-by-tab")){var t=this,i=e.prevAll(".acf-field-tab:first");e.prevAll(".acf-tab-wrap:first").find('a[data-key="'+i.data("key")+'"]').trigger("click"),this.active=0,setTimeout(function(){t.active=1},1e3)}}})}(jQuery),function($){acf.fields.time_picker=acf.field.extend({type:"time_picker",$el:null,$input:null,$hidden:null,o:{},actions:{ready:"initialize",append:"initialize"},events:{'blur input[type="text"]':"blur"},focus:function(){this.$el=this.$field.find(".acf-time-picker"),this.$input=this.$el.find('input[type="text"]'),this.$hidden=this.$el.find('input[type="hidden"]'),this.o=acf.get_data(this.$el)},initialize:function(){if(void 0!==$.timepicker){var e={timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf._e("date_time_picker","selectText")};e.onClose=function(e,t){var i=t.dpDiv,a=i.find(".ui-datepicker-close");if(!e&&a.is(":hover")){if(!(e=acf.maybe_get(t,"settings.timepicker.formattedTime")))return;$.datepicker._setTime(t)}},e=acf.apply_filters("time_picker_args",e,this.$field),this.$input.timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />'),acf.do_action("time_picker_init",this.$input,e,this.$field)}},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.fields.true_false=acf.field.extend({type:"true_false",$switch:null,$input:null,actions:{prepare:"render",append:"render",show:"render"},events:{"change .acf-switch-input":"_change","focus .acf-switch-input":"_focus","blur .acf-switch-input":"_blur","keypress .acf-switch-input":"_keypress"},focus:function(){this.$input=this.$field.find(".acf-switch-input"),this.$switch=this.$field.find(".acf-switch")},render:function(){if(this.$switch.exists()){var e=this.$switch.children(".acf-switch-on"),t=this.$switch.children(".acf-switch-off");width=Math.max(e.width(),t.width()),width&&(e.css("min-width",width),t.css("min-width",width))}},on:function(){this.$input.prop("checked",!0),this.$switch.addClass("-on")},off:function(){this.$input.prop("checked",!1),this.$switch.removeClass("-on")},_change:function(e){e.$el.prop("checked")?this.on():this.off()},_focus:function(e){this.$switch.addClass("-focus")},_blur:function(e){this.$switch.removeClass("-focus")},_keypress:function(e){return 37===e.keyCode?this.off():39===e.keyCode?this.on():void 0}})}(jQuery),function($){acf.fields.taxonomy=acf.field.extend({type:"taxonomy",$el:null,actions:{ready:"render",append:"render",remove:"remove"},events:{'click a[data-name="add"]':"add_term"},focus:function(){this.$el=this.$field.find(".acf-taxonomy-field"),this.o=acf.get_data(this.$el,{save:"",type:"",taxonomy:""}),this.o.key=this.$field.data("key")},render:function(){var e=this.$field.find("select");if(e.exists()){var t=acf.get_data(e);t=acf.parse_args(t,{pagination:!0,ajax_action:"acf/fields/taxonomy/query",key:this.o.key}),acf.select2.init(e,t)}},remove:function(){var e=this.$field.find("select");if(!e.exists())return!1;acf.select2.destroy(e)},add_term:function(e){var t=this;acf.open_popup({title:e.$el.attr("title")||e.$el.data("title"),loading:!0,height:220});var i=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key});$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(e){t.add_term_confirm(e)}})},add_term_confirm:function(e){var t=this;acf.update_popup({content:e}),$('#acf-popup input[name="term_name"]').focus(),$("#acf-popup form").on("submit",function(e){e.preventDefault(),t.add_term_submit($(this))})},add_term_submit:function(e){var t=this,i=e.find(".acf-submit"),a=e.find('input[name="term_name"]'),n=e.find('select[name="term_parent"]');if(""===a.val())return a.focus(),!1;i.find("button").attr("disabled","disabled"),i.find(".acf-spinner").addClass("is-active");var s=acf.prepare_for_ajax({action:"acf/fields/taxonomy/add_term",field_key:this.o.key,term_name:a.val(),term_parent:n.exists()?n.val():0});$.ajax({url:acf.get("ajaxurl"),data:s,type:"post",dataType:"json",success:function(e){var n=acf.get_ajax_message(e);acf.is_ajax_success(e)&&(a.val(""),t.append_new_term(e.data)),n.text&&i.find("span").html(n.text)},complete:function(){i.find("button").removeAttr("disabled"),i.find(".acf-spinner").removeClass("is-active"),i.find("span").delay(1500).fadeOut(250,function(){$(this).html(""),$(this).show()}),a.focus()}})},append_new_term:function(e){var t={id:e.term_id,text:e.term_label};switch($('.acf-taxonomy-field[data-taxonomy="'+this.o.taxonomy+'"]').each(function(){var t=$(this).data("type");if("radio"==t||"checkbox"==t){var i=$(this).children('input[type="hidden"]'),a=$(this).find("ul:first"),n=i.attr("name");"checkbox"==t&&(n+="[]");var s=$(['<li data-id="'+e.term_id+'">',"<label>",'<input type="'+t+'" value="'+e.term_id+'" name="'+n+'" /> ',"<span>"+e.term_label+"</span>","</label>","</li>"].join(""));if(e.term_parent){var o=a.find('li[data-id="'+e.term_parent+'"]');a=o.children("ul"),a.exists()||(a=$('<ul class="children acf-bl"></ul>'),o.append(a))}a.append(s)}}),$("#acf-popup #term_parent").each(function(){var t=$('<option value="'+e.term_id+'">'+e.term_label+"</option>");e.term_parent?$(this).children('option[value="'+e.term_parent+'"]').after(t):$(this).append(t)}),this.o.type){case"select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"multi_select":var i=this.$el.children("select");acf.select2.add_value(i,e.term_id,e.term_label);break;case"checkbox":case"radio":var a=this.$el.find(".categorychecklist-holder"),n=a.find('li[data-id="'+e.term_id+'"]'),s=a.get(0).scrollTop+(n.offset().top-a.offset().top);n.find("input").prop("checked",!0),a.animate({scrollTop:s},"250");break}}})}(jQuery),function($){acf.fields.url=acf.field.extend({type:"url",$input:null,actions:{ready:"render",append:"render"},events:{'keyup input[type="url"]':"render"},focus:function(){this.$input=this.$field.find('input[type="url"]')},is_valid:function(){var e=this.$input.val();if(-1!==e.indexOf("://"));else if(0!==e.indexOf("//"))return!1;return!0},render:function(){this.is_valid()?this.$input.parent().addClass("-valid"):this.$input.parent().removeClass("-valid")}})}(jQuery),function($){acf.validation=acf.model.extend({actions:{ready:"ready",append:"ready"},filters:{validation_complete:"validation_complete"},events:{"click #save-post":"click_ignore",'click [type="submit"]':"click_publish","submit form":"submit_form","click .acf-error-message a":"click_message"},active:1,ignore:0,busy:0,valid:!0,errors:[],error_class:"acf-error",message_class:"acf-error-message",$trigger:null,ready:function(e){var t=$(".acf-field input, .acf-field textarea, .acf-field select");if(t.length){var i=this;t.on("invalid",function(e){var t=$(this),i=acf.get_field_wrap(t);i.trigger("invalidField"),acf.do_action("invalid",t),acf.do_action("invalid_field",i),acf.validation.ignore||(e.preventDefault(),acf.validation.errors.push({input:t.attr("name"),message:e.target.validationMessage}),acf.validation.fetch(t.closest("form")))})}},validation_complete:function(e,t){if(!this.errors.length)return e;e.valid=0,e.errors=e.errors||[];var a=[];if(e.errors.length)for(i in e.errors)a.push(e.errors[i].input);if(this.errors.length)for(i in this.errors){var n=this.errors[i];-1===$.inArray(n.input,a)&&e.errors.push(n)}return this.errors=[],e},click_message:function(e){e.preventDefault(),acf.remove_el(e.$el.parent())},click_ignore:function(e){var t=this;this.ignore=1,this.$trigger=e.$el,this.$form=e.$el.closest("form"),$("."+this.message_class).each(function(){acf.remove_el($(this))}),this.ignore_required_inputs(),setTimeout(function(){t.ignore=0},100)},ignore_required_inputs:function(){var e=$(".acf-field input[required], .acf-field textarea[required], .acf-field select[required]");e.length&&(e.prop("required",!1),setTimeout(function(){e.prop("required",!0)},100))},click_publish:function(e){this.$trigger=e.$el},submit_form:function(e){if(!this.active)return!0;if(this.ignore)return this.ignore=0,!0;if(!e.$el.find("#acf-form-data").exists())return!0;var t=e.$el.find("#wp-preview");if(t.exists()&&t.val())return this.toggle(e.$el,"unlock"),!0;e.preventDefault(),this.fetch(e.$el)},toggle:function(e,t){t=t||"unlock";var i=null,a=null,n=$("#submitdiv");n.exists()||(n=$("#submitpost")),n.exists()||(n=e.find("p.submit").last()),n.exists()||(n=e.find(".acf-form-submit")),n.exists()||(n=e),i=n.find('input[type="submit"], .button'),a=n.find(".spinner, .acf-spinner"),this.hide_spinner(a),"unlock"==t?this.enable_submit(i):"lock"==t&&(this.disable_submit(i),this.show_spinner(a.last()))},fetch:function(e){if(this.busy)return!1;var t=this;acf.do_action("validation_begin");var i=acf.serialize(e);i.action="acf/validate_save_post",i=acf.prepare_for_ajax(i),this.busy=1,this.toggle(e,"lock"),$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"json",success:function(i){acf.is_ajax_success(i)&&t.fetch_success(e,i.data)},complete:function(){t.fetch_complete(e)}})},fetch_complete:function(e){if(this.busy=0,this.toggle(e,"unlock"),this.valid){this.ignore=1;var t=e.children(".acf-error-message");t.exists()&&(t.addClass("-success"),t.children("p").html(acf._e("validation_successful")),setTimeout(function(){acf.remove_el(t)},2e3)),e.find(".acf-postbox.acf-hidden").remove(),acf.do_action("submit",e),this.$trigger?this.$trigger.click():e.submit(),this.toggle(e,"lock")}},fetch_success:function(e,t){if(!(t=acf.apply_filters("validation_complete",t,e))||t.valid||!t.errors)return this.valid=!0,void acf.do_action("validation_success");this.valid=!1,this.$trigger=null,this.display_errors(t.errors,e),acf.do_action("validation_failure")},display_errors:function(e,t){if(e&&e.length){var a=t.children(".acf-error-message"),n=acf._e("validation_failed"),s=0,o=null;for(i=0;i<e.length;i++){var r=e[i];if(r.input){var l=t.find('[name="'+r.input+'"]').first();if(l.exists()||(l=t.find('[name^="'+r.input+'"]').first()),l.exists()){s++;var c=acf.get_field_wrap(l);this.add_error(c,r.message),null===o&&(o=c)}}else n+=". "+r.message}1==s?n+=". "+acf._e("validation_failed_1"):s>1&&(n+=". "+acf._e("validation_failed_2").replace("%d",s)),a.exists()||(a=$('<div class="acf-error-message"><p></p><a href="#" class="acf-icon -cancel small"></a></div>'),t.prepend(a)),a.children("p").html(n),null===o&&(o=a),setTimeout(function(){$("html, body").animate({scrollTop:o.offset().top-$(window).height()/2},500)},10)}},add_error:function(e,t){var i=this;e.addClass(this.error_class),void 0!==t&&(e.children(".acf-input").children("."+this.message_class).remove(),e.children(".acf-input").prepend('<div class="'+this.message_class+'"><p>'+t+"</p></div>"));var a=function(){i.remove_error(e),e.off("focus change","input, textarea, select",a)};e.on("focus change","input, textarea, select",a),e.trigger("invalidField"),acf.do_action("add_field_error",e),acf.do_action("invalid_field",e)},remove_error:function(e){var t=e.children(".acf-input").children("."+this.message_class);e.removeClass(this.error_class),setTimeout(function(){acf.remove_el(t)},250),acf.do_action("remove_field_error",e),acf.do_action("valid_field",e)},add_warning:function(e,t){this.add_error(e,t),setTimeout(function(){acf.validation.remove_error(e)},1e3)},show_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.addClass("is-active"):e.css("display","inline-block")}},hide_spinner:function(e){if(e.exists()){var t=acf.get("wp_version");parseFloat(t)>=4.2?e.removeClass("is-active"):e.css("display","none")}},disable_submit:function(e){e.exists()&&e.addClass("disabled button-disabled button-primary-disabled")},enable_submit:function(e){e.exists()&&e.removeClass("disabled button-disabled button-primary-disabled")}})}(jQuery),function($){acf.fields.wysiwyg=acf.field.extend({type:"wysiwyg",$el:null,$textarea:null,toolbars:{},events:{"mousedown .acf-editor-wrap.delay":"mousedown"},actions:{load:"initialize",append:"initialize",remove:"disable",sortstart:"disable",sortstop:"enable"},focus:function(){this.$el=this.$field.find(".wp-editor-wrap").last(),this.$textarea=this.$el.find("textarea"),this.o=acf.get_data(this.$el,{toolbar:"",active:this.$el.hasClass("tmce-active"),id:this.$textarea.attr("id")})},mousedown:function(e){e.preventDefault(),this.$el.removeClass("delay"),this.$el.find(".acf-editor-toolbar").remove(),this.initialize()},initialize:function(){if(!this.$el.hasClass("delay")){var e={tinymce:!0,quicktags:!0,toolbar:this.o.toolbar,mode:this.o.active?"visual":"text"},t=this.o.id,i=acf.get_uniqid("acf-editor-"),a=this.$el.outerHTML();a=acf.str_replace(t,i,a),this.$el.replaceWith(a),this.o.id=i,acf.tinymce.initialize(this.o.id,e,this.$field)}},disable:function(){acf.tinymce.destroy(this.o.id)},enable:function(){this.o.active&&acf.tinymce.enable(this.o.id)}}),acf.tinymce=acf.model.extend({toolbars:{},actions:{ready:"ready"},ready:function(){var e=$("#acf-hidden-wp-editor");e.exists()&&(e.appendTo("body"),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(e){var t=e.editor;"acf"===t.id.substr(0,3)&&(t=tinymce.editors.content||t,tinymce.activeEditor=t,wpActiveEditor=t.id)}))},defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content}},initialize:function(e,t,i){t=t||{},i=i||null,t=acf.parse_args(t,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual"}),t.tinymce&&this.initialize_tinymce(e,t,i),t.quicktags&&this.initialize_quicktags(e,t,i)},initialize_tinymce:function(e,t,i){var a=$("#"+e),n=this.defaults(),s=this.toolbars;if("undefined"==typeof tinymce)return!1;if(!n)return!1;if(tinymce.get(e))return this.enable(e);init=$.extend({},n.tinymce,t.tinymce),init.id=e,init.selector="#"+e;var o=t.toolbar;if(o&&void 0!==s[o])for(var r=1;r<=4;r++)init["toolbar"+r]=s[o][r]||"";if(init.setup=function(t){t.on("focus",function(e){acf.validation.remove_error(i)}),t.on("change",function(e){t.save(),a.trigger("change")}),$(t.getWin()).on("unload",function(){acf.tinymce.remove(e)})},init.wp_autoresize_on=!1,init=acf.apply_filters("wysiwyg_tinymce_settings",init,e,i),tinyMCEPreInit.mceInit[e]=init,"visual"==t.mode){tinymce.init(init);var l=tinymce.get(e);acf.do_action("wysiwyg_tinymce_init",l,l.id,init,i)}},initialize_quicktags:function(e,t,i){var a=this.defaults();if("undefined"==typeof quicktags)return!1;if(!a)return!1;init=$.extend({},a.quicktags,t.quicktags),init.id=e,init=acf.apply_filters("wysiwyg_quicktags_settings",init,init.id,i),tinyMCEPreInit.qtInit[e]=init;var n=quicktags(init);this.build_quicktags(n),acf.do_action("wysiwyg_quicktags_init",n,n.id,init,i)},build_quicktags:function(e){var t,i,a,n,s,e,o,r,l,c,d=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";t=e.canvas,i=e.name,a=e.settings,s="",n={},l="",c=e.id,a.buttons&&(l=","+a.buttons+",");for(r in edButtons)edButtons[r]&&(o=edButtons[r].id,l&&-1!==d.indexOf(","+o+",")&&-1===l.indexOf(","+o+",")||edButtons[r].instance&&edButtons[r].instance!==c||(n[o]=edButtons[r],edButtons[r].html&&(s+=edButtons[r].html(i+"_"))));l&&-1!==l.indexOf(",dfw,")&&(n.dfw=new QTags.DFWButton,s+=n.dfw.html(i+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(n.textdirection=new QTags.TextDirectionButton,s+=n.textdirection.html(i+"_")),e.toolbar.innerHTML=s,e.theButtons=n,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[e])},disable:function(e){this.destroy(e)},destroy:function(e){this.destroy_tinymce(e)},destroy_tinymce:function(e){if("undefined"==typeof tinymce)return!1;var t=tinymce.get(e);return!!t&&(t.save(),t.destroy(),!0)},enable:function(e){this.enable_tinymce(e)},enable_tinymce:function(e){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[e]&&(switchEditors.go(e,"tmce"),!0))}})}(jQuery);
|
includes/api/api-field.php
CHANGED
@@ -769,7 +769,8 @@ function acf_get_fields_by_id( $parent_id = 0 ) {
|
|
769 |
'suppress_filters' => true, // DO NOT allow WPML to modify the query
|
770 |
'post_parent' => $parent_id,
|
771 |
'post_status' => 'publish, trash', // 'any' won't get trashed fields
|
772 |
-
'update_post_meta_cache' => false
|
|
|
773 |
));
|
774 |
|
775 |
|
@@ -1047,7 +1048,9 @@ function _acf_get_field_by_name( $name = '', $db_only = false ) {
|
|
1047 |
'orderby' => 'menu_order title',
|
1048 |
'order' => 'ASC',
|
1049 |
'suppress_filters' => false,
|
1050 |
-
'acf_field_name' => $name
|
|
|
|
|
1051 |
);
|
1052 |
|
1053 |
|
@@ -1157,7 +1160,9 @@ function acf_get_field_id( $key = '' ) {
|
|
1157 |
'orderby' => 'menu_order title',
|
1158 |
'order' => 'ASC',
|
1159 |
'suppress_filters' => false,
|
1160 |
-
'acf_field_key' => $key
|
|
|
|
|
1161 |
);
|
1162 |
|
1163 |
|
769 |
'suppress_filters' => true, // DO NOT allow WPML to modify the query
|
770 |
'post_parent' => $parent_id,
|
771 |
'post_status' => 'publish, trash', // 'any' won't get trashed fields
|
772 |
+
'update_post_meta_cache' => false,
|
773 |
+
'update_post_term_cache' => false
|
774 |
));
|
775 |
|
776 |
|
1048 |
'orderby' => 'menu_order title',
|
1049 |
'order' => 'ASC',
|
1050 |
'suppress_filters' => false,
|
1051 |
+
'acf_field_name' => $name,
|
1052 |
+
'update_post_meta_cache' => false,
|
1053 |
+
'update_post_term_cache' => false
|
1054 |
);
|
1055 |
|
1056 |
|
1160 |
'orderby' => 'menu_order title',
|
1161 |
'order' => 'ASC',
|
1162 |
'suppress_filters' => false,
|
1163 |
+
'acf_field_key' => $key,
|
1164 |
+
'update_post_meta_cache' => false,
|
1165 |
+
'update_post_term_cache' => false
|
1166 |
);
|
1167 |
|
1168 |
|
includes/api/api-helpers.php
CHANGED
@@ -1823,8 +1823,8 @@ function acf_get_grouped_posts( $args ) {
|
|
1823 |
|
1824 |
|
1825 |
// attachment doesn't work if it is the only item in an array
|
1826 |
-
if( $is_single_post_type) {
|
1827 |
-
$args['post_type'] =
|
1828 |
}
|
1829 |
|
1830 |
|
@@ -3530,98 +3530,116 @@ function acf_maybe_get_GET( $key = '', $default = null ) {
|
|
3530 |
* @return (array)
|
3531 |
*/
|
3532 |
|
3533 |
-
function acf_get_attachment( $
|
3534 |
|
3535 |
-
// post
|
3536 |
-
|
|
|
|
|
3537 |
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
|
|
3541 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3542 |
|
3543 |
// vars
|
3544 |
-
$
|
3545 |
-
|
3546 |
-
|
3547 |
-
'
|
3548 |
-
'
|
3549 |
-
'
|
3550 |
-
'
|
3551 |
-
'
|
3552 |
-
'alt' => get_post_meta($
|
3553 |
-
'author' => $
|
3554 |
-
'description' => $
|
3555 |
-
'caption' => $
|
3556 |
-
'name' => $
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
3560 |
-
'
|
3561 |
-
'
|
|
|
|
|
|
|
|
|
3562 |
);
|
3563 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3564 |
|
3565 |
-
//
|
3566 |
-
if( $
|
3567 |
-
|
3568 |
-
$thumb_id = $id;
|
3569 |
-
$src = wp_get_attachment_image_src( $id, 'full' );
|
3570 |
-
|
3571 |
-
$a['url'] = $src[0];
|
3572 |
-
$a['width'] = $src[1];
|
3573 |
-
$a['height'] = $src[2];
|
3574 |
|
|
|
|
|
3575 |
|
3576 |
-
|
|
|
|
|
|
|
|
|
|
|
3577 |
|
3578 |
-
//
|
3579 |
-
|
3580 |
-
|
3581 |
-
$meta = wp_get_attachment_metadata( $id );
|
3582 |
-
$a['width'] = acf_maybe_get($meta, 'width', 0);
|
3583 |
-
$a['height'] = acf_maybe_get($meta, 'height', 0);
|
3584 |
|
|
|
|
|
|
|
3585 |
}
|
3586 |
|
|
|
|
|
3587 |
|
3588 |
-
//
|
3589 |
-
if( $featured_id = get_post_thumbnail_id($
|
3590 |
-
|
3591 |
-
|
3592 |
-
|
3593 |
-
}
|
3594 |
-
|
3595 |
}
|
3596 |
|
3597 |
|
3598 |
// sizes
|
3599 |
-
if( $
|
3600 |
|
3601 |
-
//
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
|
3608 |
-
|
3609 |
-
|
3610 |
-
|
3611 |
-
// add src
|
3612 |
-
$a['sizes'][ $size ] = $src[0];
|
3613 |
-
$a['sizes'][ $size . '-width' ] = $src[1];
|
3614 |
-
$a['sizes'][ $size . '-height' ] = $src[2];
|
3615 |
-
|
3616 |
-
}
|
3617 |
-
|
3618 |
}
|
3619 |
|
|
|
|
|
3620 |
}
|
3621 |
|
3622 |
-
|
3623 |
// return
|
3624 |
-
return $
|
3625 |
|
3626 |
}
|
3627 |
|
@@ -5100,22 +5118,6 @@ function acf_remove_array_key_prefix( $array, $prefix ) {
|
|
5100 |
}
|
5101 |
|
5102 |
|
5103 |
-
|
5104 |
-
|
5105 |
-
add_filter("acf/settings/slug", '_acf_settings_slug');
|
5106 |
-
|
5107 |
-
function _acf_settings_slug( $v ) {
|
5108 |
-
|
5109 |
-
$basename = acf_get_setting('basename');
|
5110 |
-
$slug = explode('/', $basename);
|
5111 |
-
$slug = current($slug);
|
5112 |
-
|
5113 |
-
return $slug;
|
5114 |
-
}
|
5115 |
-
|
5116 |
-
|
5117 |
-
|
5118 |
-
|
5119 |
/*
|
5120 |
* acf_strip_protocol
|
5121 |
*
|
1823 |
|
1824 |
|
1825 |
// attachment doesn't work if it is the only item in an array
|
1826 |
+
if( $is_single_post_type ) {
|
1827 |
+
$args['post_type'] = reset($post_types);
|
1828 |
}
|
1829 |
|
1830 |
|
3530 |
* @return (array)
|
3531 |
*/
|
3532 |
|
3533 |
+
function acf_get_attachment( $attachment ) {
|
3534 |
|
3535 |
+
// get post
|
3536 |
+
if( !$attachment = get_post($attachment) ) {
|
3537 |
+
return false;
|
3538 |
+
}
|
3539 |
|
3540 |
+
// validate post_type
|
3541 |
+
if( $attachment->post_type !== 'attachment' ) {
|
3542 |
+
return false;
|
3543 |
+
}
|
3544 |
|
3545 |
+
// vars
|
3546 |
+
$sizes_id = 0;
|
3547 |
+
$meta = wp_get_attachment_metadata( $attachment->ID );
|
3548 |
+
$attached_file = get_attached_file( $attachment->ID );
|
3549 |
+
$attachment_url = wp_get_attachment_url( $attachment->ID );
|
3550 |
+
|
3551 |
+
// get mime types
|
3552 |
+
if( strpos( $attachment->post_mime_type, '/' ) !== false ) {
|
3553 |
+
list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
|
3554 |
+
} else {
|
3555 |
+
list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
|
3556 |
+
}
|
3557 |
|
3558 |
// vars
|
3559 |
+
$response = array(
|
3560 |
+
'ID' => $attachment->ID,
|
3561 |
+
'id' => $attachment->ID,
|
3562 |
+
'title' => $attachment->post_title,
|
3563 |
+
'filename' => wp_basename( $attached_file ),
|
3564 |
+
'filesize' => 0,
|
3565 |
+
'url' => $attachment_url,
|
3566 |
+
'link' => get_attachment_link( $attachment->ID ),
|
3567 |
+
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
|
3568 |
+
'author' => $attachment->post_author,
|
3569 |
+
'description' => $attachment->post_content,
|
3570 |
+
'caption' => $attachment->post_excerpt,
|
3571 |
+
'name' => $attachment->post_name,
|
3572 |
+
'status' => $attachment->post_status,
|
3573 |
+
'uploaded_to' => $attachment->post_parent,
|
3574 |
+
'date' => $attachment->post_date_gmt,
|
3575 |
+
'modified' => $attachment->post_modified_gmt,
|
3576 |
+
'menu_order' => $attachment->menu_order,
|
3577 |
+
'mime_type' => $attachment->post_mime_type,
|
3578 |
+
'type' => $type,
|
3579 |
+
'subtype' => $subtype,
|
3580 |
+
'icon' => wp_mime_type_icon( $attachment->ID )
|
3581 |
);
|
3582 |
|
3583 |
+
// filesize
|
3584 |
+
if( isset($meta['filesize']) ) {
|
3585 |
+
$response['filesize'] = $meta['filesize'];
|
3586 |
+
} elseif( file_exists($attached_file) ) {
|
3587 |
+
$response['filesize'] = filesize( $attached_file );
|
3588 |
+
}
|
3589 |
|
3590 |
+
// image
|
3591 |
+
if( $type === 'image' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3592 |
|
3593 |
+
$sizes_id = $attachment->ID;
|
3594 |
+
$src = wp_get_attachment_image_src( $attachment->ID, 'full' );
|
3595 |
|
3596 |
+
$response['url'] = $src[0];
|
3597 |
+
$response['width'] = $src[1];
|
3598 |
+
$response['height'] = $src[2];
|
3599 |
+
|
3600 |
+
// video
|
3601 |
+
} elseif( $type === 'video' ) {
|
3602 |
|
3603 |
+
// dimentions
|
3604 |
+
$response['width'] = acf_maybe_get($meta, 'width', 0);
|
3605 |
+
$response['height'] = acf_maybe_get($meta, 'height', 0);
|
|
|
|
|
|
|
3606 |
|
3607 |
+
// featured image
|
3608 |
+
if( $featured_id = get_post_thumbnail_id($attachment->ID) ) {
|
3609 |
+
$sizes_id = $featured_id;
|
3610 |
}
|
3611 |
|
3612 |
+
// audio
|
3613 |
+
} elseif( $type === 'audio' ) {
|
3614 |
|
3615 |
+
// featured image
|
3616 |
+
if( $featured_id = get_post_thumbnail_id($attachment->ID) ) {
|
3617 |
+
$sizes_id = $featured_id;
|
3618 |
+
}
|
|
|
|
|
|
|
3619 |
}
|
3620 |
|
3621 |
|
3622 |
// sizes
|
3623 |
+
if( $sizes_id ) {
|
3624 |
|
3625 |
+
// vars
|
3626 |
+
$sizes = get_intermediate_image_sizes();
|
3627 |
+
$data = array();
|
3628 |
+
|
3629 |
+
// loop
|
3630 |
+
foreach( $sizes as $size ) {
|
3631 |
+
$src = wp_get_attachment_image_src( $sizes_id, $size );
|
3632 |
+
$data[ $size ] = $src[0];
|
3633 |
+
$data[ $size . '-width' ] = $src[1];
|
3634 |
+
$data[ $size . '-height' ] = $src[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3635 |
}
|
3636 |
|
3637 |
+
// append
|
3638 |
+
$response['sizes'] = $data;
|
3639 |
}
|
3640 |
|
|
|
3641 |
// return
|
3642 |
+
return $response;
|
3643 |
|
3644 |
}
|
3645 |
|
5118 |
}
|
5119 |
|
5120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5121 |
/*
|
5122 |
* acf_strip_protocol
|
5123 |
*
|
includes/api/api-value.php
CHANGED
@@ -386,9 +386,9 @@ function acf_update_value( $value = null, $post_id = 0, $field ) {
|
|
386 |
|
387 |
|
388 |
// allow filter to short-circuit update_value logic
|
389 |
-
$
|
390 |
-
if( $
|
391 |
-
return
|
392 |
}
|
393 |
|
394 |
|
386 |
|
387 |
|
388 |
// allow filter to short-circuit update_value logic
|
389 |
+
$check = apply_filters( "acf/pre_update_value", null, $value, $post_id, $field );
|
390 |
+
if( $check !== null ) {
|
391 |
+
return $check;
|
392 |
}
|
393 |
|
394 |
|
includes/fields/class-acf-field-file.php
CHANGED
@@ -78,8 +78,8 @@ class acf_field_file extends acf_field {
|
|
78 |
'icon' => '',
|
79 |
'title' => '',
|
80 |
'url' => '',
|
81 |
-
'filesize' => '',
|
82 |
'filename' => '',
|
|
|
83 |
);
|
84 |
|
85 |
$div = array(
|
@@ -93,26 +93,21 @@ class acf_field_file extends acf_field {
|
|
93 |
// has value?
|
94 |
if( $field['value'] ) {
|
95 |
|
96 |
-
$
|
97 |
-
|
98 |
-
if( $file ) {
|
99 |
-
|
100 |
-
$o['icon'] = wp_mime_type_icon( $file->ID );
|
101 |
-
$o['title'] = $file->post_title;
|
102 |
-
$o['filesize'] = @size_format(filesize( get_attached_file( $file->ID ) ));
|
103 |
-
$o['url'] = wp_get_attachment_url( $file->ID );
|
104 |
|
105 |
-
|
106 |
-
$o['filename'] = end( $explode );
|
107 |
-
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
// url exists
|
112 |
-
if( $o['url'] ) {
|
113 |
$div['class'] .= ' has-value';
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
?>
|
78 |
'icon' => '',
|
79 |
'title' => '',
|
80 |
'url' => '',
|
|
|
81 |
'filename' => '',
|
82 |
+
'filesize' => ''
|
83 |
);
|
84 |
|
85 |
$div = array(
|
93 |
// has value?
|
94 |
if( $field['value'] ) {
|
95 |
|
96 |
+
$attachment = acf_get_attachment($field['value']);
|
97 |
+
if( $attachment ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
+
// has value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
$div['class'] .= ' has-value';
|
101 |
+
|
102 |
+
// update
|
103 |
+
$o['icon'] = $attachment['icon'];
|
104 |
+
$o['title'] = $attachment['title'];
|
105 |
+
$o['url'] = $attachment['url'];
|
106 |
+
$o['filename'] = $attachment['filename'];
|
107 |
+
if( $attachment['filesize'] ) {
|
108 |
+
$o['filesize'] = size_format($attachment['filesize']);
|
109 |
+
}
|
110 |
+
}
|
111 |
}
|
112 |
|
113 |
?>
|
lang/acf-zh_CN.mo
CHANGED
Binary file
|
lang/acf-zh_CN.po
CHANGED
@@ -3,7 +3,7 @@ msgstr ""
|
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.2.9\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
"POT-Creation-Date: 2015-08-11 23:50+0200\n"
|
6 |
-
"PO-Revision-Date: 2018-
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Amos Lee <470266798@qq.com>\n"
|
9 |
"Language: zh_CN\n"
|
@@ -2486,7 +2486,7 @@ msgstr "已到最小行数 ({min} 行)"
|
|
2486 |
|
2487 |
#: pro/fields/repeater.php:47
|
2488 |
msgid "Maximum rows reached ({max} rows)"
|
2489 |
-
msgstr "已到最大行数 ({
|
2490 |
|
2491 |
#: pro/fields/repeater.php:259
|
2492 |
msgid "Drag to reorder"
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.2.9\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
"POT-Creation-Date: 2015-08-11 23:50+0200\n"
|
6 |
+
"PO-Revision-Date: 2018-03-14 09:58+1000\n"
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Amos Lee <470266798@qq.com>\n"
|
9 |
"Language: zh_CN\n"
|
2486 |
|
2487 |
#: pro/fields/repeater.php:47
|
2488 |
msgid "Maximum rows reached ({max} rows)"
|
2489 |
+
msgstr "已到最大行数 ({max} 行)"
|
2490 |
|
2491 |
#: pro/fields/repeater.php:259
|
2492 |
msgid "Drag to reorder"
|
readme.txt
CHANGED
@@ -66,6 +66,9 @@ From your WordPress dashboard
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
69 |
= 5.6.9 =
|
70 |
* User field: Added new 'Return Format' setting (Array, Object, ID)
|
71 |
* Core: Added basic compatibility with Gutenberg - values now save
|
66 |
|
67 |
== Changelog ==
|
68 |
|
69 |
+
= 5.6.10 =
|
70 |
+
* Core: Minor fixes and improvements
|
71 |
+
|
72 |
= 5.6.9 =
|
73 |
* User field: Added new 'Return Format' setting (Array, Object, ID)
|
74 |
* Core: Added basic compatibility with Gutenberg - values now save
|