diff --git a/acf.php b/acf.php
index 3383e17..f439b0b 100644
--- a/acf.php
+++ b/acf.php
@@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com/
Description: Customise WordPress with powerful, professional and intuitive fields
-Version: 5.4.4
+Version: 5.4.5
Author: Elliot Condon
Author URI: http://www.elliotcondon.com/
Copyright: Elliot Condon
@@ -58,7 +58,7 @@ class acf {
// basic
'name' => __('Advanced Custom Fields', 'acf'),
- 'version' => '5.4.4',
+ 'version' => '5.4.5',
// urls
'basename' => plugin_basename( __FILE__ ),
diff --git a/admin/field-groups.php b/admin/field-groups.php
index 7b35b71..096ac1d 100644
--- a/admin/field-groups.php
+++ b/admin/field-groups.php
@@ -713,6 +713,22 @@ class acf_admin_field_groups {
$('#the-list tr.no-items td').attr('colspan', 4);
+ // search
+ $('.subsubsub').append(' |
');
+
+
+ // events
+ $(document).on('click', '.acf-toggle-search', function( e ){
+
+ // prevent default
+ e.preventDefault();
+
+
+ // toggle
+ $('.search-box').slideToggle();
+
+ });
+
})(jQuery);
post_parent == $post_id) {
+
+ $post_id = (int) $revision->ID;
+
+ }
+
}
@@ -4757,8 +4768,78 @@ function acf_send_ajax_results( $response ) {
// return
wp_send_json( $response );
-}
+}
+
+
+/*
+* acf_is_sequential_array
+*
+* This function will return true if the array contains only numeric keys
+*
+* @source http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential
+* @type function
+* @date 9/09/2016
+* @since 5.4.0
+*
+* @param $array (array)
+* @return (boolean)
+*/
+
+function acf_is_sequential_array( $array ) {
+
+ // bail ealry if not array
+ if( !is_array($array) ) return false;
+
+
+ // loop
+ foreach( $array as $key => $value ) {
+ // bail ealry if is string
+ if( is_string($key) ) return false;
+
+ }
+
+
+ // return
+ return true;
+
+}
+
+
+/*
+* acf_is_associative_array
+*
+* This function will return true if the array contains one or more string keys
+*
+* @source http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential
+* @type function
+* @date 9/09/2016
+* @since 5.4.0
+*
+* @param $array (array)
+* @return (boolean)
+*/
+
+function acf_is_associative_array( $array ) {
+
+ // bail ealry if not array
+ if( !is_array($array) ) return false;
+
+
+ // loop
+ foreach( $array as $key => $value ) {
+
+ // bail ealry if is string
+ if( is_string($key) ) return true;
+
+ }
+
+
+ // return
+ return false;
+
+}
+
add_filter("acf/settings/slug", '_acf_settings_slug');
diff --git a/api/api-template.php b/api/api-template.php
index dbb7bcb..2dd4535 100644
--- a/api/api-template.php
+++ b/api/api-template.php
@@ -994,6 +994,538 @@ function acf_shortcode( $atts )
add_shortcode( 'acf', 'acf_shortcode' );
+
+/*
+* acf_template_form
+*
+* This class contains funcitonality for a template form to work
+*
+* @type function
+* @date 7/09/2016
+* @since 5.4.0
+*
+* @param $post_id (int)
+* @return $post_id (int)
+*/
+
+if( ! class_exists('acf_template_form') ) :
+
+class acf_template_form {
+
+ // vars
+ var $fields;
+
+
+ /*
+ * __construct
+ *
+ * This function will setup the class functionality
+ *
+ * @type function
+ * @date 5/03/2014
+ * @since 5.0.0
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ function __construct() {
+
+ // vars
+ $this->fields = array(
+
+ '_post_title' => array(
+ 'prefix' => 'acf',
+ 'name' => '_post_title',
+ 'key' => '_post_title',
+ 'label' => __('Title', 'acf'),
+ 'type' => 'text',
+ 'required' => true,
+ ),
+
+ '_post_content' => array(
+ 'prefix' => 'acf',
+ 'name' => '_post_content',
+ 'key' => '_post_content',
+ 'label' => __('Content', 'acf'),
+ 'type' => 'wysiwyg',
+ ),
+
+ '_validate_email' => array(
+ 'prefix' => 'acf',
+ 'name' => '_validate_email',
+ 'key' => '_validate_email',
+ 'label' => __('Validate Email', 'acf'),
+ 'type' => 'text',
+ 'value' => '',
+ 'wrapper' => array('style' => 'display:none !important;')
+ )
+
+ );
+
+
+ // actions
+ add_action('acf/validate_save_post', array($this, 'validate_save_post'), 1);
+
+
+ // filters
+ add_filter('acf/pre_save_post', array($this, 'pre_save_post'), 5, 2);
+
+ }
+
+
+ /*
+ * validate_save_post
+ *
+ * This function will validate fields from the above array
+ *
+ * @type function
+ * @date 7/09/2016
+ * @since 5.4.0
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ function validate_save_post() {
+
+ // register field if isset in $_POST
+ foreach( $this->fields as $k => $field ) {
+
+ // bail early if no in $_POST
+ if( !isset($_POST['acf'][ $k ]) ) continue;
+
+
+ // register
+ acf_add_local_field($field);
+
+ }
+
+
+ // honeypot
+ if( !empty($_POST['acf']['_validate_email']) ) {
+
+ acf_add_validation_error( '', __('Spam Detected', 'acf') );
+
+ }
+
+ }
+
+
+ /*
+ * pre_save_post
+ *
+ * description
+ *
+ * @type function
+ * @date 7/09/2016
+ * @since 5.4.0
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ function pre_save_post( $post_id, $form ) {
+
+ // vars
+ $save = array(
+ 'ID' => 0
+ );
+
+
+ // determine save data
+ if( is_numeric($post_id) ) {
+
+ // update post
+ $save['ID'] = $post_id;
+
+ } elseif( $post_id == 'new_post' ) {
+
+ // new post
+ $form['new_post'] = wp_parse_args( $form['new_post'], array(
+ 'post_type' => 'post',
+ 'post_status' => 'draft',
+ ));
+
+
+ // merge in new post data
+ $save = array_merge($save, $form['new_post']);
+
+ } else {
+
+ // not post
+ return $post_id;
+
+ }
+
+
+ // save post_title
+ if( isset($_POST['acf']['_post_title']) ) {
+
+ $save['post_title'] = acf_extract_var($_POST['acf'], '_post_title');
+
+ }
+
+
+ // save post_content
+ if( isset($_POST['acf']['_post_content']) ) {
+
+ $save['post_content'] = acf_extract_var($_POST['acf'], '_post_content');
+
+ }
+
+
+ // honeypot
+ if( !empty($_POST['acf']['_validate_email']) ) return;
+
+
+ // validate
+ if( count($save) == 1 ) {
+
+ return $post_id;
+
+ }
+
+
+ if( $save['ID'] ) {
+
+ wp_update_post( $save );
+
+ } else {
+
+ $post_id = wp_insert_post( $save );
+
+ }
+
+
+ // return
+ return $post_id;
+
+ }
+
+
+ /*
+ * enqueue
+ *
+ * This function will enqueue a form
+ *
+ * @type function
+ * @date 7/09/2016
+ * @since 5.4.0
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ function enqueue_form() {
+
+ // verify nonce
+ if( acf_verify_nonce('acf_form') ) {
+
+ // validate data
+ if( acf_validate_save_post(true) ) {
+
+ // form
+ $GLOBALS['acf_form'] = acf_extract_var($_POST, '_acf_form');
+ $GLOBALS['acf_form'] = @json_decode(base64_decode($GLOBALS['acf_form']), true);
+
+
+ // validate
+ if( empty($GLOBALS['acf_form']) ) return;
+
+
+ // vars
+ $post_id = acf_maybe_get( $GLOBALS['acf_form'], 'post_id', 0 );
+
+
+ // allow for custom save
+ $post_id = apply_filters('acf/pre_save_post', $post_id, $GLOBALS['acf_form']);
+
+
+ // save
+ acf_save_post( $post_id );
+
+
+ // vars
+ $return = acf_maybe_get( $GLOBALS['acf_form'], 'return', '' );
+
+
+ // redirect
+ if( $return ) {
+
+ // update %placeholders%
+ $return = str_replace('%post_url%', get_permalink($post_id), $return);
+
+
+ // redirect
+ wp_redirect( $return );
+ exit;
+ }
+
+ }
+ // if
+
+ }
+ // if
+
+
+ // load acf scripts
+ acf_enqueue_scripts();
+
+ }
+
+
+ /*
+ * render
+ *
+ * description
+ *
+ * @type function
+ * @date 7/09/2016
+ * @since 5.4.0
+ *
+ * @param $post_id (int)
+ * @return $post_id (int)
+ */
+
+ function render_form( $args = array() ) {
+
+ // vars
+ $url = acf_get_current_url();
+
+
+ // defaults
+ $args = wp_parse_args( $args, array(
+ 'id' => 'acf-form',
+ 'post_id' => false,
+ 'new_post' => false,
+ 'field_groups' => false,
+ 'fields' => false,
+ 'post_title' => false,
+ 'post_content' => false,
+ 'form' => true,
+ 'form_attributes' => array(),
+ 'return' => add_query_arg( 'updated', 'true', $url ),
+ 'html_before_fields' => '',
+ 'html_after_fields' => '',
+ 'submit_value' => __("Update", 'acf'),
+ 'updated_message' => __("Post updated", 'acf'),
+ 'label_placement' => 'top',
+ 'instruction_placement' => 'label',
+ 'field_el' => 'div',
+ 'uploader' => 'wp',
+ 'honeypot' => true
+ ));
+
+ $args['form_attributes'] = wp_parse_args( $args['form_attributes'], array(
+ 'id' => 'post',
+ 'class' => '',
+ 'action' => '',
+ 'method' => 'post',
+ ));
+
+
+ // filter post_id
+ $args['post_id'] = acf_get_valid_post_id( $args['post_id'] );
+
+
+ // load values from this post
+ $post_id = $args['post_id'];
+
+
+ // new post?
+ if( $post_id == 'new_post' ) {
+
+ // dont load values
+ $post_id = false;
+
+
+ // new post defaults
+ $args['new_post'] = wp_parse_args( $args['new_post'], array(
+ 'post_type' => 'post',
+ 'post_status' => 'draft',
+ ));
+
+ }
+
+
+ // attributes
+ $args['form_attributes']['class'] .= ' acf-form';
+
+
+ // register local fields
+ foreach( $this->fields as $k => $field ) {
+
+ acf_add_local_field($field);
+
+ }
+
+
+ // vars
+ $field_groups = array();
+ $fields = array();
+
+
+ // post_title
+ if( $args['post_title'] ) {
+
+ // load local field
+ $_post_title = acf_get_field('_post_title');
+ $_post_title['value'] = $post_id ? get_post_field('post_title', $post_id) : '';
+
+
+ // append
+ $fields[] = $_post_title;
+
+ }
+
+
+ // post_content
+ if( $args['post_content'] ) {
+
+ // load local field
+ $_post_content = acf_get_field('_post_content');
+ $_post_content['value'] = $post_id ? get_post_field('post_content', $post_id) : '';
+
+
+ // append
+ $fields[] = $_post_content;
+
+ }
+
+
+ // specific fields
+ if( $args['fields'] ) {
+
+ foreach( $args['fields'] as $selector ) {
+
+ // append field ($strict = false to allow for better compatibility with field names)
+ $fields[] = acf_maybe_get_field( $selector, $post_id, false );
+
+ }
+
+ } elseif( $args['field_groups'] ) {
+
+ foreach( $args['field_groups'] as $selector ) {
+
+ $field_groups[] = acf_get_field_group( $selector );
+
+ }
+
+ } elseif( $args['post_id'] == 'new_post' ) {
+
+ $field_groups = acf_get_field_groups( $args['new_post'] );
+
+ } else {
+
+ $field_groups = acf_get_field_groups(array(
+ 'post_id' => $args['post_id']
+ ));
+
+ }
+
+
+ //load fields based on field groups
+ if( !empty($field_groups) ) {
+
+ foreach( $field_groups as $field_group ) {
+
+ $field_group_fields = acf_get_fields( $field_group );
+
+ if( !empty($field_group_fields) ) {
+
+ foreach( array_keys($field_group_fields) as $i ) {
+
+ $fields[] = acf_extract_var($field_group_fields, $i);
+ }
+
+ }
+
+ }
+
+ }
+
+
+ // honeypot
+ if( $args['honeypot'] ) {
+
+ $fields[] = acf_get_field('_validate_email');
+
+ }
+
+
+ // updated message
+ if( !empty($_GET['updated']) && $args['updated_message'] ) {
+
+ echo '' . $args['updated_message'] . '
';
+
+ }
+
+
+ // uploader (always set incase of multiple forms on the page)
+ acf_update_setting('uploader', $args['uploader']);
+
+
+ // display form
+ if( $args['form'] ): ?>
+
+
+ template_form = new acf_template_form();
+
+endif; // class_exists check
+
+
/*
* acf_form_head()
*
@@ -1009,231 +1541,7 @@ add_shortcode( 'acf', 'acf_shortcode' );
function acf_form_head() {
- // register local fields
- _acf_form_register_fields();
-
-
- // verify nonce
- if( acf_verify_nonce('acf_form') ) {
-
- // add actions
- add_action('acf/validate_save_post', '_acf_form_validate_save_post');
- add_filter('acf/pre_save_post', '_acf_form_pre_save_post', 5, 2);
-
-
- // validate data
- if( acf_validate_save_post(true) ) {
-
- // form
- $GLOBALS['acf_form'] = acf_extract_var($_POST, '_acf_form');
- $GLOBALS['acf_form'] = @json_decode(base64_decode($GLOBALS['acf_form']), true);
-
-
- // validate
- if( empty($GLOBALS['acf_form']) ) return;
-
-
- // vars
- $post_id = acf_maybe_get( $GLOBALS['acf_form'], 'post_id', 0 );
-
-
- // allow for custom save
- $post_id = apply_filters('acf/pre_save_post', $post_id, $GLOBALS['acf_form']);
-
-
- // save
- acf_save_post( $post_id );
-
-
- // vars
- $return = acf_maybe_get( $GLOBALS['acf_form'], 'return', '' );
-
-
- // redirect
- if( $return ) {
-
- // update %placeholders%
- $return = str_replace('%post_url%', get_permalink($post_id), $return);
-
-
- // redirect
- wp_redirect( $return );
- exit;
- }
-
- }
- // if
-
- }
- // if
-
-
- // load acf scripts
- acf_enqueue_scripts();
-
-}
-
-
-/*
-* _acf_form_register_fields
-*
-* This function will register some local fields used by the acf_form function
-*
-* @type function
-* @date 15/08/2016
-* @since 5.4.0
-*
-* @param n/a
-* @return n/a
-*/
-
-function _acf_form_register_fields() {
-
- acf_add_local_field(array(
- 'prefix' => 'acf',
- 'name' => '_post_title',
- 'key' => '_post_title',
- 'label' => __('Title', 'acf'),
- 'type' => 'text',
- 'required' => true,
- ));
-
- acf_add_local_field(array(
- 'prefix' => 'acf',
- 'name' => '_post_content',
- 'key' => '_post_content',
- 'label' => __('Content', 'acf'),
- 'type' => 'wysiwyg',
- ));
-
- acf_add_local_field(array(
- 'prefix' => 'acf',
- 'name' => '_validate_email',
- 'key' => '_validate_email',
- 'label' => __('Validate Email', 'acf'),
- 'type' => 'text',
- 'value' => '',
- 'wrapper' => array(
- 'style' => 'display:none !important;'
- )
- ));
-
-}
-
-
-/*
-* _validate_save_post
-*
-* This function will perfrom extra validation for acf_form
-*
-* @type function
-* @date 16/06/2014
-* @since 5.0.0
-*
-* @param $post_id (int)
-* @return $post_id (int)
-*/
-
-function _acf_form_validate_save_post() {
-
- // honeypot
- if( !empty($_POST['acf']['_validate_email']) ) {
-
- acf_add_validation_error( '', __('Spam Detected', 'acf') );
-
- }
-
-}
-
-
-/*
-* _acf_form_pre_save_post
-*
-* This filter will save post data for the acf_form function
-*
-* @type filter
-* @date 17/01/2014
-* @since 5.0.0
-*
-* @param $post_id (int)
-* @return $post_id (int)
-*/
-
-function _acf_form_pre_save_post( $post_id, $form ) {
-
- // vars
- $save = array(
- 'ID' => 0
- );
-
-
- // determine save data
- if( is_numeric($post_id) ) {
-
- // update post
- $save['ID'] = $post_id;
-
- } elseif( $post_id == 'new_post' ) {
-
- // new post
- $form['new_post'] = wp_parse_args( $form['new_post'], array(
- 'post_type' => 'post',
- 'post_status' => 'draft',
- ));
-
-
- // merge in new post data
- $save = array_merge($save, $form['new_post']);
-
- } else {
-
- // not post
- return $post_id;
-
- }
-
-
- // save post_title
- if( isset($_POST['acf']['_post_title']) ) {
-
- $save['post_title'] = acf_extract_var($_POST['acf'], '_post_title');
-
- }
-
-
- // save post_content
- if( isset($_POST['acf']['_post_content']) ) {
-
- $save['post_content'] = acf_extract_var($_POST['acf'], '_post_content');
-
- }
-
-
- // honeypot
- if( !empty($_POST['acf']['_validate_email']) ) return;
-
-
- // validate
- if( count($save) == 1 ) {
-
- return $post_id;
-
- }
-
-
- if( $save['ID'] ) {
-
- wp_update_post( $save );
-
- } else {
-
- $post_id = wp_insert_post( $save );
-
- }
-
-
- // return
- return $post_id;
+ acf()->template_form->enqueue_form();
}
@@ -1264,223 +1572,8 @@ function _acf_form_pre_save_post( $post_id, $form ) {
function acf_form( $args = array() ) {
- // vars
- $url = acf_get_current_url();
+ acf()->template_form->render_form($args);
-
- // defaults
- $args = wp_parse_args( $args, array(
- 'id' => 'acf-form',
- 'post_id' => false,
- 'new_post' => false,
- 'field_groups' => false,
- 'fields' => false,
- 'post_title' => false,
- 'post_content' => false,
- 'form' => true,
- 'form_attributes' => array(),
- 'return' => add_query_arg( 'updated', 'true', $url ),
- 'html_before_fields' => '',
- 'html_after_fields' => '',
- 'submit_value' => __("Update", 'acf'),
- 'updated_message' => __("Post updated", 'acf'),
- 'label_placement' => 'top',
- 'instruction_placement' => 'label',
- 'field_el' => 'div',
- 'uploader' => 'wp',
- 'honeypot' => true
- ));
-
- $args['form_attributes'] = wp_parse_args( $args['form_attributes'], array(
- 'id' => 'post',
- 'class' => '',
- 'action' => '',
- 'method' => 'post',
- ));
-
-
- // filter post_id
- $args['post_id'] = acf_get_valid_post_id( $args['post_id'] );
-
-
- // load values from this post
- $post_id = $args['post_id'];
-
-
- // new post?
- if( $post_id == 'new_post' ) {
-
- // dont load values
- $post_id = false;
-
-
- // new post defaults
- $args['new_post'] = wp_parse_args( $args['new_post'], array(
- 'post_type' => 'post',
- 'post_status' => 'draft',
- ));
-
- }
-
-
- // attributes
- $args['form_attributes']['class'] .= ' acf-form';
-
-
- // vars
- $field_groups = array();
- $fields = array();
-
-
- // post_title
- if( $args['post_title'] ) {
-
- // load local field
- $_post_title = acf_get_field('_post_title');
- $_post_title['value'] = $post_id ? get_post_field('post_title', $post_id) : '';
-
-
- // append
- $fields[] = $_post_title;
-
- }
-
-
- // post_content
- if( $args['post_content'] ) {
-
- // load local field
- $_post_content = acf_get_field('_post_content');
- $_post_content['value'] = $post_id ? get_post_field('post_content', $post_id) : '';
-
-
- // append
- $fields[] = $_post_content;
-
- }
-
-
- // specific fields
- if( $args['fields'] ) {
-
- foreach( $args['fields'] as $selector ) {
-
- // append field ($strict = false to allow for better compatibility with field names)
- $fields[] = acf_maybe_get_field( $selector, $post_id, false );
-
- }
-
- } elseif( $args['field_groups'] ) {
-
- foreach( $args['field_groups'] as $selector ) {
-
- $field_groups[] = acf_get_field_group( $selector );
-
- }
-
- } elseif( $args['post_id'] == 'new_post' ) {
-
- $field_groups = acf_get_field_groups( $args['new_post'] );
-
- } else {
-
- $field_groups = acf_get_field_groups(array(
- 'post_id' => $args['post_id']
- ));
-
- }
-
-
- //load fields based on field groups
- if( !empty($field_groups) ) {
-
- foreach( $field_groups as $field_group ) {
-
- $field_group_fields = acf_get_fields( $field_group );
-
- if( !empty($field_group_fields) ) {
-
- foreach( array_keys($field_group_fields) as $i ) {
-
- $fields[] = acf_extract_var($field_group_fields, $i);
- }
-
- }
-
- }
-
- }
-
-
- // honeypot
- if( $args['honeypot'] ) {
-
- $fields[] = acf_get_field('_validate_email');
-
- }
-
-
- // updated message
- if( !empty($_GET['updated']) && $args['updated_message'] ) {
-
- echo '' . $args['updated_message'] . '
';
-
- }
-
-
- // uploader (always set incase of multiple forms on the page)
- acf_update_setting('uploader', $args['uploader']);
-
-
- // display form
- if( $args['form'] ): ?>
-
-
- ').html( string ).text();
+ return $('').html( string ).text();
},
diff --git a/assets/js/acf-input.min.js b/assets/js/acf-input.min.js
index d15cdb7..434a7ac 100644
--- a/assets/js/acf-input.min.js
+++ b/assets/js/acf-input.min.js
@@ -1,3 +1,3 @@
-!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;s>n;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]:!1;var n=0,s=a.length;if("filters"===e)for(;s>n;n++)i[0]=a[n].callback.apply(a[n].context,i);else for(;s>n;n++)a[n].callback.apply(a[n].context,i);return"filters"===e?i[0]:!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"undefined"!=typeof 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;t>i;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 t!==!1&&t.each(function(){$(this).is(a)&&(n=n.add($(this)))}),i||(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():!1},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){return"undefined"==typeof t?e.data():e.data(t)},get_uniqid:function(e,t){"undefined"==typeof e&&(e="");var i,a=function(e,t){return e=parseInt(e,10).toString(16),te.length?Array(1+(t-e.length)).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(e){var t={},i={};return $selector=e.find("select, textarea, input"),$.each($selector.serializeArray(),function(e,a){"[]"===a.name.slice(-2)&&(a.name=a.name.replace("[]",""),"undefined"==typeof i[a.name]&&(i[a.name]=-1),i[a.name]++,a.name+="["+i[a.name]+"]"),t[a.name]=a.value}),t},serialize:function(e){return this.serialize_form(e)},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(' | '),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0,e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap(''),e.animate({opacity:0},250),e.parent(".acf-temp-wrap").animate({height:i},250,function(){$(this).remove(),"function"==typeof t&&t()})},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 #acf-popup"),$popup.exists())return update_popup(e);var t=['"].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):!1},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){return e.nonce=acf.get("nonce"),e=acf.apply_filters("prepare_for_ajax",e)},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(),n=a+$(window).height();return n>=i&&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","č":"c","ď":"d","è":"e","é":"e","ě":"e","ë":"e","í":"i","ĺ":"l","ľ":"l","ň":"n","ø":"o","ó":"o","ô":"o","ő":"o","ö":"o","ŕ":"r","š":"s","ť":"t","ú":"u","ů":"u","ű":"u","ü":"u","ý":"y","ř":"r","ž":"z"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""};for(e=e.toLowerCase(),i=0;i'),e.append(n))),n.append('"),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e,t){t=t||"data-id",find=e.attr(t),replace=acf.get_uniqid(),acf.do_action("before_duplicate",e);var i=e.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),"undefined"!=typeof find&&(i.attr(t,replace),i.find('[id*="'+find+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(find,replace))}),i.find('[name*="'+find+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(find,replace))}),i.find('label[for*="'+find+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(find,replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",e,i),e.after(i),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("").html(e).text()},parse_args:function(e,t){return $.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.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1);$(document).on(a,n,function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,[e])})},get:function(e,t){return t=t||null,"undefined"!=typeof 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){e.$el=$(this),e.$field=acf.get_closest_field(e.$el,i.type),i.set("$field",e.$field),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({active:0,actions:{refresh:"refresh"},refresh:function(e){e=e||!1,e&&e.is(".acf-fields")&&(e=e.parent()),$(".acf-fields:visible",e).each(function(){var e=$(),t=0,i=0,a=-1,n=$(this).children(".acf-field[data-width]:visible");n.exists()&&(n.removeClass("acf-r0 acf-c0").css({"min-height":0}),n.each(function(n){var s=$(this),o=s.position().top;0==n&&(t=o),o!=t&&(e.css({"min-height":i+1+"px"}),e=$(),t=s.position().top,i=0,a=-1),a++,i=s.outerHeight()>i?s.outerHeight():i,e=e.add(s),0==o?s.addClass("acf-r0"):0==a&&s.addClass("acf-c0")}),e.exists()&&e.css({"min-height":i+1+"px"}))})}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){$('#acf-form-data input[name="_acfchanged"]').exists()&&$('#acf-form-data input[name="_acfchanged"]').val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{change:"on",submit:"off"},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){!this.changed&&this.active&&(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({$el:null,events:{"mouseenter .acf-js-tooltip":"on","mouseleave .acf-js-tooltip":"off"},on:function(e){var t=e.$el.attr("title");if(t){this.$el=$(''+t+"
"),$("body").append(this.$el);var i=10;target_w=e.$el.outerWidth(),target_h=e.$el.outerHeight(),target_t=e.$el.offset().top,target_l=e.$el.offset().left,tooltip_w=this.$el.outerWidth(),tooltip_h=this.$el.outerHeight();var a=target_t-tooltip_h,n=target_l+target_w/2-tooltip_w/2;i>n?(this.$el.addClass("right"),n=target_l+target_w,a=target_t+target_h/2-tooltip_h/2):n+tooltip_w+i>$(window).width()?(this.$el.addClass("left"),n=target_l-tooltip_w,a=target_t+target_h/2-tooltip_h/2):a-$(window).scrollTop()')}}),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(' | '))}),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")})}(jQuery),function($){acf.ajax=acf.model.extend({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 .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"))},fetch:function(){if(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.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"change"},change:function(e){var t=e.$el.closest("ul"),i=t.find("input[name]"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a);if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}}})}(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($){acf.conditional_logic=acf.model.extend({actions:{"prepare 20":"render","append 20":"render"},events:{"change .acf-field input":"change","change .acf-field textarea":"change","change .acf-field select":"change"},items:{},triggers:{},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n],o=s.field,r=this.triggers[o]||{};r[e]=e,this.triggers[o]=r}}this.items[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.render_fields(t),acf.do_action("refresh",e)},change:function(e){var t=e.$el,i=acf.get_field_wrap(t),a=i.data("key");if("undefined"==typeof this.triggers[a])return!1;$parent=i.parent();for(var n in this.triggers[a]){var s=this.triggers[a][n],o=acf.get_fields(s,$parent,!0);this.render_fields(o)}acf.do_action("refresh",$parent)},render_fields:function(e){var t=this;e.each(function(){t.render_field($(this))})},render_field:function(e){var t=e.data("key");if("undefined"==typeof this.items[t])return!1;var i=!1,a=this.items[t];for(var n in a){var s=a[n],o=!0;for(var r in s){var l=s[r],c=this.get_trigger(e,l.field);if(!this.calculate(l,c,e)){o=!1;break}}if(o){i=!0;break}}i?this.show_field(e):this.hide_field(e)},show_field:function(e){e.removeClass("hidden-by-conditional-logic"),e.find(".acf-clhi").not(".hidden-by-conditional-logic .acf-clhi").removeClass("acf-clhi").prop("disabled",!1),acf.do_action("show_field",e,"conditional_logic")},hide_field:function(e){e.addClass("hidden-by-conditional-logic"),e.find("input, textarea, select").not(".acf-disabled").addClass("acf-clhi").prop("disabled",!0),acf.do_action("hide_field",e,"conditional_logic")},get_trigger:function(e,t){var i=acf.get_selector(t),a=e.siblings(i);if(!a.exists()){var n=acf.get_selector();e.parents(n).each(function(){return a=$(this).siblings(i),a.exists()?!1:void 0})}return a.exists()?a:!1},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?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}})}(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&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('')},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(){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)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},filters:{date_time_picker_args:"customize_onClose",time_picker_args:"customize_onClose"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('')},destroy:function(e){},customize_onClose:function(e){return e.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"),!e)return;acf.val(t.input,e)}},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)},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:"",filesize:"",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.filesize);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(){return(t=acf.get_field(s,$(this)))?t.find(".acf-file-uploader.has-value").exists()?void(t=!1):!1:void 0}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)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)},change:function(e){this.$input.val(e.$el.val())}})}(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.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status?!0:"loading"==this.status?!1: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,a=this.$search;a.val(this.$el.find(".input-address").val());var n=acf.apply_filters("google_map_args",{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],n),acf.isset(window,"google","maps","places","Autocomplete")){var s=new google.maps.places.Autocomplete(this.$search[0]);s.bindTo("bounds",this.map),google.maps.event.addListener(s,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=s}var o=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(o),this.map.$el=i,this.map.$field=t;var r=i.find(".input-lat").val(),l=i.find(".input-lng").val();r&&l&&this.update(r,l).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()}),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");
+!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;s>n;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]:!1;var n=0,s=a.length;if("filters"===e)for(;s>n;n++)i[0]=a[n].callback.apply(a[n].context,i);else for(;s>n;n++)a[n].callback.apply(a[n].context,i);return"filters"===e?i[0]:!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"undefined"!=typeof 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;t>i;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 t!==!1&&t.each(function(){$(this).is(a)&&(n=n.add($(this)))}),i||(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():!1},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){return"undefined"==typeof t?e.data():e.data(t)},get_uniqid:function(e,t){"undefined"==typeof e&&(e="");var i,a=function(e,t){return e=parseInt(e,10).toString(16),te.length?Array(1+(t-e.length)).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(e){var t={},i={};return $selector=e.find("select, textarea, input"),$.each($selector.serializeArray(),function(e,a){"[]"===a.name.slice(-2)&&(a.name=a.name.replace("[]",""),"undefined"==typeof i[a.name]&&(i[a.name]=-1),i[a.name]++,a.name+="["+i[a.name]+"]"),t[a.name]=a.value}),t},serialize:function(e){return this.serialize_form(e)},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(' | '),e.children("td").animate({height:0},250,function(){e.remove(),"function"==typeof t&&t()})},250)},remove_el:function(e,t,i){i=i||0,e.css({height:e.height(),width:e.width(),position:"absolute"}),e.wrap(''),e.animate({opacity:0},250),e.parent(".acf-temp-wrap").animate({height:i},250,function(){$(this).remove(),"function"==typeof t&&t()})},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 #acf-popup"),$popup.exists())return update_popup(e);var t=['"].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):!1},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){return e.nonce=acf.get("nonce"),e=acf.apply_filters("prepare_for_ajax",e)},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(),n=a+$(window).height();return n>=i&&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","č":"c","ď":"d","è":"e","é":"e","ě":"e","ë":"e","í":"i","ĺ":"l","ľ":"l","ň":"n","ø":"o","ó":"o","ô":"o","ő":"o","ö":"o","ŕ":"r","š":"s","ť":"t","ú":"u","ů":"u","ű":"u","ü":"u","ý":"y","ř":"r","ž":"z"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""};for(e=e.toLowerCase(),i=0;i'),e.append(n))),n.append('"),i==a.value&&e.prop("selectedIndex",t)})},duplicate:function(e,t){t=t||"data-id",find=e.attr(t),replace=acf.get_uniqid(),acf.do_action("before_duplicate",e);var i=e.clone();return i.removeClass("acf-clone"),acf.do_action("remove",i),"undefined"!=typeof find&&(i.attr(t,replace),i.find('[id*="'+find+'"]').each(function(){$(this).attr("id",$(this).attr("id").replace(find,replace))}),i.find('[name*="'+find+'"]').each(function(){$(this).attr("name",$(this).attr("name").replace(find,replace))}),i.find('label[for*="'+find+'"]').each(function(){$(this).attr("for",$(this).attr("for").replace(find,replace))})),i.find(".ui-sortable").removeClass("ui-sortable"),acf.do_action("after_duplicate",e,i),e.after(i),setTimeout(function(){acf.do_action("append",i)},1),i},decode:function(e){return $("").html(e).text()},parse_args:function(e,t){return $.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.substr(0,e.indexOf(" ")),n=e.substr(e.indexOf(" ")+1);$(document).on(a,n,function(e){e.$el=$(this),"function"==typeof i.event&&(e=i.event(e)),i[t].apply(i,[e])})},get:function(e,t){return t=t||null,"undefined"!=typeof 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){e.$el=$(this),e.$field=acf.get_closest_field(e.$el,i.type),i.set("$field",e.$field),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({active:0,actions:{refresh:"refresh"},refresh:function(e){e=e||!1,e&&e.is(".acf-fields")&&(e=e.parent()),$(".acf-fields:visible",e).each(function(){var e=$(),t=0,i=0,a=-1,n=$(this).children(".acf-field[data-width]:visible");n.exists()&&(n.removeClass("acf-r0 acf-c0").css({"min-height":0}),n.each(function(n){var s=$(this),o=s.position().top;0==n&&(t=o),o!=t&&(e.css({"min-height":i+1+"px"}),e=$(),t=s.position().top,i=0,a=-1),a++,i=s.outerHeight()>i?s.outerHeight():i,e=e.add(s),0==o?s.addClass("acf-r0"):0==a&&s.addClass("acf-c0")}),e.exists()&&e.css({"min-height":i+1+"px"}))})}}),$(document).on("change",".acf-field input, .acf-field textarea, .acf-field select",function(){$('#acf-form-data input[name="_acfchanged"]').exists()&&$('#acf-form-data input[name="_acfchanged"]').val(1),acf.do_action("change",$(this))}),$(document).on("click",'.acf-field a[href="#"]',function(e){e.preventDefault()}),acf.unload=acf.model.extend({active:1,changed:0,filters:{validation_complete:"validation_complete"},actions:{change:"on",submit:"off"},events:{"submit form":"off"},validation_complete:function(e,t){return e&&e.errors&&this.on(),e},on:function(){!this.changed&&this.active&&(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({$el:null,events:{"mouseenter .acf-js-tooltip":"on","mouseleave .acf-js-tooltip":"off"},on:function(e){var t=e.$el.attr("title");if(t){this.$el=$(''+t+"
"),$("body").append(this.$el);var i=10;target_w=e.$el.outerWidth(),target_h=e.$el.outerHeight(),target_t=e.$el.offset().top,target_l=e.$el.offset().left,tooltip_w=this.$el.outerWidth(),tooltip_h=this.$el.outerHeight();var a=target_t-tooltip_h,n=target_l+target_w/2-tooltip_w/2;i>n?(this.$el.addClass("right"),n=target_l+target_w,a=target_t+target_h/2-tooltip_h/2):n+tooltip_w+i>$(window).width()?(this.$el.addClass("left"),n=target_l-tooltip_w,a=target_t+target_h/2-tooltip_h/2):a-$(window).scrollTop()')}}),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(' | '))}),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")})}(jQuery),function($){acf.ajax=acf.model.extend({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 .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"))},fetch:function(){if(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.checkbox=acf.field.extend({type:"checkbox",events:{"change input":"change"},change:function(e){var t=e.$el.closest("ul"),i=t.find("input[name]"),a=e.$el.is(":checked");if(e.$el.hasClass("acf-checkbox-toggle"))return void i.prop("checked",a);if(t.find(".acf-checkbox-toggle").exists()){var a=0==i.not(":checked").length;t.find(".acf-checkbox-toggle").prop("checked",a)}}})}(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($){acf.conditional_logic=acf.model.extend({actions:{"prepare 20":"render","append 20":"render"},events:{"change .acf-field input":"change","change .acf-field textarea":"change","change .acf-field select":"change"},items:{},triggers:{},add:function(e,t){for(var i in t){var a=t[i];for(var n in a){var s=a[n],o=s.field,r=this.triggers[o]||{};r[e]=e,this.triggers[o]=r}}this.items[e]=t},render:function(e){e=e||!1;var t=acf.get_fields("",e,!0);this.render_fields(t),acf.do_action("refresh",e)},change:function(e){var t=e.$el,i=acf.get_field_wrap(t),a=i.data("key");if("undefined"==typeof this.triggers[a])return!1;$parent=i.parent();for(var n in this.triggers[a]){var s=this.triggers[a][n],o=acf.get_fields(s,$parent,!0);this.render_fields(o)}acf.do_action("refresh",$parent)},render_fields:function(e){var t=this;e.each(function(){t.render_field($(this))})},render_field:function(e){var t=e.data("key");if("undefined"==typeof this.items[t])return!1;var i=!1,a=this.items[t];for(var n in a){var s=a[n],o=!0;for(var r in s){var l=s[r],c=this.get_trigger(e,l.field);if(!this.calculate(l,c,e)){o=!1;break}}if(o){i=!0;break}}i?this.show_field(e):this.hide_field(e)},show_field:function(e){e.removeClass("hidden-by-conditional-logic"),e.find(".acf-clhi").not(".hidden-by-conditional-logic .acf-clhi").removeClass("acf-clhi").prop("disabled",!1),acf.do_action("show_field",e,"conditional_logic")},hide_field:function(e){e.addClass("hidden-by-conditional-logic"),e.find("input, textarea, select").not(".acf-disabled").addClass("acf-clhi").prop("disabled",!0),acf.do_action("hide_field",e,"conditional_logic")},get_trigger:function(e,t){var i=acf.get_selector(t),a=e.siblings(i);if(!a.exists()){var n=acf.get_selector();e.parents(n).each(function(){return a=$(this).siblings(i),a.exists()?!1:void 0})}return a.exists()?a:!1},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?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}})}(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&&(l10n.isRTL=t,$.datepicker.regional[e]=l10n,$.datepicker.setDefaults(l10n))},init:function(e,t){t=t||{},e.datepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('')},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(){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)},blur:function(){this.$input.val()||this.$hidden.val("")}})}(jQuery),function($){acf.datetimepicker=acf.model.extend({actions:{"ready 1":"ready"},filters:{date_time_picker_args:"customize_onClose",time_picker_args:"customize_onClose"},ready:function(){var e=acf.get("locale"),t=acf.get("rtl");l10n=acf._e("date_time_picker"),l10n&&(l10n.isRTL=t,$.timepicker.regional[e]=l10n,$.timepicker.setDefaults(l10n))},init:function(e,t){t=t||{},e.datetimepicker(t),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('')},destroy:function(e){},customize_onClose:function(e){return e.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"),!e)return;acf.val(t.input,e)}},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)},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:"",filesize:"",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.filesize);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(){return(t=acf.get_field(s,$(this)))?t.find(".acf-file-uploader.has-value").exists()?void(t=!1):!1:void 0}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)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)},change:function(e){this.$input.val(e.$el.val())}})}(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.maps[this.o.id]&&(this.map=this.maps[this.o.id])},is_ready:function(){var e=this;return"ready"==this.status?!0:"loading"==this.status?!1: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,a=this.$search;a.val(this.$el.find(".input-address").val());var n=acf.apply_filters("google_map_args",{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],n),acf.isset(window,"google","maps","places","Autocomplete")){var s=new google.maps.places.Autocomplete(this.$search[0]);s.bindTo("bounds",this.map),google.maps.event.addListener(s,"place_changed",function(t){var i=this.getPlace();e.search(i)}),this.map.autocomplete=s}var o=acf.apply_filters("google_map_marker_args",{draggable:!0,raiseOnDrag:!0,map:this.map},this.$field);this.map.marker=new google.maps.Marker(o),this.map.$el=i,this.map.$field=t;var r=i.find(".input-lat").val(),l=i.find(".input-lng").val();r&&l&&this.update(r,l).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()}),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(){return this.is_ready()?(google.maps.event.trigger(this.map,"resize"),void this.center()):!1},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;return navigator.geolocation?(this.$el.addClass("-loading"),void navigator.geolocation.getCurrentPosition(function(e){t.$el.removeClass("-loading");var i=e.coords.latitude,a=e.coords.longitude;t.update(i,a).sync().center()})):(alert(acf._e("google_map","browser_support")),this)},_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){var t=this.$search.val();t?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(){return(t=acf.get_field(s,$(this)))?t.find(".acf-image-uploader.has-value").exists()?void(t=!1):!1:void 0}),!t){if(o=acf.fields.repeater.doFocus(i).add(),!o)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){this.$input.val(e.$el.val())}})}(jQuery),function($){acf.media=acf.model.extend({frames:[],mime_types:{},actions:{ready:"ready"},frame:function(){var e=this.frames.length-1;return 0>e?!1: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(o){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 r=t.mime_types.split(" ").join("").split(".").join("").split(",");$.each(r,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(''+acf._e("image","uploadedTo")+""),$.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=acf.media.frame(),a=acf.maybe_get(this,"model.attributes.acf_errors"),n=this.controller.$el.find(".media-frame-content .media-sidebar");if(n.children(".acf-selection-error").remove(),n.children().removeClass("acf-hidden"),i&&a){var s=acf.maybe_get(this,"model.attributes.filename","");n.children().addClass("acf-hidden"),n.prepend(['',''+acf._e("restricted")+"",''+s+"",''+a+"","
"].join(""))}e.prototype.toggleSelection.apply(this,arguments)},select:function(t,i){var a=acf.media.frame(),n=this.controller.state(),s=n.get("selection"),o=acf.maybe_get(this,"model.attributes.acf_errors");return a&&o?s.remove(t):e.prototype.select.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:$("").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({render:function(){var t=this;return this.ignore_render?this:(setTimeout(function(){var e=t.$el.closest(".media-modal");if(!e.find(".media-frame-router .acf-expand-details").exists()){var i=$(['',''+acf._e("expand_details")+"",''+acf._e("collapse_details")+"",""].join(""));i.on("click",function(t){t.preventDefault(),e.hasClass("acf-expanded")?e.removeClass("acf-expanded"):e.addClass("acf-expanded")}),e.find(".media-frame-router").append(i)}},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_form(this.$el);this.ignore_render=!0,this.model.saveCompat(t)}})}})}(jQuery),function($){acf.fields.oembed={search:function(e){var t=e.find('[data-name="search-input"]').val();"http"!=t.substr(0,4)&&(t="http://"+t,e.find('[data-name="search-input"]').val(t)),e.addClass("is-loading");var i={action:"acf/fields/oembed/search",nonce:acf.get("nonce"),s:t,width:acf.get_data(e,"width"),height:acf.get_data(e,"height")};e.data("xhr")&&e.data("xhr").abort();var a=$.ajax({url:acf.get("ajaxurl"),data:i,type:"post",dataType:"html",success:function(i){e.removeClass("is-loading"),acf.fields.oembed.search_success(e,t,i),i||acf.fields.oembed.search_error(e)}});e.data("xhr",a)},search_success:function(e,t,i){e.removeClass("has-error").addClass("has-value"),e.find('[data-name="value-input"]').val(t),e.find('[data-name="value-title"]').html(t),e.find('[data-name="value-embed"]').html(i)},search_error:function(e){e.removeClass("has-value").addClass("has-error")},clear:function(e){e.removeClass("has-error has-value"),e.find('[data-name="search-input"]').val(""),e.find('[data-name="value-input"]').val(""),e.find('[data-name="value-title"]').html(""),e.find('[data-name="value-embed"]').html("")},edit:function(e){e.addClass("is-editing");var t=e.find('[data-name="value-title"]').text();e.find('[data-name="search-input"]').val(t).focus()},blur:function(e){e.removeClass("is-editing");var t=e.find('[data-name="value-title"]').text(),i=e.find('[data-name="search-input"]').val(),a=e.find('[data-name="value-embed"]').html();return i?void(i!=t&&this.search(e)):void this.clear(e)}},$(document).on("click",'.acf-oembed [data-name="search-button"]',function(e){e.preventDefault(),acf.fields.oembed.search($(this).closest(".acf-oembed")),$(this).blur()}),$(document).on("click",'.acf-oembed [data-name="clear-button"]',function(e){e.preventDefault(),acf.fields.oembed.clear($(this).closest(".acf-oembed")),$(this).blur()}),$(document).on("click",'.acf-oembed [data-name="value-title"]',function(e){e.preventDefault(),acf.fields.oembed.edit($(this).closest(".acf-oembed"))}),$(document).on("keypress",'.acf-oembed [data-name="search-input"]',function(e){13==e.which&&e.preventDefault()}),$(document).on("keyup",'.acf-oembed [data-name="search-input"]',function(e){$(this).val()&&e.which&&acf.fields.oembed.search($(this).closest(".acf-oembed"))}),$(document).on("blur",'.acf-oembed [data-name="search-input"]',function(e){acf.fields.oembed.blur($(this).closest(".acf-oembed"))})}(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.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.find(".acf-hidden input"),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(' '+acf._e("relationship","loading")+"
");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(""+acf._e("relationship","empty")+"
"));var t=$(this.walker(e.results));if(this.$values.find(".acf-rel-item").each(function(){t.find('.acf-rel-item[data-id="'+$(this).data("id")+'"]').addClass("disabled")}),this.o.s){var i=this.o.s;t.find(".acf-rel-item").each(function(){var e=$(this).text(),t=e.replace(new RegExp("("+i+")","gi"),"$1");$(this).html($(this).html().replace(e,t))})}this.$choices.children(".list").append(t);var a="",n=null;this.$choices.find(".acf-rel-label").each(function(){return $(this).text()==a?(n.append($(this).siblings("ul").html()),void $(this).parent().remove()):(a=$(this).text(),void(n=$(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+=''+e.text+'',t+=this.walker(e.children),t+="
"):t+=''+e.text+"");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=["",'',''+e.$el.html(),'',"",""].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($){acf.select2=acf.model.extend({version:0,actions:{"ready 1":"ready"},ready:function(){acf.maybe_get(window,"Select2")?(this.version=3,this.l10n_v3()):acf.maybe_get(window,"jQuery.fn.select2.amd")&&(this.version=4)},l10n_v3: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)}},init:function(e,t){return this.version?(t=$.extend({allow_null:!1,placeholder:"",multiple:!1,ajax:!1,ajax_action:""},t),3==this.version?this.init_v3(e,t):4==this.version?this.init_v4(e,t):!1):void 0},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(e){return e?($.each(e,function(t,i){e[t].text=acf.decode(i.text),"undefined"!=typeof i.children&&(e[t].children=acf.select2.decode_data(i.children))}),e):[]},count_data:function(e){var t=0;return e?($.each(e,function(e,i){t++,"undefined"!=typeof i.children&&(t+=i.children.length)}),t):t},get_ajax_data:function(e,t){var i=acf.prepare_for_ajax({action:e.ajax_action,field_key:e.key,post_id:acf.get("post_id"),s:t.term,paged:t.page});return i=acf.apply_filters("select2_ajax_data",i,e,t)},get_ajax_results:function(e,t){var i={results:[]};return e||(e=i),"undefined"==typeof 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()})}),t):t},init_v3:function(e,t){var i=e.siblings("input");if(i.exists()){var a={width:"100%",containerCssClass:"-acf",allowClear:t.allow_null,placeholder:t.placeholder,multiple:t.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+=' '+e.description+""),n}},n=this.get_value(e);if(t.multiple){var s=e.attr("name");a.formatSelection=function(e,t){return t.parent().append(''),e.text}}else n=acf.maybe_get(n,0,"");t.allow_null&&e.find('option[value=""]').remove(),a.data=this.get_data(e),a.initSelection=function(e,t){t(n)},t.ajax&&(a.ajax={url:acf.get("ajaxurl"),dataType:"json",type:"post",cache:!1,quietMillis:250,data:function(e,i){var a={term:e,page:i};return acf.select2.get_ajax_data(t,a)},results:function(e,t){var i={page:t};return setTimeout(function(){acf.select2.merge_results_v3()},1),acf.select2.get_ajax_results(e,i)}}),a.dropdownCss={"z-index":"999999999"},a.acf=t,a=acf.apply_filters("select2_args",a,e,t),i.select2(a);var o=i.select2("container");o.before(e),o.before(i),t.multiple&&o.find("ul.select2-choices").sortable({start:function(){i.select2("onSortStart")},stop:function(){i.select2("onSortEnd")}}),e.prop("disabled",!0).addClass("acf-disabled acf-hidden"),i.on("change",function(t){t.added&&e.append('"),e.val(t.val)})}},merge_results_v3: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");return i.text()==e?(t.append(a.children()),void $(this).remove()):(e=i.text(),void(t=a))})},init_v4:function(e,t){var i=e.siblings("input");if(i.exists()){var a={width:"100%",allowClear:t.allow_null,placeholder:t.placeholder,multiple:t.multiple,separator:"||",data:[],escapeMarkup:function(e){return e}},n=this.get_value(e);t.multiple||(n=acf.maybe_get(n,0,"")),t.allow_null&&e.find('option[value=""]').remove(),a.data=this.get_data(e),t.ajax?a.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:function(e){return acf.select2.get_ajax_data(t,e)},processResults:function(e,t){var i=acf.select2.get_ajax_results(e,t);return i.more&&(i.pagination={more:!0}),setTimeout(function(){acf.select2.merge_results_v4()},1),i}}:(e.removeData("ajax"),e.removeAttr("data-ajax")),a=acf.apply_filters("select2_args",a,e,t);var s=e.select2(a);s.addClass("-acf")}},merge_results_v4:function(){var e=null,t=null;$('.select2-results__option[role="group"]').each(function(){var i=$(this).children("ul"),a=$(this).children("strong");return null!==t&&a.text()==t.text()?(e.append(i.children()),void $(this).remove()):(e=i,void(t=a))})},destroy:function(e){e.siblings(".select2-container").remove(),e.siblings("input").show(),e.prop("disabled",!1).removeClass("acf-disabled acf-hidden")}}),acf.add_select2=function(e,t){acf.select2.init(e,t)},acf.remove_select2=function(e){acf.select2.destroy(e)},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(){return this.$select.exists()&&this.o.ui?void acf.select2.init(this.$select,this.o):!1},remove:function(){return this.$select.exists()&&this.o.ui?void acf.select2.destroy(this.$select):!1}}),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($){acf.fields.tab=acf.field.extend({type:"tab",$el:null,$wrap:null,actions:{prepare:"initialize",append:"initialize",hide:"hide",show:"show"},focus:function(){this.$el=this.$field.find(".acf-tab"),this.o=this.$el.data(),this.o.key=this.$field.data("key"),this.o.text=this.$el.text()},initialize:function(){this.$field.is("td")||e.add_tab(this.$field,this.o)},hide:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.addClass("hidden-by-conditional-logic"),setTimeout(function(){e.nextUntil(".acf-field-tab",".acf-field").each(function(){$(this).hasClass("hidden-by-conditional-logic")||(acf.conditional_logic.hide_field($(this)),$(this).addClass("-hbcl-"+i))}),s.hasClass("active")&&a.find("li:not(.hidden-by-conditional-logic):first a").trigger("click")},0))}},show:function(e,t){if("conditional_logic"==t){var i=e.data("key"),a=e.prevAll(".acf-tab-wrap"),n=a.find('a[data-key="'+i+'"]'),s=n.parent();a.exists()&&(s.removeClass("hidden-by-conditional-logic"),setTimeout(function(){e.siblings(".acf-field.-hbcl-"+i).each(function(){acf.conditional_logic.show_field($(this)),$(this).removeClass("-hbcl-"+i)});var t=s.siblings(".active");t.exists()&&!t.hasClass("hidden-by-conditional-logic")||n.trigger("click")},0))}}});var e=acf.model.extend({actions:{"prepare 15":"render","append 15":"render","refresh 15":"render"},events:{"click .acf-tab-button":"_click"},render:function(e){$(".acf-tab-wrap",e).each(function(){var e=$(this),t=e.parent();if(e.find("li.active").exists()||e.find("li:not(.hidden-by-conditional-logic):first a").trigger("click"),t.hasClass("-sidebar")){var i=t.is("td")?"height":"min-height",a=e.position().top+e.children("ul").outerHeight(!0)-1;t.css(i,a)}})},add_group:function(e,t){var i=e.parent(),a="";return i.hasClass("acf-fields")&&"left"==t.placement?i.addClass("-sidebar"):t.placement="top",a=i.is("tbody")?' |
':'',$group=$(a),e.before($group),$group},add_tab:function(e,t){var i=e.siblings(".acf-tab-wrap").last();i.exists()?t.endpoint&&(i=this.add_group(e,t)):i=this.add_group(e,t);var a=$(''+t.text+"");""===t.text&&a.hide(),i.find("ul").append(a),e.hasClass("hidden-by-conditional-logic")&&a.addClass("hidden-by-conditional-logic")},_click:function(e){e.preventDefault();var t=this,i=e.$el,a=i.closest(".acf-tab-wrap"),n=i.data("key"),s="";i.parent().addClass("active").siblings().removeClass("active"),a.nextUntil(".acf-tab-wrap",".acf-field").each(function(){var e=$(this);return"tab"==e.data("type")&&(s=e.data("key"),e.hasClass("endpoint"))?!1:void(s===n?e.hasClass("hidden-by-tab")&&(e.removeClass("hidden-by-tab"),acf.do_action("show_field",$(this),"tab")):e.hasClass("hidden-by-tab")||(e.addClass("hidden-by-tab"),acf.do_action("hide_field",$(this),"tab")))}),acf.do_action("refresh",a.parent()),i.trigger("blur")}}),t=acf.model.extend({active:1,actions:{add_field_error:"add_field_error"},add_field_error:function(e){if(this.active&&e.hasClass("hidden-by-tab")){var t=this,i=e.prevAll(".acf-field-tab:first"),a=e.prevAll(".acf-tab-wrap:first");a.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(){var e={timeFormat:this.o.time_format,altField:this.$hidden,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0};e=acf.apply_filters("time_picker_args",e,this.$field),this.$input.addClass("active").timepicker(e),$("body > #ui-datepicker-div").exists()&&$("body > #ui-datepicker-div").wrap('')},blur:function(){this.$input.val()||this.$hidden.val("")}})}(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),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");return e.exists()?void acf.select2.destroy(e):!1},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=$(['',"",""].join(""));if(e.term_parent){var o=a.find('li[data-id="'+e.term_parent+'"]');a=o.children("ul"),a.exists()||(a=$(''),o.append(a))}a.append(s)}}),$("#acf-popup #term_parent").each(function(){var t=$('");e.term_parent?$(this).children('option[value="'+e.term_parent+'"]').after(t):$(this).append(t)}),this.o.type){case"select":this.$el.children("input").select2("data",t);break;case"multi_select":var i=this.$el.children("input"),a=i.select2("data")||[];a.push(t),i.select2("data",a);break;case"checkbox":case"radio":var n=this.$el.find(".categorychecklist-holder"),s=n.find('li[data-id="'+e.term_id+'"]'),o=n.get(0).scrollTop+(s.offset().top-n.offset().top);s.find("input").prop("checked",!0),n.animate({scrollTop:o},"250")}}})}(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){e.find(".acf-field input").filter('[type="number"], [type="email"], [type="url"]').on("invalid",function(e){e.preventDefault(),acf.validation.errors.push({input:$(this).attr("name"),message:e.target.validationMessage}),acf.validation.fetch($(this).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){this.ignore=1,this.$trigger=e.$el},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");return t.exists()&&t.val()?(this.toggle(e.$el,"unlock"),!0):(e.preventDefault(),void 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,i=acf.serialize_form(e);i.action="acf/validate_save_post",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||t.valid||!t.errors)return void(this.valid=!0);this.valid=!1,this.$trigger=null;var i=null,a=0,n=acf._e("validation_failed");if(t.errors&&t.errors.length>0){for(var s in t.errors){var o=t.errors[s];if(o.input){var r=e.find('[name="'+o.input+'"]').first();if(r.exists()||(r=e.find('[name^="'+o.input+'"]').first()),r.exists()){a++;var l=acf.get_field_wrap(r);this.add_error(l,o.message),null===i&&(i=l)}}else n+=". "+o.message}1==a?n+=". "+acf._e("validation_failed_1"):a>1&&(n+=". "+acf._e("validation_failed_2").replace("%d",a))}var c=e.children(".acf-error-message");c.exists()||(c=$(''),e.prepend(c)),c.children("p").html(n),null===i&&(i=c),setTimeout(function(){$("html, body").animate({scrollTop:i.offset().top-$(window).height()/2},500)},1)},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('"));var a=function(){i.remove_error(e),e.off("focus change","input, textarea, select",a)};e.on("focus change","input, textarea, select",a),acf.do_action("add_field_error",e)},remove_error:function(e){$message=e.children(".acf-input").children("."+this.message_class),e.removeClass(this.error_class),setTimeout(function(){acf.remove_el($message)},250),acf.do_action("remove_field_error",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:{},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),this.o.id=this.$textarea.attr("id")},initialize:function(){if("undefined"!=typeof tinyMCEPreInit){var e=this.o.id,t=acf.get_uniqid("acf-editor-"),i=this.$el.outerHTML();i=acf.str_replace(e,t,i),this.$el.replaceWith(i),this.o.id=t,this.initialize_tinymce(),this.initialize_quicktags()}},initialize_tinymce:function(){if("undefined"!=typeof tinymce){var e=this.get_mceInit();if(tinyMCEPreInit.mceInit[e.id]=e,this.$el.hasClass("tmce-active"))try{tinymce.init(e)}catch(t){}}},initialize_quicktags:function(){if("undefined"!=typeof quicktags){var e=this.get_qtInit();tinyMCEPreInit.qtInit[e.id]=e;try{var t=quicktags(e);this._buttonsInit(t)}catch(i){}}},get_mceInit:function(){var e=this.$field,t=this.get_toolbar(this.o.toolbar),i=$.extend({},tinyMCEPreInit.mceInit.acf_content);if(i.selector="#"+this.o.id,i.id=this.o.id,i.elements=this.o.id,t)for(var a=tinymce.majorVersion<4?"theme_advanced_buttons":"toolbar",n=1;5>n;n++)i[a+n]=acf.isset(t,n)?t[n]:"";return tinymce.majorVersion<4?i.setup=function(t){t.onInit.add(function(t,i){$(t.getBody()).on("focus",function(){acf.validation.remove_error(e)}),$(t.getBody()).on("blur",function(){t.save(),e.find("textarea").trigger("change")})})}:i.setup=function(t){t.on("focus",function(t){acf.validation.remove_error(e)}),t.on("change",function(i){t.save(),e.find("textarea").trigger("change")})},i.wp_autoresize_on=!1,i=acf.apply_filters("wysiwyg_tinymce_settings",i,i.id)},get_qtInit:function(){var e=$.extend({},tinyMCEPreInit.qtInit.acf_content);return e.id=this.o.id,e=acf.apply_filters("wysiwyg_quicktags_settings",e,e.id)},disable:function(){try{var e=tinyMCE.get(this.o.id);e.save(),e.destroy()}catch(t){}},enable:function(){this.$el.hasClass("tmce-active")&&acf.isset(window,"switchEditors")&&switchEditors.go(this.o.id,"tmce")},get_toolbar:function(e){return"undefined"!=typeof this.toolbars[e]?this.toolbars[e]:!1},_buttonsInit:function(e){var t=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";canvas=e.canvas,name=e.name,settings=e.settings,html="",theButtons={},use="",settings.buttons&&(use=","+settings.buttons+",");for(i in edButtons)edButtons[i]&&(id=edButtons[i].id,use&&-1!==t.indexOf(","+id+",")&&-1===use.indexOf(","+id+",")||edButtons[i].instance&&edButtons[i].instance!==inst||(theButtons[id]=edButtons[i],edButtons[i].html&&(html+=edButtons[i].html(name+"_"))));use&&-1!==use.indexOf(",fullscreen,")&&(theButtons.fullscreen=new qt.FullscreenButton,html+=theButtons.fullscreen.html(name+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(theButtons.textdirection=new qt.TextDirectionButton,html+=theButtons.textdirection.html(name+"_")),e.toolbar.innerHTML=html,e.theButtons=theButtons}});var e=acf.model.extend({$div:null,actions:{ready:"ready"},ready:function(){this.$div=$("#acf-hidden-wp-editor"),this.$div.exists()&&(this.$div.appendTo("body"),"undefined"!=typeof tinymce&&tinymce.on("AddEditor",function(e){var t=e.editor;wpActiveEditor=t.id,"acf_content"===t.id&&(tinymce.activeEditor=tinymce.editors.content||null,wpActiveEditor=tinymce.editors.content?"content":null)}))}})}(jQuery);
diff --git a/core/revisions.php b/core/revisions.php
index a60d78b..d7f1571 100644
--- a/core/revisions.php
+++ b/core/revisions.php
@@ -1,5 +1,9 @@
post_type, 'revisions') ) return $post_id;
+ // bail early if not published (no need to save revision)
+ if( $post->post_status != 'publish' ) return $post_id;
+
+
// get latest revision
- $revision = $this->get_post_latest_revision( $post_id );
+ $revision = acf_get_post_latest_revision( $post_id );
// save
@@ -366,7 +345,7 @@ class acf_revisions {
// Make sure the latest revision is also updated to match the new $post data
// get latest revision
- $revision = $this->get_post_latest_revision( $post_id );
+ $revision = acf_get_post_latest_revision( $post_id );
// save
@@ -382,6 +361,39 @@ class acf_revisions {
}
-new acf_revisions();
+// initialize
+acf()->revisions = new acf_revisions();
+
+endif; // class_exists check
+
+
+/*
+* acf_get_post_latest_revision
+*
+* This function will return the latest revision for a given post
+*
+* @type function
+* @date 25/06/2016
+* @since 5.3.8
+*
+* @param $post_id (int)
+* @return $post_id (int)
+*/
+
+function acf_get_post_latest_revision( $post_id ) {
+
+ // vars
+ $revisions = wp_get_post_revisions( $post_id );
+
+
+ // shift off and return first revision (will return null if no revisions)
+ $revision = array_shift($revisions);
+
+
+ // return
+ return $revision;
+
+}
+
?>
diff --git a/core/validation.php b/core/validation.php
index c606319..d9f5c94 100644
--- a/core/validation.php
+++ b/core/validation.php
@@ -30,6 +30,10 @@ class acf_validation {
add_action('wp_ajax_acf/validate_save_post', array($this, 'ajax_validate_save_post'));
add_action('wp_ajax_nopriv_acf/validate_save_post', array($this, 'ajax_validate_save_post'));
+
+ // filters
+ add_filter('acf/validate_save_post', array($this, 'acf_validate_save_post'), 5);
+
}
@@ -250,6 +254,45 @@ class acf_validation {
}
+ /*
+ * acf_validate_save_post
+ *
+ * This function will loop over $_POST data and validate
+ *
+ * @type action 'acf/validate_save_post' 5
+ * @date 7/09/2016
+ * @since 5.4.0
+ *
+ * @param n/a
+ * @return n/a
+ */
+
+ function acf_validate_save_post() {
+
+ // bail early if no $_POST
+ if( empty($_POST['acf']) ) return;
+
+
+ // loop
+ foreach( $_POST['acf'] as $field_key => $value ) {
+
+ // get field
+ $field = acf_get_field( $field_key );
+ $input = 'acf[' . $field_key . ']';
+
+
+ // bail early if not found
+ if( !$field ) continue;
+
+
+ // validate
+ acf_validate_value( $value, $field, $input );
+
+ }
+
+ }
+
+
/*
* validate_save_post
*
@@ -265,30 +308,7 @@ class acf_validation {
function validate_save_post( $show_errors = false ) {
- // validate fields
- if( !empty($_POST['acf']) ) {
-
- // loop
- foreach( $_POST['acf'] as $field_key => $value ) {
-
- // get field
- $field = acf_get_field( $field_key );
- $input = 'acf[' . $field_key . ']';
-
-
- // bail early if not found
- if( !$field ) continue;
-
-
- // validate
- acf_validate_value( $value, $field, $input );
-
- }
-
- }
-
-
- // action for 3rd party customization
+ // action
do_action('acf/validate_save_post');
diff --git a/lang/acf.pot b/lang/acf.pot
index 98a71fc..9ffb8b2 100644
--- a/lang/acf.pot
+++ b/lang/acf.pot
@@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Advanced Custom Fields\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
-"POT-Creation-Date: 2016-07-28 10:51+1000\n"
+"POT-Creation-Date: 2016-09-13 12:28+1000\n"
"PO-Revision-Date: 2015-06-11 13:00+1000\n"
"Last-Translator: Elliot Condon \n"
"Language-Team: Elliot Condon \n"
@@ -26,91 +26,91 @@ msgstr ""
msgid "Advanced Custom Fields"
msgstr ""
-#: acf.php:271 admin/admin.php:61
+#: acf.php:273 admin/admin.php:61
msgid "Field Groups"
msgstr ""
-#: acf.php:272
+#: acf.php:274
msgid "Field Group"
msgstr ""
-#: acf.php:273 acf.php:305 admin/admin.php:62
+#: acf.php:275 acf.php:307 admin/admin.php:62
#: pro/fields/flexible-content.php:500
msgid "Add New"
msgstr ""
-#: acf.php:274
+#: acf.php:276
msgid "Add New Field Group"
msgstr ""
-#: acf.php:275
+#: acf.php:277
msgid "Edit Field Group"
msgstr ""
-#: acf.php:276
+#: acf.php:278
msgid "New Field Group"
msgstr ""
-#: acf.php:277
+#: acf.php:279
msgid "View Field Group"
msgstr ""
-#: acf.php:278
+#: acf.php:280
msgid "Search Field Groups"
msgstr ""
-#: acf.php:279
+#: acf.php:281
msgid "No Field Groups found"
msgstr ""
-#: acf.php:280
+#: acf.php:282
msgid "No Field Groups found in Trash"
msgstr ""
-#: acf.php:303 admin/field-group.php:182 admin/field-group.php:280
-#: admin/field-groups.php:528 pro/fields/clone.php:662
+#: acf.php:305 admin/field-group.php:182 admin/field-group.php:280
+#: admin/field-groups.php:528 pro/fields/clone.php:684
msgid "Fields"
msgstr ""
-#: acf.php:304
+#: acf.php:306
msgid "Field"
msgstr ""
-#: acf.php:306
+#: acf.php:308
msgid "Add New Field"
msgstr ""
-#: acf.php:307
+#: acf.php:309
msgid "Edit Field"
msgstr ""
-#: acf.php:308 admin/views/field-group-fields.php:54
+#: acf.php:310 admin/views/field-group-fields.php:54
#: admin/views/settings-info.php:111
msgid "New Field"
msgstr ""
-#: acf.php:309
+#: acf.php:311
msgid "View Field"
msgstr ""
-#: acf.php:310
+#: acf.php:312
msgid "Search Fields"
msgstr ""
-#: acf.php:311
+#: acf.php:313
msgid "No Fields found"
msgstr ""
-#: acf.php:312
+#: acf.php:314
msgid "No Fields found in Trash"
msgstr ""
-#: acf.php:351 admin/field-group.php:395 admin/field-groups.php:585
+#: acf.php:353 admin/field-group.php:395 admin/field-groups.php:585
#: admin/views/field-group-options.php:13
msgid "Disabled"
msgstr ""
-#: acf.php:356
+#: acf.php:358
#, php-format
msgid "Disabled (%s)"
msgid_plural "Disabled (%s)"
@@ -181,7 +181,7 @@ msgstr ""
#: admin/views/field-group-field-conditional-logic.php:62
#: admin/views/field-group-field-conditional-logic.php:162
#: admin/views/field-group-locations.php:59
-#: admin/views/field-group-locations.php:135 api/api-helpers.php:3952
+#: admin/views/field-group-locations.php:135 api/api-helpers.php:3973
msgid "or"
msgstr ""
@@ -221,79 +221,79 @@ msgstr ""
msgid "Active"
msgstr ""
-#: admin/field-group.php:842
+#: admin/field-group.php:846
msgid "Front Page"
msgstr ""
-#: admin/field-group.php:843
+#: admin/field-group.php:847
msgid "Posts Page"
msgstr ""
-#: admin/field-group.php:844
+#: admin/field-group.php:848
msgid "Top Level Page (no parent)"
msgstr ""
-#: admin/field-group.php:845
+#: admin/field-group.php:849
msgid "Parent Page (has children)"
msgstr ""
-#: admin/field-group.php:846
+#: admin/field-group.php:850
msgid "Child Page (has parent)"
msgstr ""
-#: admin/field-group.php:862
+#: admin/field-group.php:866
msgid "Default Template"
msgstr ""
-#: admin/field-group.php:885
+#: admin/field-group.php:889
msgid "Logged in"
msgstr ""
-#: admin/field-group.php:886
+#: admin/field-group.php:890
msgid "Viewing front end"
msgstr ""
-#: admin/field-group.php:887
+#: admin/field-group.php:891
msgid "Viewing back end"
msgstr ""
-#: admin/field-group.php:906
+#: admin/field-group.php:910
msgid "Super Admin"
msgstr ""
-#: admin/field-group.php:917 admin/field-group.php:925
-#: admin/field-group.php:939 admin/field-group.php:946
-#: admin/field-group.php:963 admin/field-group.php:980 fields/file.php:241
+#: admin/field-group.php:921 admin/field-group.php:929
+#: admin/field-group.php:943 admin/field-group.php:950
+#: admin/field-group.php:967 admin/field-group.php:984 fields/file.php:241
#: fields/image.php:237 pro/fields/gallery.php:676
msgid "All"
msgstr ""
-#: admin/field-group.php:926
+#: admin/field-group.php:930
msgid "Add / Edit"
msgstr ""
-#: admin/field-group.php:927
+#: admin/field-group.php:931
msgid "Register"
msgstr ""
-#: admin/field-group.php:1167
+#: admin/field-group.php:1171
msgid "Move Complete."
msgstr ""
-#: admin/field-group.php:1168
+#: admin/field-group.php:1172
#, php-format
msgid "The %s field can now be found in the %s field group"
msgstr ""
-#: admin/field-group.php:1170
+#: admin/field-group.php:1174
msgid "Close Window"
msgstr ""
-#: admin/field-group.php:1205
+#: admin/field-group.php:1209
msgid "Please select the destination for this field"
msgstr ""
-#: admin/field-group.php:1212
+#: admin/field-group.php:1216
msgid "Move Field"
msgstr ""
@@ -332,8 +332,8 @@ msgstr[1] ""
msgid "Sync available"
msgstr ""
-#: admin/field-groups.php:525 api/api-template.php:1077
-#: api/api-template.php:1290 pro/fields/gallery.php:370
+#: admin/field-groups.php:525 api/api-template.php:1041
+#: pro/fields/gallery.php:370
msgid "Title"
msgstr ""
@@ -411,16 +411,21 @@ msgstr ""
msgid "Duplicate"
msgstr ""
-#: admin/field-groups.php:751
+#: admin/field-groups.php:717 fields/google-map.php:133
+#: fields/relationship.php:742
+msgid "Search"
+msgstr ""
+
+#: admin/field-groups.php:767
#, php-format
msgid "Select %s"
msgstr ""
-#: admin/field-groups.php:759
+#: admin/field-groups.php:775
msgid "Synchronise field group"
msgstr ""
-#: admin/field-groups.php:759 admin/field-groups.php:776
+#: admin/field-groups.php:775 admin/field-groups.php:792
msgid "Sync"
msgstr ""
@@ -504,9 +509,9 @@ msgstr ""
#: fields/select.php:483 fields/select.php:497 fields/select.php:511
#: fields/tab.php:130 fields/taxonomy.php:785 fields/taxonomy.php:799
#: fields/taxonomy.php:813 fields/taxonomy.php:827 fields/user.php:399
-#: fields/user.php:413 fields/wysiwyg.php:418
-#: pro/admin/views/settings-updates.php:93 pro/fields/clone.php:716
-#: pro/fields/clone.php:734
+#: fields/user.php:413 fields/wysiwyg.php:422
+#: pro/admin/views/settings-updates.php:93 pro/fields/clone.php:738
+#: pro/fields/clone.php:756
msgid "Yes"
msgstr ""
@@ -518,9 +523,9 @@ msgstr ""
#: fields/select.php:484 fields/select.php:498 fields/select.php:512
#: fields/tab.php:131 fields/taxonomy.php:700 fields/taxonomy.php:786
#: fields/taxonomy.php:800 fields/taxonomy.php:814 fields/taxonomy.php:828
-#: fields/user.php:400 fields/user.php:414 fields/wysiwyg.php:419
-#: pro/admin/views/settings-updates.php:103 pro/fields/clone.php:717
-#: pro/fields/clone.php:735
+#: fields/user.php:400 fields/user.php:414 fields/wysiwyg.php:423
+#: pro/admin/views/settings-updates.php:103 pro/fields/clone.php:739
+#: pro/fields/clone.php:757
msgid "No"
msgstr ""
@@ -549,7 +554,7 @@ msgid "Add rule group"
msgstr ""
#: admin/views/field-group-field.php:50 pro/fields/flexible-content.php:346
-#: pro/fields/repeater.php:302
+#: pro/fields/repeater.php:311
msgid "Drag to reorder"
msgstr ""
@@ -1277,87 +1282,87 @@ msgstr ""
msgid "See what's new"
msgstr ""
-#: api/api-helpers.php:944
+#: api/api-helpers.php:950
msgid "Thumbnail"
msgstr ""
-#: api/api-helpers.php:945
+#: api/api-helpers.php:951
msgid "Medium"
msgstr ""
-#: api/api-helpers.php:946
+#: api/api-helpers.php:952
msgid "Large"
msgstr ""
-#: api/api-helpers.php:995
+#: api/api-helpers.php:1001
msgid "Full Size"
msgstr ""
-#: api/api-helpers.php:1207 api/api-helpers.php:1770 pro/fields/clone.php:849
+#: api/api-helpers.php:1213 api/api-helpers.php:1776 pro/fields/clone.php:871
msgid "(no title)"
msgstr ""
-#: api/api-helpers.php:1807 fields/page_link.php:284
+#: api/api-helpers.php:1813 fields/page_link.php:284
#: fields/post_object.php:283 fields/taxonomy.php:989
msgid "Parent"
msgstr ""
-#: api/api-helpers.php:3873
+#: api/api-helpers.php:3894
#, php-format
msgid "Image width must be at least %dpx."
msgstr ""
-#: api/api-helpers.php:3878
+#: api/api-helpers.php:3899
#, php-format
msgid "Image width must not exceed %dpx."
msgstr ""
-#: api/api-helpers.php:3894
+#: api/api-helpers.php:3915
#, php-format
msgid "Image height must be at least %dpx."
msgstr ""
-#: api/api-helpers.php:3899
+#: api/api-helpers.php:3920
#, php-format
msgid "Image height must not exceed %dpx."
msgstr ""
-#: api/api-helpers.php:3917
+#: api/api-helpers.php:3938
#, php-format
msgid "File size must be at least %s."
msgstr ""
-#: api/api-helpers.php:3922
+#: api/api-helpers.php:3943
#, php-format
msgid "File size must must not exceed %s."
msgstr ""
-#: api/api-helpers.php:3956
+#: api/api-helpers.php:3977
#, php-format
msgid "File type must be %s."
msgstr ""
-#: api/api-template.php:1092
+#: api/api-template.php:1050 core/field.php:133
+msgid "Content"
+msgstr ""
+
+#: api/api-template.php:1058
+msgid "Validate Email"
+msgstr ""
+
+#: api/api-template.php:1108
msgid "Spam Detected"
msgstr ""
-#: api/api-template.php:1235 pro/api/api-options-page.php:50
+#: api/api-template.php:1311 pro/api/api-options-page.php:50
#: pro/fields/gallery.php:588
msgid "Update"
msgstr ""
-#: api/api-template.php:1236
+#: api/api-template.php:1312
msgid "Post updated"
msgstr ""
-#: api/api-template.php:1304 core/field.php:133
-msgid "Content"
-msgstr ""
-
-#: api/api-template.php:1369
-msgid "Validate Email"
-msgstr ""
-
#: core/field.php:132
msgid "Basic"
msgstr ""
@@ -1375,8 +1380,8 @@ msgid "jQuery"
msgstr ""
#: core/field.php:137 fields/checkbox.php:224 fields/radio.php:293
-#: pro/fields/clone.php:692 pro/fields/flexible-content.php:495
-#: pro/fields/flexible-content.php:544 pro/fields/repeater.php:459
+#: pro/fields/clone.php:714 pro/fields/flexible-content.php:495
+#: pro/fields/flexible-content.php:544 pro/fields/repeater.php:468
msgid "Layout"
msgstr ""
@@ -1392,7 +1397,7 @@ msgstr ""
msgid "Validation successful"
msgstr ""
-#: core/input.php:261 core/validation.php:306 forms/widget.php:234
+#: core/input.php:261 core/validation.php:326 forms/widget.php:234
msgid "Validation failed"
msgstr ""
@@ -1429,7 +1434,7 @@ msgstr ""
msgid "Uploaded to this post"
msgstr ""
-#: core/validation.php:207
+#: core/validation.php:211
#, php-format
msgid "%s value is required"
msgstr ""
@@ -1458,10 +1463,10 @@ msgstr ""
msgid "red : Red"
msgstr ""
-#: fields/checkbox.php:215 fields/color_picker.php:147 fields/email.php:124
-#: fields/number.php:150 fields/radio.php:284 fields/select.php:455
-#: fields/text.php:148 fields/textarea.php:145 fields/true_false.php:115
-#: fields/url.php:117 fields/wysiwyg.php:379
+#: fields/checkbox.php:215 fields/color_picker.php:147 fields/email.php:133
+#: fields/number.php:145 fields/radio.php:284 fields/select.php:455
+#: fields/text.php:142 fields/textarea.php:139 fields/true_false.php:115
+#: fields/url.php:114 fields/wysiwyg.php:383
msgid "Default Value"
msgstr ""
@@ -1660,39 +1665,39 @@ msgstr ""
msgid "Email"
msgstr ""
-#: fields/email.php:125 fields/number.php:151 fields/radio.php:285
-#: fields/text.php:149 fields/textarea.php:146 fields/url.php:118
-#: fields/wysiwyg.php:380
+#: fields/email.php:134 fields/number.php:146 fields/radio.php:285
+#: fields/text.php:143 fields/textarea.php:140 fields/url.php:115
+#: fields/wysiwyg.php:384
msgid "Appears when creating a new post"
msgstr ""
-#: fields/email.php:133 fields/number.php:159 fields/password.php:137
-#: fields/text.php:157 fields/textarea.php:154 fields/url.php:126
+#: fields/email.php:142 fields/number.php:154 fields/password.php:134
+#: fields/text.php:151 fields/textarea.php:148 fields/url.php:123
msgid "Placeholder Text"
msgstr ""
-#: fields/email.php:134 fields/number.php:160 fields/password.php:138
-#: fields/text.php:158 fields/textarea.php:155 fields/url.php:127
+#: fields/email.php:143 fields/number.php:155 fields/password.php:135
+#: fields/text.php:152 fields/textarea.php:149 fields/url.php:124
msgid "Appears within the input"
msgstr ""
-#: fields/email.php:142 fields/number.php:168 fields/password.php:146
-#: fields/text.php:166
+#: fields/email.php:151 fields/number.php:163 fields/password.php:143
+#: fields/text.php:160
msgid "Prepend"
msgstr ""
-#: fields/email.php:143 fields/number.php:169 fields/password.php:147
-#: fields/text.php:167
+#: fields/email.php:152 fields/number.php:164 fields/password.php:144
+#: fields/text.php:161
msgid "Appears before the input"
msgstr ""
-#: fields/email.php:151 fields/number.php:177 fields/password.php:155
-#: fields/text.php:175
+#: fields/email.php:160 fields/number.php:172 fields/password.php:152
+#: fields/text.php:169
msgid "Append"
msgstr ""
-#: fields/email.php:152 fields/number.php:178 fields/password.php:156
-#: fields/text.php:176
+#: fields/email.php:161 fields/number.php:173 fields/password.php:153
+#: fields/text.php:170
msgid "Appears after the input"
msgstr ""
@@ -1778,10 +1783,6 @@ msgstr ""
msgid "Sorry, this browser does not support geolocation"
msgstr ""
-#: fields/google-map.php:133 fields/relationship.php:742
-msgid "Search"
-msgstr ""
-
#: fields/google-map.php:134
msgid "Clear location"
msgstr ""
@@ -1885,23 +1886,23 @@ msgstr ""
msgid "Message"
msgstr ""
-#: fields/message.php:125 fields/textarea.php:182
+#: fields/message.php:125 fields/textarea.php:176
msgid "New Lines"
msgstr ""
-#: fields/message.php:126 fields/textarea.php:183
+#: fields/message.php:126 fields/textarea.php:177
msgid "Controls how new lines are rendered"
msgstr ""
-#: fields/message.php:130 fields/textarea.php:187
+#: fields/message.php:130 fields/textarea.php:181
msgid "Automatically add paragraphs"
msgstr ""
-#: fields/message.php:131 fields/textarea.php:188
+#: fields/message.php:131 fields/textarea.php:182
msgid "Automatically add <br>"
msgstr ""
-#: fields/message.php:132 fields/textarea.php:189
+#: fields/message.php:132 fields/textarea.php:183
msgid "No Formatting"
msgstr ""
@@ -1917,28 +1918,28 @@ msgstr ""
msgid "Number"
msgstr ""
-#: fields/number.php:186
+#: fields/number.php:181
msgid "Minimum Value"
msgstr ""
-#: fields/number.php:195
+#: fields/number.php:190
msgid "Maximum Value"
msgstr ""
-#: fields/number.php:204
+#: fields/number.php:199
msgid "Step Size"
msgstr ""
-#: fields/number.php:242
+#: fields/number.php:237
msgid "Value must be a number"
msgstr ""
-#: fields/number.php:260
+#: fields/number.php:255
#, php-format
msgid "Value must be equal to or higher than %d"
msgstr ""
-#: fields/number.php:268
+#: fields/number.php:263
#, php-format
msgid "Value must be equal to or lower than %d"
msgstr ""
@@ -2292,11 +2293,11 @@ msgstr ""
msgid "Text"
msgstr ""
-#: fields/text.php:184 fields/textarea.php:163
+#: fields/text.php:178 fields/textarea.php:157
msgid "Character Limit"
msgstr ""
-#: fields/text.php:185 fields/textarea.php:164
+#: fields/text.php:179 fields/textarea.php:158
msgid "Leave blank for no limit"
msgstr ""
@@ -2304,11 +2305,11 @@ msgstr ""
msgid "Text Area"
msgstr ""
-#: fields/textarea.php:172
+#: fields/textarea.php:166
msgid "Rows"
msgstr ""
-#: fields/textarea.php:173
+#: fields/textarea.php:167
msgid "Sets the textarea height"
msgstr ""
@@ -2328,7 +2329,7 @@ msgstr ""
msgid "Url"
msgstr ""
-#: fields/url.php:168
+#: fields/url.php:165
msgid "Value must be a valid URL"
msgstr ""
@@ -2344,36 +2345,36 @@ msgstr ""
msgid "Wysiwyg Editor"
msgstr ""
-#: fields/wysiwyg.php:331
+#: fields/wysiwyg.php:335
msgid "Visual"
msgstr ""
-#: fields/wysiwyg.php:332
+#: fields/wysiwyg.php:336
msgctxt "Name for the Text editor tab (formerly HTML)"
msgid "Text"
msgstr ""
-#: fields/wysiwyg.php:388
+#: fields/wysiwyg.php:392
msgid "Tabs"
msgstr ""
-#: fields/wysiwyg.php:393
+#: fields/wysiwyg.php:397
msgid "Visual & Text"
msgstr ""
-#: fields/wysiwyg.php:394
+#: fields/wysiwyg.php:398
msgid "Visual Only"
msgstr ""
-#: fields/wysiwyg.php:395
+#: fields/wysiwyg.php:399
msgid "Text Only"
msgstr ""
-#: fields/wysiwyg.php:402
+#: fields/wysiwyg.php:406
msgid "Toolbar"
msgstr ""
-#: fields/wysiwyg.php:412
+#: fields/wysiwyg.php:416
msgid "Show Media Upload Buttons?"
msgstr ""
@@ -2498,64 +2499,64 @@ msgctxt "noun"
msgid "Clone"
msgstr ""
-#: pro/fields/clone.php:663
+#: pro/fields/clone.php:685
msgid "Select one or more fields you wish to clone"
msgstr ""
-#: pro/fields/clone.php:678
+#: pro/fields/clone.php:700
msgid "Display"
msgstr ""
-#: pro/fields/clone.php:679
+#: pro/fields/clone.php:701
msgid "Specify the style used to render the clone field"
msgstr ""
-#: pro/fields/clone.php:684
+#: pro/fields/clone.php:706
msgid "Group (displays selected fields in a group within this field)"
msgstr ""
-#: pro/fields/clone.php:685
+#: pro/fields/clone.php:707
msgid "Seamless (replaces this field with selected fields)"
msgstr ""
-#: pro/fields/clone.php:693
+#: pro/fields/clone.php:715
msgid "Specify the style used to render the selected fields"
msgstr ""
-#: pro/fields/clone.php:698 pro/fields/flexible-content.php:555
-#: pro/fields/repeater.php:467
+#: pro/fields/clone.php:720 pro/fields/flexible-content.php:555
+#: pro/fields/repeater.php:476
msgid "Block"
msgstr ""
-#: pro/fields/clone.php:699 pro/fields/flexible-content.php:554
-#: pro/fields/repeater.php:466
+#: pro/fields/clone.php:721 pro/fields/flexible-content.php:554
+#: pro/fields/repeater.php:475
msgid "Table"
msgstr ""
-#: pro/fields/clone.php:700 pro/fields/flexible-content.php:556
-#: pro/fields/repeater.php:468
+#: pro/fields/clone.php:722 pro/fields/flexible-content.php:556
+#: pro/fields/repeater.php:477
msgid "Row"
msgstr ""
-#: pro/fields/clone.php:706
+#: pro/fields/clone.php:728
#, php-format
msgid "Labels will be displayed as %s"
msgstr ""
-#: pro/fields/clone.php:709
+#: pro/fields/clone.php:731
msgid "Prefix Field Labels"
msgstr ""
-#: pro/fields/clone.php:724
+#: pro/fields/clone.php:746
#, php-format
msgid "Values will be saved as %s"
msgstr ""
-#: pro/fields/clone.php:727
+#: pro/fields/clone.php:749
msgid "Prefix Field Names"
msgstr ""
-#: pro/fields/clone.php:883
+#: pro/fields/clone.php:905
#, php-format
msgid "All fields from %s field group"
msgstr ""
@@ -2617,7 +2618,7 @@ msgstr ""
msgid "Remove layout"
msgstr ""
-#: pro/fields/flexible-content.php:356 pro/fields/repeater.php:304
+#: pro/fields/flexible-content.php:356 pro/fields/repeater.php:313
msgid "Click to toggle"
msgstr ""
@@ -2649,7 +2650,7 @@ msgstr ""
msgid "Max"
msgstr ""
-#: pro/fields/flexible-content.php:612 pro/fields/repeater.php:475
+#: pro/fields/flexible-content.php:612 pro/fields/repeater.php:484
msgid "Button Label"
msgstr ""
@@ -2749,31 +2750,31 @@ msgstr ""
msgid "Maximum rows reached ({max} rows)"
msgstr ""
-#: pro/fields/repeater.php:349
+#: pro/fields/repeater.php:358
msgid "Add row"
msgstr ""
-#: pro/fields/repeater.php:350
+#: pro/fields/repeater.php:359
msgid "Remove row"
msgstr ""
-#: pro/fields/repeater.php:398
+#: pro/fields/repeater.php:407
msgid "Sub Fields"
msgstr ""
-#: pro/fields/repeater.php:428
+#: pro/fields/repeater.php:437
msgid "Collapsed"
msgstr ""
-#: pro/fields/repeater.php:429
+#: pro/fields/repeater.php:438
msgid "Select a sub field to show when row is collapsed"
msgstr ""
-#: pro/fields/repeater.php:439
+#: pro/fields/repeater.php:448
msgid "Minimum Rows"
msgstr ""
-#: pro/fields/repeater.php:449
+#: pro/fields/repeater.php:458
msgid "Maximum Rows"
msgstr ""
diff --git a/readme.txt b/readme.txt
index 6edd607..681b502 100644
--- a/readme.txt
+++ b/readme.txt
@@ -106,6 +106,15 @@ http://support.advancedcustomfields.com/
== Changelog ==
+= 5.4.6-RC1 =
+* Flexible content field: Fixed bug where radio input values were lost when adding/duplicating a layout
+
+= 5.4.5 =
+* API: Fixed bug in `acf_form()` where AJAX validation ignored 'post_title'
+* API: Improved `update_field()` when saving a new value (when reference value does not yet exist)
+* Core: Added search input & toggle to admin field groups list
+* Core: Fixed bug where preview values did not load for a draft post
+
= 5.4.4 =
* WYSIWYG field: Fixed JS error when 'Disable the visual editor when writing' is checked