diff --git a/acf.php b/acf.php
index 2a71eb4..a945f50 100644
--- a/acf.php
+++ b/acf.php
@@ -3,655 +3,665 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com
Description: Customize WordPress with powerful, professional and intuitive fields.
-Version: 5.9.9
+Version: 5.10.2
Author: Delicious Brains
Author URI: https://www.advancedcustomfields.com
Text Domain: acf
Domain Path: /lang
*/
-if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
-
-if( ! class_exists('ACF') ) :
-
-class ACF {
-
- /** @var string The plugin version number. */
- var $version = '5.9.9';
-
- /** @var array The plugin settings array. */
- var $settings = array();
-
- /** @var array The plugin data array. */
- var $data = array();
-
- /** @var array Storage for class instances. */
- var $instances = array();
-
- /**
- * __construct
- *
- * A dummy constructor to ensure ACF is only setup once.
- *
- * @date 23/06/12
- * @since 5.0.0
- *
- * @param void
- * @return void
- */
- function __construct() {
- // Do nothing.
- }
-
- /**
- * initialize
- *
- * Sets up the ACF plugin.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param void
- * @return void
- */
- function initialize() {
-
- // Define constants.
- $this->define( 'ACF', true );
- $this->define( 'ACF_PATH', plugin_dir_path( __FILE__ ) );
- $this->define( 'ACF_BASENAME', plugin_basename( __FILE__ ) );
- $this->define( 'ACF_VERSION', $this->version );
- $this->define( 'ACF_MAJOR_VERSION', 5 );
-
- // Define settings.
- $this->settings = array(
- 'name' => __('Advanced Custom Fields', 'acf'),
- 'slug' => dirname( ACF_BASENAME ),
- 'version' => ACF_VERSION,
- 'basename' => ACF_BASENAME,
- 'path' => ACF_PATH,
- 'file' => __FILE__,
- 'url' => plugin_dir_url( __FILE__ ),
- 'show_admin' => true,
- 'show_updates' => true,
- 'stripslashes' => false,
- 'local' => true,
- 'json' => true,
- 'save_json' => '',
- 'load_json' => array(),
- 'default_language' => '',
- 'current_language' => '',
- 'capability' => 'manage_options',
- 'uploader' => 'wp',
- 'autoload' => false,
- 'l10n' => true,
- 'l10n_textdomain' => '',
- 'google_api_key' => '',
- 'google_api_client' => '',
- 'enqueue_google_maps' => true,
- 'enqueue_select2' => true,
- 'enqueue_datepicker' => true,
- 'enqueue_datetimepicker' => true,
- 'select2_version' => 4,
- 'row_index_offset' => 1,
- 'remove_wp_meta_box' => true
- );
-
- // Include utility functions.
- include_once( ACF_PATH . 'includes/acf-utility-functions.php');
-
- // Include previous API functions.
- acf_include('includes/api/api-helpers.php');
- acf_include('includes/api/api-template.php');
- acf_include('includes/api/api-term.php');
-
- // Include classes.
- acf_include('includes/class-acf-data.php');
- acf_include('includes/fields/class-acf-field.php');
- acf_include('includes/locations/abstract-acf-legacy-location.php');
- acf_include('includes/locations/abstract-acf-location.php');
-
- // Include functions.
- acf_include('includes/acf-helper-functions.php');
- acf_include('includes/acf-hook-functions.php');
- acf_include('includes/acf-field-functions.php');
- acf_include('includes/acf-field-group-functions.php');
- acf_include('includes/acf-form-functions.php');
- acf_include('includes/acf-meta-functions.php');
- acf_include('includes/acf-post-functions.php');
- acf_include('includes/acf-user-functions.php');
- acf_include('includes/acf-value-functions.php');
- acf_include('includes/acf-input-functions.php');
- acf_include('includes/acf-wp-functions.php');
-
- // Include core.
- acf_include('includes/fields.php');
- acf_include('includes/locations.php');
- acf_include('includes/assets.php');
- acf_include('includes/compatibility.php');
- acf_include('includes/deprecated.php');
- acf_include('includes/l10n.php');
- acf_include('includes/local-fields.php');
- acf_include('includes/local-meta.php');
- acf_include('includes/local-json.php');
- acf_include('includes/loop.php');
- acf_include('includes/media.php');
- acf_include('includes/revisions.php');
- acf_include('includes/updates.php');
- acf_include('includes/upgrades.php');
- acf_include('includes/validation.php');
-
- // Include ajax.
- acf_include('includes/ajax/class-acf-ajax.php');
- acf_include('includes/ajax/class-acf-ajax-check-screen.php');
- acf_include('includes/ajax/class-acf-ajax-user-setting.php');
- acf_include('includes/ajax/class-acf-ajax-upgrade.php');
- acf_include('includes/ajax/class-acf-ajax-query.php');
- acf_include('includes/ajax/class-acf-ajax-query-users.php');
- acf_include('includes/ajax/class-acf-ajax-local-json-diff.php');
-
- // Include forms.
- acf_include('includes/forms/form-attachment.php');
- acf_include('includes/forms/form-comment.php');
- acf_include('includes/forms/form-customizer.php');
- acf_include('includes/forms/form-front.php');
- acf_include('includes/forms/form-nav-menu.php');
- acf_include('includes/forms/form-post.php');
- acf_include('includes/forms/form-gutenberg.php');
- acf_include('includes/forms/form-taxonomy.php');
- acf_include('includes/forms/form-user.php');
- acf_include('includes/forms/form-widget.php');
-
- // Include admin.
- if( is_admin() ) {
- acf_include('includes/admin/admin.php');
- acf_include('includes/admin/admin-field-group.php');
- acf_include('includes/admin/admin-field-groups.php');
- acf_include('includes/admin/admin-notices.php');
- acf_include('includes/admin/admin-tools.php');
- acf_include('includes/admin/admin-upgrade.php');
- }
-
- // Include legacy.
- acf_include('includes/legacy/legacy-locations.php');
-
- // Include PRO.
- acf_include('pro/acf-pro.php');
-
- // Include tests.
- if( defined('ACF_DEV') && ACF_DEV ) {
- acf_include('tests/tests.php');
- }
-
- // Add actions.
- add_action( 'init', array($this, 'init'), 5 );
- add_action( 'init', array($this, 'register_post_types'), 5 );
- add_action( 'init', array($this, 'register_post_status'), 5 );
-
- // Add filters.
- add_filter( 'posts_where', array($this, 'posts_where'), 10, 2 );
- }
-
- /**
- * init
- *
- * Completes the setup process on "init" of earlier.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param void
- * @return void
- */
- function init() {
-
- // Bail early if called directly from functions.php or plugin file.
- if( !did_action('plugins_loaded') ) {
- return;
- }
-
- // This function may be called directly from template functions. Bail early if already did this.
- if( acf_did('init') ) {
- return;
- }
-
- // Update url setting. Allows other plugins to modify the URL (force SSL).
- acf_update_setting( 'url', plugin_dir_url( __FILE__ ) );
-
- // Load textdomain file.
- acf_load_textdomain();
-
- // Include 3rd party compatiblity.
- acf_include('includes/third-party.php');
-
- // Include wpml support.
- if( defined('ICL_SITEPRESS_VERSION') ) {
- acf_include('includes/wpml.php');
- }
-
- // Include fields.
- acf_include('includes/fields/class-acf-field-text.php');
- acf_include('includes/fields/class-acf-field-textarea.php');
- acf_include('includes/fields/class-acf-field-number.php');
- acf_include('includes/fields/class-acf-field-range.php');
- acf_include('includes/fields/class-acf-field-email.php');
- acf_include('includes/fields/class-acf-field-url.php');
- acf_include('includes/fields/class-acf-field-password.php');
- acf_include('includes/fields/class-acf-field-image.php');
- acf_include('includes/fields/class-acf-field-file.php');
- acf_include('includes/fields/class-acf-field-wysiwyg.php');
- acf_include('includes/fields/class-acf-field-oembed.php');
- acf_include('includes/fields/class-acf-field-select.php');
- acf_include('includes/fields/class-acf-field-checkbox.php');
- acf_include('includes/fields/class-acf-field-radio.php');
- acf_include('includes/fields/class-acf-field-button-group.php');
- acf_include('includes/fields/class-acf-field-true_false.php');
- acf_include('includes/fields/class-acf-field-link.php');
- acf_include('includes/fields/class-acf-field-post_object.php');
- acf_include('includes/fields/class-acf-field-page_link.php');
- acf_include('includes/fields/class-acf-field-relationship.php');
- acf_include('includes/fields/class-acf-field-taxonomy.php');
- acf_include('includes/fields/class-acf-field-user.php');
- acf_include('includes/fields/class-acf-field-google-map.php');
- acf_include('includes/fields/class-acf-field-date_picker.php');
- acf_include('includes/fields/class-acf-field-date_time_picker.php');
- acf_include('includes/fields/class-acf-field-time_picker.php');
- acf_include('includes/fields/class-acf-field-color_picker.php');
- acf_include('includes/fields/class-acf-field-message.php');
- acf_include('includes/fields/class-acf-field-accordion.php');
- acf_include('includes/fields/class-acf-field-tab.php');
- acf_include('includes/fields/class-acf-field-group.php');
-
- /**
- * Fires after field types have been included.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param int $major_version The major version of ACF.
- */
- do_action( 'acf/include_field_types', ACF_MAJOR_VERSION );
-
- // Include locations.
- acf_include('includes/locations/class-acf-location-post-type.php');
- acf_include('includes/locations/class-acf-location-post-template.php');
- acf_include('includes/locations/class-acf-location-post-status.php');
- acf_include('includes/locations/class-acf-location-post-format.php');
- acf_include('includes/locations/class-acf-location-post-category.php');
- acf_include('includes/locations/class-acf-location-post-taxonomy.php');
- acf_include('includes/locations/class-acf-location-post.php');
- acf_include('includes/locations/class-acf-location-page-template.php');
- acf_include('includes/locations/class-acf-location-page-type.php');
- acf_include('includes/locations/class-acf-location-page-parent.php');
- acf_include('includes/locations/class-acf-location-page.php');
- acf_include('includes/locations/class-acf-location-current-user.php');
- acf_include('includes/locations/class-acf-location-current-user-role.php');
- acf_include('includes/locations/class-acf-location-user-form.php');
- acf_include('includes/locations/class-acf-location-user-role.php');
- acf_include('includes/locations/class-acf-location-taxonomy.php');
- acf_include('includes/locations/class-acf-location-attachment.php');
- acf_include('includes/locations/class-acf-location-comment.php');
- acf_include('includes/locations/class-acf-location-widget.php');
- acf_include('includes/locations/class-acf-location-nav-menu.php');
- acf_include('includes/locations/class-acf-location-nav-menu-item.php');
-
- /**
- * Fires after location types have been included.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param int $major_version The major version of ACF.
- */
- do_action( 'acf/include_location_rules', ACF_MAJOR_VERSION );
-
- /**
- * Fires during initialization. Used to add local fields.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param int $major_version The major version of ACF.
- */
- do_action( 'acf/include_fields', ACF_MAJOR_VERSION );
-
- /**
- * Fires after ACF is completely "initialized".
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param int $major_version The major version of ACF.
- */
- do_action( 'acf/init', ACF_MAJOR_VERSION );
- }
-
- /**
- * register_post_types
- *
- * Registers the ACF post types.
- *
- * @date 22/10/2015
- * @since 5.3.2
- *
- * @param void
- * @return void
- */
- function register_post_types() {
-
- // Vars.
- $cap = acf_get_setting('capability');
-
- // Register the Field Group post type.
- register_post_type('acf-field-group', array(
- 'labels' => array(
- 'name' => __( 'Field Groups', 'acf' ),
- 'singular_name' => __( 'Field Group', 'acf' ),
- 'add_new' => __( 'Add New' , 'acf' ),
- 'add_new_item' => __( 'Add New Field Group' , 'acf' ),
- 'edit_item' => __( 'Edit Field Group' , 'acf' ),
- 'new_item' => __( 'New Field Group' , 'acf' ),
- 'view_item' => __( 'View Field Group', 'acf' ),
- 'search_items' => __( 'Search Field Groups', 'acf' ),
- 'not_found' => __( 'No Field Groups found', 'acf' ),
- 'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ),
- ),
- 'public' => false,
- 'hierarchical' => true,
- 'show_ui' => true,
- 'show_in_menu' => false,
- '_builtin' => false,
- 'capability_type' => 'post',
- 'capabilities' => array(
- 'edit_post' => $cap,
- 'delete_post' => $cap,
- 'edit_posts' => $cap,
- 'delete_posts' => $cap,
- ),
- 'supports' => array('title'),
- 'rewrite' => false,
- 'query_var' => false,
- ));
-
-
- // Register the Field post type.
- register_post_type('acf-field', array(
- 'labels' => array(
- 'name' => __( 'Fields', 'acf' ),
- 'singular_name' => __( 'Field', 'acf' ),
- 'add_new' => __( 'Add New' , 'acf' ),
- 'add_new_item' => __( 'Add New Field' , 'acf' ),
- 'edit_item' => __( 'Edit Field' , 'acf' ),
- 'new_item' => __( 'New Field' , 'acf' ),
- 'view_item' => __( 'View Field', 'acf' ),
- 'search_items' => __( 'Search Fields', 'acf' ),
- 'not_found' => __( 'No Fields found', 'acf' ),
- 'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ),
- ),
- 'public' => false,
- 'hierarchical' => true,
- 'show_ui' => false,
- 'show_in_menu' => false,
- '_builtin' => false,
- 'capability_type' => 'post',
- 'capabilities' => array(
- 'edit_post' => $cap,
- 'delete_post' => $cap,
- 'edit_posts' => $cap,
- 'delete_posts' => $cap,
- ),
- 'supports' => array('title'),
- 'rewrite' => false,
- 'query_var' => false,
- ));
- }
-
- /**
- * register_post_status
- *
- * Registers the ACF post statuses.
- *
- * @date 22/10/2015
- * @since 5.3.2
- *
- * @param void
- * @return void
- */
- function register_post_status() {
-
- // Register the Disabled post status.
- register_post_status('acf-disabled', array(
- 'label' => _x( 'Disabled', 'post status', 'acf' ),
- 'public' => true,
- 'exclude_from_search' => false,
- 'show_in_admin_all_list' => true,
- 'show_in_admin_status_list' => true,
- 'label_count' => _n_noop( 'Disabled (%s)', 'Disabled (%s)', 'acf' ),
- ));
- }
-
- /**
- * posts_where
- *
- * Filters the $where clause allowing for custom WP_Query args.
- *
- * @date 31/8/19
- * @since 5.8.1
- *
- * @param string $where The WHERE clause.
- * @return WP_Query $wp_query The query object.
- */
- function posts_where( $where, $wp_query ) {
- global $wpdb;
-
- // Add custom "acf_field_key" arg.
- if( $field_key = $wp_query->get('acf_field_key') ) {
- $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $field_key );
- }
-
- // Add custom "acf_field_name" arg.
- if( $field_name = $wp_query->get('acf_field_name') ) {
- $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_excerpt = %s", $field_name );
- }
-
- // Add custom "acf_group_key" arg.
- if( $group_key = $wp_query->get('acf_group_key') ) {
- $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_name = %s", $group_key );
- }
-
- // Return.
- return $where;
- }
-
- /**
- * define
- *
- * Defines a constant if doesnt already exist.
- *
- * @date 3/5/17
- * @since 5.5.13
- *
- * @param string $name The constant name.
- * @param mixed $value The constant value.
- * @return void
- */
- function define( $name, $value = true ) {
- if( !defined($name) ) {
- define( $name, $value );
- }
- }
-
- /**
- * has_setting
- *
- * Returns true if a setting exists for this name.
- *
- * @date 2/2/18
- * @since 5.6.5
- *
- * @param string $name The setting name.
- * @return boolean
- */
- function has_setting( $name ) {
- return isset($this->settings[ $name ]);
- }
-
- /**
- * get_setting
- *
- * Returns a setting or null if doesn't exist.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param string $name The setting name.
- * @return mixed
- */
- function get_setting( $name ) {
- return isset($this->settings[ $name ]) ? $this->settings[ $name ] : null;
- }
-
- /**
- * update_setting
- *
- * Updates a setting for the given name and value.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param string $name The setting name.
- * @param mixed $value The setting value.
- * @return true
- */
- function update_setting( $name, $value ) {
- $this->settings[ $name ] = $value;
- return true;
- }
-
- /**
- * get_data
- *
- * Returns data or null if doesn't exist.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param string $name The data name.
- * @return mixed
- */
- function get_data( $name ) {
- return isset($this->data[ $name ]) ? $this->data[ $name ] : null;
- }
-
- /**
- * set_data
- *
- * Sets data for the given name and value.
- *
- * @date 28/09/13
- * @since 5.0.0
- *
- * @param string $name The data name.
- * @param mixed $value The data value.
- * @return void
- */
- function set_data( $name, $value ) {
- $this->data[ $name ] = $value;
- }
-
- /**
- * get_instance
- *
- * Returns an instance or null if doesn't exist.
- *
- * @date 13/2/18
- * @since 5.6.9
- *
- * @param string $class The instance class name.
- * @return object
- */
- function get_instance( $class ) {
- $name = strtolower($class);
- return isset($this->instances[ $name ]) ? $this->instances[ $name ] : null;
- }
-
- /**
- * new_instance
- *
- * Creates and stores an instance of the given class.
- *
- * @date 13/2/18
- * @since 5.6.9
- *
- * @param string $class The instance class name.
- * @return object
- */
- function new_instance( $class ) {
- $instance = new $class();
- $name = strtolower($class);
- $this->instances[ $name ] = $instance;
- return $instance;
- }
-
- /**
- * Magic __isset method for backwards compatibility.
- *
- * @date 24/4/20
- * @since 5.9.0
- *
- * @param string $key Key name.
- * @return bool
- */
- public function __isset( $key ) {
- return in_array( $key, array( 'locations', 'json' ) );
- }
-
- /**
- * Magic __get method for backwards compatibility.
- *
- * @date 24/4/20
- * @since 5.9.0
- *
- * @param string $key Key name.
- * @return mixed
- */
- public function __get( $key ) {
- switch ( $key ) {
- case 'locations':
- return acf_get_instance( 'ACF_Legacy_Locations' );
- case 'json':
- return acf_get_instance( 'ACF_Local_JSON' );
- }
- return null;
- }
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly
}
-/*
- * acf
- *
- * The main function responsible for returning the one true acf Instance to functions everywhere.
- * Use this function like you would a global variable, except without needing to declare the global.
- *
- * Example:
- *
- * @date 4/09/13
- * @since 4.3.0
- *
- * @param void
- * @return ACF
- */
-function acf() {
- global $acf;
-
- // Instantiate only once.
- if( !isset($acf) ) {
- $acf = new ACF();
- $acf->initialize();
- }
- return $acf;
-}
+if ( ! class_exists( 'ACF' ) ) :
-// Instantiate.
-acf();
+ class ACF {
+
+ /** @var string The plugin version number. */
+ var $version = '5.10.2';
+
+ /** @var array The plugin settings array. */
+ var $settings = array();
+
+ /** @var array The plugin data array. */
+ var $data = array();
+
+ /** @var array Storage for class instances. */
+ var $instances = array();
+
+ /**
+ * __construct
+ *
+ * A dummy constructor to ensure ACF is only setup once.
+ *
+ * @date 23/06/12
+ * @since 5.0.0
+ *
+ * @param void
+ * @return void
+ */
+ function __construct() {
+ // Do nothing.
+ }
+
+ /**
+ * initialize
+ *
+ * Sets up the ACF plugin.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param void
+ * @return void
+ */
+ function initialize() {
+
+ // Define constants.
+ $this->define( 'ACF', true );
+ $this->define( 'ACF_PATH', plugin_dir_path( __FILE__ ) );
+ $this->define( 'ACF_BASENAME', plugin_basename( __FILE__ ) );
+ $this->define( 'ACF_VERSION', $this->version );
+ $this->define( 'ACF_MAJOR_VERSION', 5 );
+
+ // Define settings.
+ $this->settings = array(
+ 'name' => __( 'Advanced Custom Fields', 'acf' ),
+ 'slug' => dirname( ACF_BASENAME ),
+ 'version' => ACF_VERSION,
+ 'basename' => ACF_BASENAME,
+ 'path' => ACF_PATH,
+ 'file' => __FILE__,
+ 'url' => plugin_dir_url( __FILE__ ),
+ 'show_admin' => true,
+ 'show_updates' => true,
+ 'stripslashes' => false,
+ 'local' => true,
+ 'json' => true,
+ 'save_json' => '',
+ 'load_json' => array(),
+ 'default_language' => '',
+ 'current_language' => '',
+ 'capability' => 'manage_options',
+ 'uploader' => 'wp',
+ 'autoload' => false,
+ 'l10n' => true,
+ 'l10n_textdomain' => '',
+ 'google_api_key' => '',
+ 'google_api_client' => '',
+ 'enqueue_google_maps' => true,
+ 'enqueue_select2' => true,
+ 'enqueue_datepicker' => true,
+ 'enqueue_datetimepicker' => true,
+ 'select2_version' => 4,
+ 'row_index_offset' => 1,
+ 'remove_wp_meta_box' => true,
+ );
+
+ // Include utility functions.
+ include_once ACF_PATH . 'includes/acf-utility-functions.php';
+
+ // Include previous API functions.
+ acf_include( 'includes/api/api-helpers.php' );
+ acf_include( 'includes/api/api-template.php' );
+ acf_include( 'includes/api/api-term.php' );
+
+ // Include classes.
+ acf_include( 'includes/class-acf-data.php' );
+ acf_include( 'includes/fields/class-acf-field.php' );
+ acf_include( 'includes/locations/abstract-acf-legacy-location.php' );
+ acf_include( 'includes/locations/abstract-acf-location.php' );
+
+ // Include functions.
+ acf_include( 'includes/acf-helper-functions.php' );
+ acf_include( 'includes/acf-hook-functions.php' );
+ acf_include( 'includes/acf-field-functions.php' );
+ acf_include( 'includes/acf-field-group-functions.php' );
+ acf_include( 'includes/acf-form-functions.php' );
+ acf_include( 'includes/acf-meta-functions.php' );
+ acf_include( 'includes/acf-post-functions.php' );
+ acf_include( 'includes/acf-user-functions.php' );
+ acf_include( 'includes/acf-value-functions.php' );
+ acf_include( 'includes/acf-input-functions.php' );
+ acf_include( 'includes/acf-wp-functions.php' );
+
+ // Include core.
+ acf_include( 'includes/fields.php' );
+ acf_include( 'includes/locations.php' );
+ acf_include( 'includes/assets.php' );
+ acf_include( 'includes/compatibility.php' );
+ acf_include( 'includes/deprecated.php' );
+ acf_include( 'includes/l10n.php' );
+ acf_include( 'includes/local-fields.php' );
+ acf_include( 'includes/local-meta.php' );
+ acf_include( 'includes/local-json.php' );
+ acf_include( 'includes/loop.php' );
+ acf_include( 'includes/media.php' );
+ acf_include( 'includes/revisions.php' );
+ acf_include( 'includes/updates.php' );
+ acf_include( 'includes/upgrades.php' );
+ acf_include( 'includes/validation.php' );
+
+ // Include ajax.
+ acf_include( 'includes/ajax/class-acf-ajax.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-check-screen.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-user-setting.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-upgrade.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-query.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-query-users.php' );
+ acf_include( 'includes/ajax/class-acf-ajax-local-json-diff.php' );
+
+ // Include forms.
+ acf_include( 'includes/forms/form-attachment.php' );
+ acf_include( 'includes/forms/form-comment.php' );
+ acf_include( 'includes/forms/form-customizer.php' );
+ acf_include( 'includes/forms/form-front.php' );
+ acf_include( 'includes/forms/form-nav-menu.php' );
+ acf_include( 'includes/forms/form-post.php' );
+ acf_include( 'includes/forms/form-gutenberg.php' );
+ acf_include( 'includes/forms/form-taxonomy.php' );
+ acf_include( 'includes/forms/form-user.php' );
+ acf_include( 'includes/forms/form-widget.php' );
+
+ // Include admin.
+ if ( is_admin() ) {
+ acf_include( 'includes/admin/admin.php' );
+ acf_include( 'includes/admin/admin-field-group.php' );
+ acf_include( 'includes/admin/admin-field-groups.php' );
+ acf_include( 'includes/admin/admin-notices.php' );
+ acf_include( 'includes/admin/admin-tools.php' );
+ acf_include( 'includes/admin/admin-upgrade.php' );
+ }
+
+ // Include legacy.
+ acf_include( 'includes/legacy/legacy-locations.php' );
+
+ // Include PRO.
+ acf_include( 'pro/acf-pro.php' );
+
+ // Include tests.
+ if ( defined( 'ACF_DEV' ) && ACF_DEV ) {
+ acf_include( 'tests/tests.php' );
+ }
+
+ // Add actions.
+ add_action( 'init', array( $this, 'init' ), 5 );
+ add_action( 'init', array( $this, 'register_post_types' ), 5 );
+ add_action( 'init', array( $this, 'register_post_status' ), 5 );
+
+ // Add filters.
+ add_filter( 'posts_where', array( $this, 'posts_where' ), 10, 2 );
+ }
+
+ /**
+ * init
+ *
+ * Completes the setup process on "init" of earlier.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param void
+ * @return void
+ */
+ function init() {
+
+ // Bail early if called directly from functions.php or plugin file.
+ if ( ! did_action( 'plugins_loaded' ) ) {
+ return;
+ }
+
+ // This function may be called directly from template functions. Bail early if already did this.
+ if ( acf_did( 'init' ) ) {
+ return;
+ }
+
+ // Update url setting. Allows other plugins to modify the URL (force SSL).
+ acf_update_setting( 'url', plugin_dir_url( __FILE__ ) );
+
+ // Load textdomain file.
+ acf_load_textdomain();
+
+ // Include 3rd party compatiblity.
+ acf_include( 'includes/third-party.php' );
+
+ // Include wpml support.
+ if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
+ acf_include( 'includes/wpml.php' );
+ }
+
+ // Include fields.
+ acf_include( 'includes/fields/class-acf-field-text.php' );
+ acf_include( 'includes/fields/class-acf-field-textarea.php' );
+ acf_include( 'includes/fields/class-acf-field-number.php' );
+ acf_include( 'includes/fields/class-acf-field-range.php' );
+ acf_include( 'includes/fields/class-acf-field-email.php' );
+ acf_include( 'includes/fields/class-acf-field-url.php' );
+ acf_include( 'includes/fields/class-acf-field-password.php' );
+ acf_include( 'includes/fields/class-acf-field-image.php' );
+ acf_include( 'includes/fields/class-acf-field-file.php' );
+ acf_include( 'includes/fields/class-acf-field-wysiwyg.php' );
+ acf_include( 'includes/fields/class-acf-field-oembed.php' );
+ acf_include( 'includes/fields/class-acf-field-select.php' );
+ acf_include( 'includes/fields/class-acf-field-checkbox.php' );
+ acf_include( 'includes/fields/class-acf-field-radio.php' );
+ acf_include( 'includes/fields/class-acf-field-button-group.php' );
+ acf_include( 'includes/fields/class-acf-field-true_false.php' );
+ acf_include( 'includes/fields/class-acf-field-link.php' );
+ acf_include( 'includes/fields/class-acf-field-post_object.php' );
+ acf_include( 'includes/fields/class-acf-field-page_link.php' );
+ acf_include( 'includes/fields/class-acf-field-relationship.php' );
+ acf_include( 'includes/fields/class-acf-field-taxonomy.php' );
+ acf_include( 'includes/fields/class-acf-field-user.php' );
+ acf_include( 'includes/fields/class-acf-field-google-map.php' );
+ acf_include( 'includes/fields/class-acf-field-date_picker.php' );
+ acf_include( 'includes/fields/class-acf-field-date_time_picker.php' );
+ acf_include( 'includes/fields/class-acf-field-time_picker.php' );
+ acf_include( 'includes/fields/class-acf-field-color_picker.php' );
+ acf_include( 'includes/fields/class-acf-field-message.php' );
+ acf_include( 'includes/fields/class-acf-field-accordion.php' );
+ acf_include( 'includes/fields/class-acf-field-tab.php' );
+ acf_include( 'includes/fields/class-acf-field-group.php' );
+
+ /**
+ * Fires after field types have been included.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param int $major_version The major version of ACF.
+ */
+ do_action( 'acf/include_field_types', ACF_MAJOR_VERSION );
+
+ // Include locations.
+ acf_include( 'includes/locations/class-acf-location-post-type.php' );
+ acf_include( 'includes/locations/class-acf-location-post-template.php' );
+ acf_include( 'includes/locations/class-acf-location-post-status.php' );
+ acf_include( 'includes/locations/class-acf-location-post-format.php' );
+ acf_include( 'includes/locations/class-acf-location-post-category.php' );
+ acf_include( 'includes/locations/class-acf-location-post-taxonomy.php' );
+ acf_include( 'includes/locations/class-acf-location-post.php' );
+ acf_include( 'includes/locations/class-acf-location-page-template.php' );
+ acf_include( 'includes/locations/class-acf-location-page-type.php' );
+ acf_include( 'includes/locations/class-acf-location-page-parent.php' );
+ acf_include( 'includes/locations/class-acf-location-page.php' );
+ acf_include( 'includes/locations/class-acf-location-current-user.php' );
+ acf_include( 'includes/locations/class-acf-location-current-user-role.php' );
+ acf_include( 'includes/locations/class-acf-location-user-form.php' );
+ acf_include( 'includes/locations/class-acf-location-user-role.php' );
+ acf_include( 'includes/locations/class-acf-location-taxonomy.php' );
+ acf_include( 'includes/locations/class-acf-location-attachment.php' );
+ acf_include( 'includes/locations/class-acf-location-comment.php' );
+ acf_include( 'includes/locations/class-acf-location-widget.php' );
+ acf_include( 'includes/locations/class-acf-location-nav-menu.php' );
+ acf_include( 'includes/locations/class-acf-location-nav-menu-item.php' );
+
+ /**
+ * Fires after location types have been included.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param int $major_version The major version of ACF.
+ */
+ do_action( 'acf/include_location_rules', ACF_MAJOR_VERSION );
+
+ /**
+ * Fires during initialization. Used to add local fields.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param int $major_version The major version of ACF.
+ */
+ do_action( 'acf/include_fields', ACF_MAJOR_VERSION );
+
+ /**
+ * Fires after ACF is completely "initialized".
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param int $major_version The major version of ACF.
+ */
+ do_action( 'acf/init', ACF_MAJOR_VERSION );
+ }
+
+ /**
+ * register_post_types
+ *
+ * Registers the ACF post types.
+ *
+ * @date 22/10/2015
+ * @since 5.3.2
+ *
+ * @param void
+ * @return void
+ */
+ function register_post_types() {
+
+ // Vars.
+ $cap = acf_get_setting( 'capability' );
+
+ // Register the Field Group post type.
+ register_post_type(
+ 'acf-field-group',
+ array(
+ 'labels' => array(
+ 'name' => __( 'Field Groups', 'acf' ),
+ 'singular_name' => __( 'Field Group', 'acf' ),
+ 'add_new' => __( 'Add New', 'acf' ),
+ 'add_new_item' => __( 'Add New Field Group', 'acf' ),
+ 'edit_item' => __( 'Edit Field Group', 'acf' ),
+ 'new_item' => __( 'New Field Group', 'acf' ),
+ 'view_item' => __( 'View Field Group', 'acf' ),
+ 'search_items' => __( 'Search Field Groups', 'acf' ),
+ 'not_found' => __( 'No Field Groups found', 'acf' ),
+ 'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ),
+ ),
+ 'public' => false,
+ 'hierarchical' => true,
+ 'show_ui' => true,
+ 'show_in_menu' => false,
+ '_builtin' => false,
+ 'capability_type' => 'post',
+ 'capabilities' => array(
+ 'edit_post' => $cap,
+ 'delete_post' => $cap,
+ 'edit_posts' => $cap,
+ 'delete_posts' => $cap,
+ ),
+ 'supports' => array( 'title' ),
+ 'rewrite' => false,
+ 'query_var' => false,
+ )
+ );
+
+ // Register the Field post type.
+ register_post_type(
+ 'acf-field',
+ array(
+ 'labels' => array(
+ 'name' => __( 'Fields', 'acf' ),
+ 'singular_name' => __( 'Field', 'acf' ),
+ 'add_new' => __( 'Add New', 'acf' ),
+ 'add_new_item' => __( 'Add New Field', 'acf' ),
+ 'edit_item' => __( 'Edit Field', 'acf' ),
+ 'new_item' => __( 'New Field', 'acf' ),
+ 'view_item' => __( 'View Field', 'acf' ),
+ 'search_items' => __( 'Search Fields', 'acf' ),
+ 'not_found' => __( 'No Fields found', 'acf' ),
+ 'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ),
+ ),
+ 'public' => false,
+ 'hierarchical' => true,
+ 'show_ui' => false,
+ 'show_in_menu' => false,
+ '_builtin' => false,
+ 'capability_type' => 'post',
+ 'capabilities' => array(
+ 'edit_post' => $cap,
+ 'delete_post' => $cap,
+ 'edit_posts' => $cap,
+ 'delete_posts' => $cap,
+ ),
+ 'supports' => array( 'title' ),
+ 'rewrite' => false,
+ 'query_var' => false,
+ )
+ );
+ }
+
+ /**
+ * register_post_status
+ *
+ * Registers the ACF post statuses.
+ *
+ * @date 22/10/2015
+ * @since 5.3.2
+ *
+ * @param void
+ * @return void
+ */
+ function register_post_status() {
+
+ // Register the Disabled post status.
+ register_post_status(
+ 'acf-disabled',
+ array(
+ 'label' => _x( 'Disabled', 'post status', 'acf' ),
+ 'public' => true,
+ 'exclude_from_search' => false,
+ 'show_in_admin_all_list' => true,
+ 'show_in_admin_status_list' => true,
+ 'label_count' => _n_noop( 'Disabled (%s)', 'Disabled (%s)', 'acf' ),
+ )
+ );
+ }
+
+ /**
+ * posts_where
+ *
+ * Filters the $where clause allowing for custom WP_Query args.
+ *
+ * @date 31/8/19
+ * @since 5.8.1
+ *
+ * @param string $where The WHERE clause.
+ * @return WP_Query $wp_query The query object.
+ */
+ function posts_where( $where, $wp_query ) {
+ global $wpdb;
+
+ // Add custom "acf_field_key" arg.
+ if ( $field_key = $wp_query->get( 'acf_field_key' ) ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_name = %s", $field_key );
+ }
+
+ // Add custom "acf_field_name" arg.
+ if ( $field_name = $wp_query->get( 'acf_field_name' ) ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_excerpt = %s", $field_name );
+ }
+
+ // Add custom "acf_group_key" arg.
+ if ( $group_key = $wp_query->get( 'acf_group_key' ) ) {
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_name = %s", $group_key );
+ }
+
+ // Return.
+ return $where;
+ }
+
+ /**
+ * define
+ *
+ * Defines a constant if doesnt already exist.
+ *
+ * @date 3/5/17
+ * @since 5.5.13
+ *
+ * @param string $name The constant name.
+ * @param mixed $value The constant value.
+ * @return void
+ */
+ function define( $name, $value = true ) {
+ if ( ! defined( $name ) ) {
+ define( $name, $value );
+ }
+ }
+
+ /**
+ * has_setting
+ *
+ * Returns true if a setting exists for this name.
+ *
+ * @date 2/2/18
+ * @since 5.6.5
+ *
+ * @param string $name The setting name.
+ * @return boolean
+ */
+ function has_setting( $name ) {
+ return isset( $this->settings[ $name ] );
+ }
+
+ /**
+ * get_setting
+ *
+ * Returns a setting or null if doesn't exist.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param string $name The setting name.
+ * @return mixed
+ */
+ function get_setting( $name ) {
+ return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
+ }
+
+ /**
+ * update_setting
+ *
+ * Updates a setting for the given name and value.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param string $name The setting name.
+ * @param mixed $value The setting value.
+ * @return true
+ */
+ function update_setting( $name, $value ) {
+ $this->settings[ $name ] = $value;
+ return true;
+ }
+
+ /**
+ * get_data
+ *
+ * Returns data or null if doesn't exist.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param string $name The data name.
+ * @return mixed
+ */
+ function get_data( $name ) {
+ return isset( $this->data[ $name ] ) ? $this->data[ $name ] : null;
+ }
+
+ /**
+ * set_data
+ *
+ * Sets data for the given name and value.
+ *
+ * @date 28/09/13
+ * @since 5.0.0
+ *
+ * @param string $name The data name.
+ * @param mixed $value The data value.
+ * @return void
+ */
+ function set_data( $name, $value ) {
+ $this->data[ $name ] = $value;
+ }
+
+ /**
+ * get_instance
+ *
+ * Returns an instance or null if doesn't exist.
+ *
+ * @date 13/2/18
+ * @since 5.6.9
+ *
+ * @param string $class The instance class name.
+ * @return object
+ */
+ function get_instance( $class ) {
+ $name = strtolower( $class );
+ return isset( $this->instances[ $name ] ) ? $this->instances[ $name ] : null;
+ }
+
+ /**
+ * new_instance
+ *
+ * Creates and stores an instance of the given class.
+ *
+ * @date 13/2/18
+ * @since 5.6.9
+ *
+ * @param string $class The instance class name.
+ * @return object
+ */
+ function new_instance( $class ) {
+ $instance = new $class();
+ $name = strtolower( $class );
+ $this->instances[ $name ] = $instance;
+ return $instance;
+ }
+
+ /**
+ * Magic __isset method for backwards compatibility.
+ *
+ * @date 24/4/20
+ * @since 5.9.0
+ *
+ * @param string $key Key name.
+ * @return bool
+ */
+ public function __isset( $key ) {
+ return in_array( $key, array( 'locations', 'json' ) );
+ }
+
+ /**
+ * Magic __get method for backwards compatibility.
+ *
+ * @date 24/4/20
+ * @since 5.9.0
+ *
+ * @param string $key Key name.
+ * @return mixed
+ */
+ public function __get( $key ) {
+ switch ( $key ) {
+ case 'locations':
+ return acf_get_instance( 'ACF_Legacy_Locations' );
+ case 'json':
+ return acf_get_instance( 'ACF_Local_JSON' );
+ }
+ return null;
+ }
+ }
+
+ /*
+ * acf
+ *
+ * The main function responsible for returning the one true acf Instance to functions everywhere.
+ * Use this function like you would a global variable, except without needing to declare the global.
+ *
+ * Example:
+ *
+ * @date 4/09/13
+ * @since 4.3.0
+ *
+ * @param void
+ * @return ACF
+ */
+ function acf() {
+ global $acf;
+
+ // Instantiate only once.
+ if ( ! isset( $acf ) ) {
+ $acf = new ACF();
+ $acf->initialize();
+ }
+ return $acf;
+ }
+
+ // Instantiate.
+ acf();
endif; // class_exists check
diff --git a/assets/build/css/acf-field-group.css b/assets/build/css/acf-field-group.css
index d0afe76..7ba8696 100644
--- a/assets/build/css/acf-field-group.css
+++ b/assets/build/css/acf-field-group.css
@@ -255,7 +255,6 @@
}
.rule-groups .rule-group {
margin: 0 0 5px;
- /* Don't allow user to delete the first field group */
}
.rule-groups .rule-group h4 {
margin: 0 0 3px;
@@ -279,12 +278,13 @@
.rule-groups .rule-group tr:hover td.remove a {
visibility: visible;
}
-.rule-groups .rule-group:first-child tr:first-child td.remove a {
- visibility: hidden !important;
-}
.rule-groups .rule-group select:empty {
background: #f8f8f8;
}
+.rule-groups:not(.rule-groups-multiple) .rule-group:first-child tr:first-child td.remove a {
+ /* Don't allow user to delete the only rule group */
+ visibility: hidden !important;
+}
/*---------------------------------------------------------------------------------------------
*
diff --git a/assets/build/css/acf-field-group.min.css b/assets/build/css/acf-field-group.min.css
index 0484ca2..292cee4 100644
--- a/assets/build/css/acf-field-group.min.css
+++ b/assets/build/css/acf-field-group.min.css
@@ -1 +1 @@
-#acf-field-group-fields>.inside,#acf-field-group-locations>.inside,#acf-field-group-options>.inside{padding:0;margin:0}.postbox .handle-order-higher,.postbox .handle-order-lower{display:none}#minor-publishing-actions,#misc-publishing-actions #visibility,#misc-publishing-actions .edit-timestamp{display:none}#minor-publishing{border-bottom:0 none}#misc-pub-section{border-bottom:0 none}#misc-publishing-actions .misc-pub-section{border-bottom-color:#f5f5f5}#acf-field-group-fields{border:0 none;box-shadow:none}#acf-field-group-fields>.handlediv,#acf-field-group-fields>.hndle,#acf-field-group-fields>.postbox-header{display:none}#acf-field-group-fields a{text-decoration:none}#acf-field-group-fields a:active,#acf-field-group-fields a:focus{outline:0;box-shadow:none}#acf-field-group-fields .li-field-order{width:20%}#acf-field-group-fields .li-field-label{width:30%}#acf-field-group-fields .li-field-name{width:25%}#acf-field-group-fields .li-field-type{width:25%}#acf-field-group-fields .li-field-key{display:none}#acf-field-group-fields.show-field-keys .li-field-key,#acf-field-group-fields.show-field-keys .li-field-label,#acf-field-group-fields.show-field-keys .li-field-name,#acf-field-group-fields.show-field-keys .li-field-type{width:20%}#acf-field-group-fields.show-field-keys .li-field-key{display:block}#acf-field-group-fields .acf-field-list-wrap{border:#ccd0d4 solid 1px}#acf-field-group-fields .acf-field-list{background:#f5f5f5;margin-top:-1px}#acf-field-group-fields .acf-field-list .no-fields-message{padding:15px 15px;background:#fff;display:none}#acf-field-group-fields .acf-field-list.-empty .no-fields-message{display:block}.acf-admin-3-8 #acf-field-group-fields .acf-field-list-wrap{border-color:#dfdfdf}.acf-field-object{border-top:#eee solid 1px;background:#fff}.acf-field-object.ui-sortable-helper{border-top-color:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 4px rgba(0,0,0,.1)}.acf-field-object.ui-sortable-placeholder{box-shadow:0 -1px 0 0 #dfdfdf;visibility:visible!important;background:#f9f9f9;border-top-color:transparent;min-height:54px}.acf-field-object.ui-sortable-placeholder:after,.acf-field-object.ui-sortable-placeholder:before{visibility:hidden}.acf-field-object>.meta{display:none}.acf-field-object>.handle a{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.acf-field-object>.handle li{padding-top:10px;padding-bottom:10px;word-wrap:break-word}.acf-field-object>.handle .acf-icon{margin:1px 0 0;cursor:move;background:0 0;float:left;height:28px;line-height:26px;width:28px;font-size:13px;color:#444;position:relative;z-index:1}.acf-field-object>.handle strong{display:block;padding-bottom:6px;font-size:14px;line-height:14px;min-height:14px}.acf-field-object>.handle .row-options{visibility:hidden}.acf-field-object>.handle .row-options a{margin-right:4px}.acf-field-object>.handle .row-options a.delete-field{color:#a00}.acf-field-object>.handle .row-options a.delete-field:hover{color:red}.acf-field-object.open+.acf-field-object{border-top-color:#e1e1e1}.acf-field-object.open>.handle{background:#2a9bd9;border:#2696d3 solid 1px;text-shadow:#268fbb 0 1px 0;color:#fff;position:relative;margin:-1px -1px 0 -1px}.acf-field-object.open>.handle a{color:#fff!important}.acf-field-object.open>.handle a:hover{text-decoration:underline!important}.acf-field-object.open>.handle .acf-icon{border-color:#fff;color:#fff}.acf-field-object.open>.handle .acf-required{color:#fff}.acf-field-object.-hover>.handle .row-options,.acf-field-object:hover>.handle .row-options{visibility:visible}.acf-field-object>.settings{display:none;width:100%}.acf-field-object>.settings>.acf-table{border:none}.acf-field-object .rule-groups{margin-top:20px}.rule-groups h4{margin:3px 0}.rule-groups .rule-group{margin:0 0 5px}.rule-groups .rule-group h4{margin:0 0 3px}.rule-groups .rule-group td.param{width:35%}.rule-groups .rule-group td.operator{width:20%}.rule-groups .rule-group td.add{width:40px}.rule-groups .rule-group td.remove{width:28px;vertical-align:middle}.rule-groups .rule-group td.remove a{visibility:hidden}.rule-groups .rule-group tr:hover td.remove a{visibility:visible}.rule-groups .rule-group:first-child tr:first-child td.remove a{visibility:hidden!important}.rule-groups .rule-group select:empty{background:#f8f8f8}#acf-field-group-options tr[data-name=hide_on_screen] li{float:left;width:33%}@media (max-width:1100px){#acf-field-group-options tr[data-name=hide_on_screen] li{width:50%}}table.conditional-logic-rules{background:0 0;border:0 none;border-radius:0}table.conditional-logic-rules tbody td{background:0 0;border:0 none!important;padding:5px 2px!important}.acf-field-object-accordion .acf-field-setting-instructions,.acf-field-object-accordion .acf-field-setting-name,.acf-field-object-accordion .acf-field-setting-required,.acf-field-object-accordion .acf-field-setting-warning,.acf-field-object-accordion .acf-field-setting-wrapper,.acf-field-object-tab .acf-field-setting-instructions,.acf-field-object-tab .acf-field-setting-name,.acf-field-object-tab .acf-field-setting-required,.acf-field-object-tab .acf-field-setting-warning,.acf-field-object-tab .acf-field-setting-wrapper{display:none}.acf-field-object-accordion .li-field-name,.acf-field-object-tab .li-field-name{visibility:hidden}.acf-field-object+.acf-field-object-accordion:before,.acf-field-object+.acf-field-object-tab:before{display:block;content:"";height:5px;width:100%;background:#f5f5f5;border-top:#e1e1e1 solid 1px;border-bottom:#e1e1e1 solid 1px;margin-top:-1px}.acf-admin-3-8 .acf-field-object+.acf-field-object-accordion:before,.acf-admin-3-8 .acf-field-object+.acf-field-object-tab:before{border-color:#e5e5e5}.acf-field-object-accordion p:first-child,.acf-field-object-tab p:first-child{margin:.5em 0}.acf-field-object-accordion .acf-field-setting-instructions{display:table-row}.acf-field-object-message tr[data-name=instructions],.acf-field-object-message tr[data-name=name],.acf-field-object-message tr[data-name=required]{display:none!important}.acf-field-object-message .li-field-name{visibility:hidden}.acf-field-object-message textarea{height:175px!important}.acf-field-object-separator tr[data-name=instructions],.acf-field-object-separator tr[data-name=name],.acf-field-object-separator tr[data-name=required]{display:none!important}.acf-field-object-date-picker .acf-radio-list li,.acf-field-object-date-time-picker .acf-radio-list li,.acf-field-object-time-picker .acf-radio-list li{line-height:25px}.acf-field-object-date-picker .acf-radio-list span,.acf-field-object-date-time-picker .acf-radio-list span,.acf-field-object-time-picker .acf-radio-list span{display:inline-block;min-width:10em}.acf-field-object-date-picker .acf-radio-list input[type=text],.acf-field-object-date-time-picker .acf-radio-list input[type=text],.acf-field-object-time-picker .acf-radio-list input[type=text]{width:100px}.acf-field-object-date-time-picker .acf-radio-list span{min-width:15em}.acf-field-object-date-time-picker .acf-radio-list input[type=text]{width:200px}#slugdiv .inside{padding:12px;margin:0}#slugdiv input[type=text]{width:100%;height:28px;font-size:14px}html[dir=rtl] .acf-field-object.open>.handle{margin:-1px -1px 0}html[dir=rtl] .acf-field-object.open>.handle .acf-icon{float:right}html[dir=rtl] .acf-field-object.open>.handle .li-field-order{padding-left:0!important;padding-right:15px!important}@media only screen and (max-width:850px){td.acf-input,td.acf-label,tr.acf-field{display:block!important;width:auto!important;border:0 none!important}tr.acf-field{border-top:#ededed solid 1px!important;margin-bottom:0!important}td.acf-label{background:0 0!important;padding-bottom:0!important}}
\ No newline at end of file
+#acf-field-group-fields>.inside,#acf-field-group-locations>.inside,#acf-field-group-options>.inside{padding:0;margin:0}.postbox .handle-order-higher,.postbox .handle-order-lower{display:none}#minor-publishing-actions,#misc-publishing-actions #visibility,#misc-publishing-actions .edit-timestamp{display:none}#minor-publishing{border-bottom:0 none}#misc-pub-section{border-bottom:0 none}#misc-publishing-actions .misc-pub-section{border-bottom-color:#f5f5f5}#acf-field-group-fields{border:0 none;box-shadow:none}#acf-field-group-fields>.handlediv,#acf-field-group-fields>.hndle,#acf-field-group-fields>.postbox-header{display:none}#acf-field-group-fields a{text-decoration:none}#acf-field-group-fields a:active,#acf-field-group-fields a:focus{outline:0;box-shadow:none}#acf-field-group-fields .li-field-order{width:20%}#acf-field-group-fields .li-field-label{width:30%}#acf-field-group-fields .li-field-name{width:25%}#acf-field-group-fields .li-field-type{width:25%}#acf-field-group-fields .li-field-key{display:none}#acf-field-group-fields.show-field-keys .li-field-key,#acf-field-group-fields.show-field-keys .li-field-label,#acf-field-group-fields.show-field-keys .li-field-name,#acf-field-group-fields.show-field-keys .li-field-type{width:20%}#acf-field-group-fields.show-field-keys .li-field-key{display:block}#acf-field-group-fields .acf-field-list-wrap{border:#ccd0d4 solid 1px}#acf-field-group-fields .acf-field-list{background:#f5f5f5;margin-top:-1px}#acf-field-group-fields .acf-field-list .no-fields-message{padding:15px 15px;background:#fff;display:none}#acf-field-group-fields .acf-field-list.-empty .no-fields-message{display:block}.acf-admin-3-8 #acf-field-group-fields .acf-field-list-wrap{border-color:#dfdfdf}.acf-field-object{border-top:#eee solid 1px;background:#fff}.acf-field-object.ui-sortable-helper{border-top-color:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 4px rgba(0,0,0,.1)}.acf-field-object.ui-sortable-placeholder{box-shadow:0 -1px 0 0 #dfdfdf;visibility:visible!important;background:#f9f9f9;border-top-color:transparent;min-height:54px}.acf-field-object.ui-sortable-placeholder:after,.acf-field-object.ui-sortable-placeholder:before{visibility:hidden}.acf-field-object>.meta{display:none}.acf-field-object>.handle a{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.acf-field-object>.handle li{padding-top:10px;padding-bottom:10px;word-wrap:break-word}.acf-field-object>.handle .acf-icon{margin:1px 0 0;cursor:move;background:0 0;float:left;height:28px;line-height:26px;width:28px;font-size:13px;color:#444;position:relative;z-index:1}.acf-field-object>.handle strong{display:block;padding-bottom:6px;font-size:14px;line-height:14px;min-height:14px}.acf-field-object>.handle .row-options{visibility:hidden}.acf-field-object>.handle .row-options a{margin-right:4px}.acf-field-object>.handle .row-options a.delete-field{color:#a00}.acf-field-object>.handle .row-options a.delete-field:hover{color:red}.acf-field-object.open+.acf-field-object{border-top-color:#e1e1e1}.acf-field-object.open>.handle{background:#2a9bd9;border:#2696d3 solid 1px;text-shadow:#268fbb 0 1px 0;color:#fff;position:relative;margin:-1px -1px 0 -1px}.acf-field-object.open>.handle a{color:#fff!important}.acf-field-object.open>.handle a:hover{text-decoration:underline!important}.acf-field-object.open>.handle .acf-icon{border-color:#fff;color:#fff}.acf-field-object.open>.handle .acf-required{color:#fff}.acf-field-object.-hover>.handle .row-options,.acf-field-object:hover>.handle .row-options{visibility:visible}.acf-field-object>.settings{display:none;width:100%}.acf-field-object>.settings>.acf-table{border:none}.acf-field-object .rule-groups{margin-top:20px}.rule-groups h4{margin:3px 0}.rule-groups .rule-group{margin:0 0 5px}.rule-groups .rule-group h4{margin:0 0 3px}.rule-groups .rule-group td.param{width:35%}.rule-groups .rule-group td.operator{width:20%}.rule-groups .rule-group td.add{width:40px}.rule-groups .rule-group td.remove{width:28px;vertical-align:middle}.rule-groups .rule-group td.remove a{visibility:hidden}.rule-groups .rule-group tr:hover td.remove a{visibility:visible}.rule-groups .rule-group select:empty{background:#f8f8f8}.rule-groups:not(.rule-groups-multiple) .rule-group:first-child tr:first-child td.remove a{visibility:hidden!important}#acf-field-group-options tr[data-name=hide_on_screen] li{float:left;width:33%}@media (max-width:1100px){#acf-field-group-options tr[data-name=hide_on_screen] li{width:50%}}table.conditional-logic-rules{background:0 0;border:0 none;border-radius:0}table.conditional-logic-rules tbody td{background:0 0;border:0 none!important;padding:5px 2px!important}.acf-field-object-accordion .acf-field-setting-instructions,.acf-field-object-accordion .acf-field-setting-name,.acf-field-object-accordion .acf-field-setting-required,.acf-field-object-accordion .acf-field-setting-warning,.acf-field-object-accordion .acf-field-setting-wrapper,.acf-field-object-tab .acf-field-setting-instructions,.acf-field-object-tab .acf-field-setting-name,.acf-field-object-tab .acf-field-setting-required,.acf-field-object-tab .acf-field-setting-warning,.acf-field-object-tab .acf-field-setting-wrapper{display:none}.acf-field-object-accordion .li-field-name,.acf-field-object-tab .li-field-name{visibility:hidden}.acf-field-object+.acf-field-object-accordion:before,.acf-field-object+.acf-field-object-tab:before{display:block;content:"";height:5px;width:100%;background:#f5f5f5;border-top:#e1e1e1 solid 1px;border-bottom:#e1e1e1 solid 1px;margin-top:-1px}.acf-admin-3-8 .acf-field-object+.acf-field-object-accordion:before,.acf-admin-3-8 .acf-field-object+.acf-field-object-tab:before{border-color:#e5e5e5}.acf-field-object-accordion p:first-child,.acf-field-object-tab p:first-child{margin:.5em 0}.acf-field-object-accordion .acf-field-setting-instructions{display:table-row}.acf-field-object-message tr[data-name=instructions],.acf-field-object-message tr[data-name=name],.acf-field-object-message tr[data-name=required]{display:none!important}.acf-field-object-message .li-field-name{visibility:hidden}.acf-field-object-message textarea{height:175px!important}.acf-field-object-separator tr[data-name=instructions],.acf-field-object-separator tr[data-name=name],.acf-field-object-separator tr[data-name=required]{display:none!important}.acf-field-object-date-picker .acf-radio-list li,.acf-field-object-date-time-picker .acf-radio-list li,.acf-field-object-time-picker .acf-radio-list li{line-height:25px}.acf-field-object-date-picker .acf-radio-list span,.acf-field-object-date-time-picker .acf-radio-list span,.acf-field-object-time-picker .acf-radio-list span{display:inline-block;min-width:10em}.acf-field-object-date-picker .acf-radio-list input[type=text],.acf-field-object-date-time-picker .acf-radio-list input[type=text],.acf-field-object-time-picker .acf-radio-list input[type=text]{width:100px}.acf-field-object-date-time-picker .acf-radio-list span{min-width:15em}.acf-field-object-date-time-picker .acf-radio-list input[type=text]{width:200px}#slugdiv .inside{padding:12px;margin:0}#slugdiv input[type=text]{width:100%;height:28px;font-size:14px}html[dir=rtl] .acf-field-object.open>.handle{margin:-1px -1px 0}html[dir=rtl] .acf-field-object.open>.handle .acf-icon{float:right}html[dir=rtl] .acf-field-object.open>.handle .li-field-order{padding-left:0!important;padding-right:15px!important}@media only screen and (max-width:850px){td.acf-input,td.acf-label,tr.acf-field{display:block!important;width:auto!important;border:0 none!important}tr.acf-field{border-top:#ededed solid 1px!important;margin-bottom:0!important}td.acf-label{background:0 0!important;padding-bottom:0!important}}
\ No newline at end of file
diff --git a/assets/build/js/acf-field-group.js b/assets/build/js/acf-field-group.js
index 50c0de6..1b0c8c2 100644
--- a/assets/build/js/acf-field-group.js
+++ b/assets/build/js/acf-field-group.js
@@ -1266,6 +1266,36 @@
acf.registerFieldSetting( TimePickerDisplayFormatFieldSetting );
acf.registerFieldSetting( TimePickerReturnFormatFieldSetting );
+ /**
+ * Color Picker Settings.
+ *
+ * @date 16/12/20
+ * @since 5.9.4
+ *
+ * @param type $var Description. Default.
+ * @return type Description.
+ */
+ var ColorPickerReturnFormat = acf.FieldSetting.extend({
+ type: 'color_picker',
+ name: 'enable_opacity',
+ render: function(){
+ var $return_format_setting = this.fieldObject.$setting('return_format');
+ var $default_value_setting = this.fieldObject.$setting('default_value');
+ var $labelText = $return_format_setting.find('input[type="radio"][value="string"]').parent('label').contents().last();
+ var $defaultPlaceholder = $default_value_setting.find('input[type="text"]');
+ var l10n = acf.get('colorPickerL10n');
+
+ if( this.field.val() ) {
+ $labelText.replaceWith( l10n.rgba_string );
+ $defaultPlaceholder.attr('placeholder', 'rgba(255,255,255,0.8)');
+ } else {
+ $labelText.replaceWith( l10n.hex_string );
+ $defaultPlaceholder.attr('placeholder', '#FFFFFF');
+ }
+ }
+ });
+ acf.registerFieldSetting( ColorPickerReturnFormat );
+
})(jQuery);
(function($, undefined){
@@ -2166,6 +2196,7 @@
initialize: function(){
this.$el = $('#acf-field-group-locations');
+ this.updateGroupsClass();
},
onClickAddRule: function( e, $el ){
@@ -2186,6 +2217,7 @@
addRule: function( $tr ){
acf.duplicate( $tr );
+ this.updateGroupsClass();
},
removeRule: function( $tr ){
@@ -2194,6 +2226,13 @@
} else {
$tr.remove();
}
+
+ // Update h4
+ var $group = this.$('.rule-group:first');
+ $group.find('h4').text( acf.__('Show this field group if') );
+
+
+ this.updateGroupsClass();
},
changeRule: function( $rule ){
@@ -2238,7 +2277,24 @@
// remove all tr's except the first one
$group2.find('tr').not(':first').remove();
- }
+
+ // update the groups class
+ this.updateGroupsClass();
+ },
+
+ updateGroupsClass: function () {
+ var $group = this.$(".rule-group:last");
+
+ var $ruleGroups = $group.closest(".rule-groups");
+
+ var rows_count = $ruleGroups.find(".acf-table tr").length;
+
+ if (rows_count > 1) {
+ $ruleGroups.addClass("rule-groups-multiple");
+ } else {
+ $ruleGroups.removeClass("rule-groups-multiple");
+ }
+ },
});
})(jQuery);
diff --git a/assets/build/js/acf-field-group.min.js b/assets/build/js/acf-field-group.min.js
index 41a03a0..d38b9cc 100644
--- a/assets/build/js/acf-field-group.min.js
+++ b/assets/build/js/acf-field-group.min.js
@@ -1 +1 @@
-!function(n){new acf.Model({id:"fieldGroupManager",events:{"submit #post":"onSubmit",'click a[href="#"]':"onClick","click .submitdelete":"onClickTrash"},filters:{find_fields_args:"filterFindFieldArgs"},onSubmit:function(e,t){var i=n("#titlewrap #title");i.val()||(e.preventDefault(),acf.unlockForm(t),alert(acf.__("Field group title is required")),i.trigger("focus"))},onClick:function(e){e.preventDefault()},onClickTrash:function(e){confirm(acf.__("Move to trash. Are you sure?"))||e.preventDefault()},filterFindFieldArgs:function(e){return e.visible=!0,e}}),new acf.Model({id:"screenOptionsManager",wait:"prepare",events:{change:"onChange"},initialize:function(){var e=n("#adv-settings"),t=n("#acf-append-show-on-screen");e.find(".metabox-prefs").append(t.html()),e.find(".metabox-prefs br").remove(),t.remove(),this.$el=n("#acf-field-key-hide"),this.render()},isChecked:function(){return this.$el.prop("checked")},onChange:function(e,t){var i=this.isChecked()?1:0;acf.updateUserSetting("show_field_keys",i),this.render()},render:function(){this.isChecked()?n("#acf-field-group-fields").addClass("show-field-keys"):n("#acf-field-group-fields").removeClass("show-field-keys")}}),new acf.Model({actions:{new_field:"onNewField"},onNewField:function(e){var t,i;e.has("append")&&(i=e.get("append"),(t=e.$el.siblings('[data-name="'+i+'"]').first()).length&&((t=(i=t.children(".acf-input")).children("ul")).length||(i.wrapInner('
'),t=i.children("ul")),i=e.$(".acf-input").html(),i=n(""+i+""),t.append(i),t.attr("data-cols",t.children().length),e.remove()))}})}(jQuery),function(r){acf.FieldObject=acf.Model.extend({eventScope:".acf-field-object",events:{"click .edit-field":"onClickEdit","click .delete-field":"onClickDelete","click .duplicate-field":"duplicate","click .move-field":"move","change .field-type":"onChangeType","change .field-required":"onChangeRequired","blur .field-label":"onChangeLabel","blur .field-name":"onChangeName",change:"onChange",changed:"onChanged"},data:{id:0,key:"",type:""},setup:function(e){this.$el=e,this.inherit(e),this.prop("ID"),this.prop("parent"),this.prop("menu_order")},$input:function(e){return r("#"+this.getInputId()+"-"+e)},$meta:function(){return this.$(".meta:first")},$handle:function(){return this.$(".handle:first")},$settings:function(){return this.$(".settings:first")},$setting:function(e){return this.$(".acf-field-settings:first > .acf-field-setting-"+e)},getParent:function(){return acf.getFieldObjects({child:this.$el,limit:1}).pop()},getParents:function(){return acf.getFieldObjects({child:this.$el})},getFields:function(){return acf.getFieldObjects({parent:this.$el})},getInputName:function(){return"acf_fields["+this.get("id")+"]"},getInputId:function(){return"acf_fields-"+this.get("id")},newInput:function(e,t){var i=this.getInputId(),n=this.getInputName();e&&(i+="-"+e,n+="["+e+"]");t=r("").attr({id:i,name:n,value:t});return this.$("> .meta").append(t),t},getProp:function(e){if(this.has(e))return this.get(e);var t=this.$input(e),t=t.length?t.val():null;return this.set(e,t,!0),t},setProp:function(e,t){var i=this.$input(e);i.val();return i.length||(i=this.newInput(e,t)),null===t?i.remove():i.val(t),this.has(e)?this.set(e,t):this.set(e,t,!0),this},prop:function(e,t){return void 0!==t?this.setProp(e,t):this.getProp(e)},props:function(t){Object.keys(t).map(function(e){this.setProp(e,t[e])},this)},getLabel:function(){var e=this.prop("label");return e=""===e?acf.__("(no label)"):e},getName:function(){return this.prop("name")},getType:function(){return this.prop("type")},getTypeLabel:function(){var e=this.prop("type"),t=acf.get("fieldTypes");return t[e]?t[e].label:e},getKey:function(){return this.prop("key")},initialize:function(){this.addProFields()},addProFields:function(){var e;acf.data.fieldTypes.hasOwnProperty("clone")||((e=r(".field-type").not(".acf-free-field-type")).find('optgroup option[value="group"]').parent().append('"),e.find('optgroup option[value="image"]').parent().append('"),e.addClass("acf-free-field-type"))},render:function(){var e=this.$(".handle:first"),t=this.prop("menu_order"),i=this.getLabel(),n=this.prop("name"),a=this.getTypeLabel(),l=this.prop("key"),o=this.$input("required").prop("checked");e.find(".acf-icon").html(parseInt(t)+1),o&&(i+=' *'),e.find(".li-field-label strong a").html(i),e.find(".li-field-name").text(n),e.find(".li-field-type").text(a),e.find(".li-field-key").text(l),acf.doAction("render_field_object",this)},refresh:function(){acf.doAction("refresh_field_object",this)},isOpen:function(){return this.$el.hasClass("open")},onClickEdit:function(e){this.isOpen()?this.close():this.open()},open:function(){var e=this.$el.children(".settings");e.slideDown(),this.$el.addClass("open"),acf.doAction("open_field_object",this),this.trigger("openFieldObject"),acf.doAction("show",e)},close:function(){var e=this.$el.children(".settings");e.slideUp(),this.$el.removeClass("open"),acf.doAction("close_field_object",this),this.trigger("closeFieldObject"),acf.doAction("hide",e)},serialize:function(){return acf.serialize(this.$el,this.getInputName())},save:function(e){e=e||"settings","settings"!==this.getProp("save")&&(this.setProp("save",e),this.$el.attr("data-save",e),acf.doAction("save_field_object",this,e))},submit:function(){var e=this.getInputName(),t=this.get("save");this.isOpen()&&this.close(),"settings"==t||("meta"==t?this.$('> .settings [name^="'+e+'"]'):this.$('[name^="'+e+'"]')).remove(),acf.doAction("submit_field_object",this)},onChange:function(e,t){this.save(),acf.doAction("change_field_object",this)},onChanged:function(e,t,i,n){"save"!=i&&(-1<["menu_order","parent"].indexOf(i)?this.save("meta"):this.save(),-1<["menu_order","label","required","name","type","key"].indexOf(i)&&this.render(),acf.doAction("change_field_object_"+i,this,n))},onChangeLabel:function(e,t){t=t.val();this.set("label",t),""==this.prop("name")&&(t=acf.applyFilters("generate_field_object_name",acf.strSanitize(t),this),this.prop("name",t))},onChangeName:function(e,t){t=t.val();this.set("name",t),"field_"===t.substr(0,6)&&alert(acf.__('The string "field_" may not be used at the start of a field name'))},onChangeRequired:function(e,t){t=t.prop("checked")?1:0;this.set("required",t)},delete:function(e){e=acf.parseArgs(e,{animate:!0});var t,i=this.prop("ID");i&&(i=(t=r("#_acf_delete_fields")).val()+"|"+i,t.val(i)),acf.doAction("delete_field_object",this),e.animate?this.removeAnimate():this.remove()},onClickDelete:function(e,t){if(e.shiftKey)return this.delete();this.$el.addClass("-hover");acf.newTooltip({confirmRemove:!0,target:t,context:this,confirm:function(){this.delete()},cancel:function(){this.$el.removeClass("-hover")}})},removeAnimate:function(){var e=this,t=this.$el.parent(),i=acf.findFieldObjects({sibling:this.$el});acf.remove({target:this.$el,endHeight:i.length?0:50,complete:function(){e.remove(),acf.doAction("removed_field_object",e,t)}}),acf.doAction("remove_field_object",e,t)},duplicate:function(){var e=acf.uniqid("field_"),t=acf.duplicate({target:this.$el,search:this.get("id"),replace:e});t.attr("data-key",e);var i=acf.getFieldObject(t);this.isOpen()?this.close():i.open();var n=i.$setting("label input");setTimeout(function(){n.trigger("focus")},251);var a,l=i.prop("label"),o=i.prop("name"),c=o.split("_").pop(),t=acf.__("copy");acf.isNumeric(c)?(l=l.replace(c,a=+c+1),o=o.replace(c,a)):0===c.indexOf(t)?(a=+c.replace(t,""),l=l.replace(c,t+(a=a?a+1:2)),o=o.replace(c,t+a)):(l+=" ("+t+")",o+="_"+t),i.prop("ID",0),i.prop("label",l),i.prop("name",o),i.prop("key",e),acf.doAction("duplicate_field_object",this,i),acf.doAction("append_field_object",i)},wipe:function(){var e=this.get("id"),t=this.get("key"),i=acf.uniqid("field_");acf.rename({target:this.$el,search:e,replace:i}),this.set("id",i),this.set("prevId",e),this.set("prevKey",t),this.prop("key",i),this.prop("ID",0),this.$el.attr("data-key",i),this.$el.attr("data-id",i),acf.doAction("wipe_field_object",this)},move:function(){function t(e){return"settings"==e.get("save")}var i,n,a,l,o,c,d=t(this);d||acf.getFieldObjects({parent:this.$el}).map(function(e){d=t(e)||e.changed}),d?alert(acf.__("This field cannot be moved until its changes have been saved")):(i=this.prop("ID"),n=this,a=!1,l=function(e){a.loading(!1),a.content(e),a.on("submit","form",o)},o=function(e,t){e.preventDefault(),acf.startButtonLoading(a.$(".button"));e={action:"acf/field_group/move_field",field_id:i,field_group_id:a.$("select").val()};r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:c})},c=function(e){a.content(e),n.removeAnimate()},function(){a=acf.newPopup({title:acf.__("Move Custom Field"),loading:!0,width:"300px"});var e={action:"acf/field_group/move_field",field_id:i};r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:l})}())},onChangeType:function(e,t){this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=this.setTimeout(function(){this.changeType(t.val())},300)},changeType:function(e){var t=this.prop("type"),i=acf.strSlugify("acf-field-object-"+t),n=acf.strSlugify("acf-field-object-"+e);this.$el.removeClass(i).addClass(n),this.$el.attr("data-type",e),this.$el.data("type",e),this.has("xhr")&&this.get("xhr").abort();var a=this.$("> .settings > table > tbody"),n=a.children('[data-setting="'+t+'"]');if(this.set("settings-"+t,n),n.detach(),this.has("settings-"+e)){var l=this.get("settings-"+e);return this.$setting("conditional_logic").before(l),void this.set("type",e)}var o=r(' | |
');this.$setting("conditional_logic").before(o);l={action:"acf/field_group/render_field_settings",field:this.serialize(),prefix:this.getInputName()},l=r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(l),type:"post",dataType:"html",context:this,success:function(e){e&&(o.after(e),acf.doAction("append",a))},complete:function(){o.remove(),this.set("type",e)}});this.set("xhr",l)},updateParent:function(){var e=acf.get("post_id"),t=this.getParent();t&&(e=parseInt(t.prop("ID"))||t.prop("key")),this.prop("parent",e)}})}(jQuery),function(i){function n(e){return acf.strPascalCase(e||"")+"FieldSetting"}acf.registerFieldSetting=function(e){var t=e.prototype,t=n(t.type+" "+t.name);this.models[t]=e},acf.newFieldSetting=function(e){var t=e.get("setting")||"",i=e.get("name")||"",i=n(t+" "+i),i=acf.models[i]||null;return null!==i&&new i(e)},acf.getFieldSetting=function(e){return(e=e instanceof jQuery?acf.getField(e):e).setting};new acf.Model({actions:{new_field:"onNewField"},onNewField:function(e){e.setting=acf.newFieldSetting(e)}});acf.FieldSetting=acf.Model.extend({field:!1,type:"",name:"",wait:"ready",eventScope:".acf-field",events:{change:"render"},setup:function(e){var t=e.$el;this.$el=t,this.field=e,this.$fieldObject=t.closest(".acf-field-object"),this.fieldObject=acf.getFieldObject(this.$fieldObject),i.extend(this.data,e.data)},initialize:function(){this.render()},render:function(){}});var e=acf.FieldSetting.extend({type:"",name:"",render:function(){var e=this.$('input[type="radio"]:checked');"other"!=e.val()&&this.$('input[type="text"]').val(e.val())}}),t=e.extend({type:"date_picker",name:"display_format"}),a=e.extend({type:"date_picker",name:"return_format"});acf.registerFieldSetting(t),acf.registerFieldSetting(a);t=e.extend({type:"date_time_picker",name:"display_format"}),a=e.extend({type:"date_time_picker",name:"return_format"});acf.registerFieldSetting(t),acf.registerFieldSetting(a);a=e.extend({type:"time_picker",name:"display_format"}),e=e.extend({name:"return_format"});acf.registerFieldSetting(a),acf.registerFieldSetting(e)}(jQuery),function(l){var e=acf.FieldSetting.extend({type:"",name:"conditional_logic",events:{"change .conditions-toggle":"onChangeToggle","click .add-conditional-group":"onClickAddGroup","focus .condition-rule-field":"onFocusField","change .condition-rule-field":"onChangeField","change .condition-rule-operator":"onChangeOperator","click .add-conditional-rule":"onClickAdd","click .remove-conditional-rule":"onClickRemove"},$rule:!1,scope:function(e){return this.$rule=e,this},ruleData:function(e,t){return this.$rule.data.apply(this.$rule,arguments)},$input:function(e){return this.$rule.find(".condition-rule-"+e)},$td:function(e){return this.$rule.find("td."+e)},$toggle:function(){return this.$(".conditions-toggle")},$control:function(){return this.$(".rule-groups")},$groups:function(){return this.$(".rule-group")},$rules:function(){return this.$(".rule")},open:function(){var e=this.$control();e.show(),acf.enable(e)},close:function(){var e=this.$control();e.hide(),acf.disable(e)},render:function(){this.$toggle().prop("checked")?(this.renderRules(),this.open()):this.close()},renderRules:function(){var e=this;this.$rules().each(function(){e.renderRule(l(this))})},renderRule:function(e){this.scope(e),this.renderField(),this.renderOperator(),this.renderValue()},renderField:function(){var i=[],n=this.fieldObject.cid,e=this.$input("field");acf.getFieldObjects().map(function(e){var t={id:e.getKey(),text:e.getLabel()};e.cid===n&&(t.text+=acf.__("(this field)"),t.disabled=!0),acf.getConditionTypes({fieldType:e.getType()}).length||(t.disabled=!0);e=e.getParents().length;t.text="- ".repeat(e)+t.text,i.push(t)}),i.length||i.push({id:"",text:acf.__("No toggle fields available")}),acf.renderSelect(e,i),this.ruleData("field",e.val())},renderOperator:function(){var e,t,i;this.ruleData("field")&&((e=this.$input("operator")).val(),t=[],null===e.val()&&acf.renderSelect(e,[{id:this.ruleData("operator"),text:""}]),i=acf.findFieldObject(this.ruleData("field")),i=acf.getFieldObject(i),acf.getConditionTypes({fieldType:i.getType()}).map(function(e){t.push({id:e.prototype.operator,text:e.prototype.label})}),acf.renderSelect(e,t),this.ruleData("operator",e.val()))},renderValue:function(){var t,e,i,n,a;this.ruleData("field")&&this.ruleData("operator")&&(t=this.$input("value"),e=this.$td("value"),i=t.val(),n=acf.findFieldObject(this.ruleData("field")),n=acf.getFieldObject(n),(n=acf.getConditionTypes({fieldType:n.getType(),operator:this.ruleData("operator")})[0].prototype.choices(n))instanceof Array?(a=l(""),acf.renderSelect(a,n)):a=l(n),t.detach(),e.html(a),setTimeout(function(){["class","name","id"].map(function(e){a.attr(e,t.attr(e))})},0),a.prop("disabled")||acf.val(a,i,!0),this.ruleData("value",a.val()))},onChangeToggle:function(){this.render()},onClickAddGroup:function(e,t){this.addGroup()},addGroup:function(){var e=this.$(".rule-group:last"),e=acf.duplicate(e);e.find("h4").text(acf.__("or")),e.find("tr").not(":first").remove(),this.fieldObject.save()},onFocusField:function(e,t){this.renderField()},onChangeField:function(e,t){this.scope(t.closest(".rule")),this.ruleData("field",t.val()),this.renderOperator(),this.renderValue()},onChangeOperator:function(e,t){this.scope(t.closest(".rule")),this.ruleData("operator",t.val()),this.renderValue()},onClickAdd:function(e,t){t=acf.duplicate(t.closest(".rule"));this.renderRule(t)},onClickRemove:function(e,t){t=t.closest(".rule");this.fieldObject.save(),0==t.siblings(".rule").length&&t.closest(".rule-group").remove(),t.remove()}});acf.registerFieldSetting(e);new acf.Model({actions:{duplicate_field_objects:"onDuplicateFieldObjects"},onDuplicateFieldObjects:function(e,t,i){var n={},a=l();e.map(function(e){n[e.get("prevKey")]=e.get("key"),a=a.add(e.$(".condition-rule-field"))}),a.each(function(){var e=l(this),t=e.val();t&&n[t]&&(e.find("option:selected").attr("value",n[t]),e.val(n[t]))})}})}(jQuery),function(l){acf.findFieldObject=function(e){return acf.findFieldObjects({key:e,limit:1})},acf.findFieldObjects=function(e){e=e||{};var t=".acf-field-object",i=!1;return(e=acf.parseArgs(e,{id:"",key:"",type:"",limit:!1,list:null,parent:!1,sibling:!1,child:!1})).id&&(t+='[data-id="'+e.id+'"]'),e.key&&(t+='[data-key="'+e.key+'"]'),e.type&&(t+='[data-type="'+e.type+'"]'),i=e.list?e.list.children(t):e.parent?e.parent.find(t):e.sibling?e.sibling.siblings(t):e.child?e.child.parents(t):l(t),i=e.limit?i.slice(0,e.limit):i},acf.getFieldObject=function(e){return(e="string"==typeof e?acf.findFieldObject(e):e).data("acf")||acf.newFieldObject(e)},acf.getFieldObjects=function(e){var e=acf.findFieldObjects(e),t=[];return e.each(function(){var e=acf.getFieldObject(l(this));t.push(e)}),t},acf.newFieldObject=function(e){e=new acf.FieldObject(e);return acf.doAction("new_field_object",e),e};new acf.Model({priority:5,initialize:function(){["prepare","ready","append","remove"].map(function(e){this.addFieldActions(e)},this)},addFieldActions:function(e){var n=e+"_field_objects",a=e+"_field_object",l=e+"FieldObject";acf.addAction(e,function(e){var t,i=acf.getFieldObjects({parent:e});i.length&&((t=acf.arrayArgs(arguments)).splice(0,1,n,i),acf.doAction.apply(null,t))},5),acf.addAction(n,function(e){var t=acf.arrayArgs(arguments);t.unshift(a),e.map(function(e){t[1]=e,acf.doAction.apply(null,t)})},5),acf.addAction(a,function(t){var i=acf.arrayArgs(arguments);i.unshift(a);["type","name","key"].map(function(e){i[0]=a+"/"+e+"="+t.get(e),acf.doAction.apply(null,i)}),i.splice(0,2),t.trigger(l,i)},5)}}),new acf.Model({id:"fieldManager",events:{"submit #post":"onSubmit","mouseenter .acf-field-list":"onHoverSortable","click .add-field":"onClickAdd"},actions:{removed_field_object:"onRemovedField",sortstop_field_object:"onReorderField",delete_field_object:"onDeleteField",change_field_object_type:"onChangeFieldType",duplicate_field_object:"onDuplicateField"},onSubmit:function(e,t){acf.getFieldObjects().map(function(e){e.submit()})},setFieldMenuOrder:function(e){this.renderFields(e.$el.parent())},onHoverSortable:function(e,n){n.hasClass("ui-sortable")||n.sortable({handle:".acf-sortable-handle",connectWith:".acf-field-list",start:function(e,t){var i=acf.getFieldObject(t.item);t.placeholder.height(t.item.height()),acf.doAction("sortstart_field_object",i,n)},update:function(e,t){t=acf.getFieldObject(t.item);acf.doAction("sortstop_field_object",t,n)}})},onRemovedField:function(e,t){this.renderFields(t)},onReorderField:function(e,t){e.updateParent(),this.renderFields(t)},onDeleteField:function(e){e.getFields().map(function(e){e.delete({animate:!1})})},onChangeFieldType:function(e){},onDuplicateField:function(e,t){var i=t.getFields();i.length&&(i.map(function(e){e.wipe(),e.updateParent()}),acf.doAction("duplicate_field_objects",i,t,e)),this.setFieldMenuOrder(t)},renderFields:function(e){var t=acf.getFieldObjects({list:e});t.length?(e.removeClass("-empty"),t.map(function(e,t){e.prop("menu_order",t)})):e.addClass("-empty")},onClickAdd:function(e,t){t=t.closest(".acf-tfoot").siblings(".acf-field-list");this.addField(t)},addField:function(i){var e=l("#tmpl-acf-field").html(),t=l(e),n=t.data("id"),e=acf.uniqid("field_"),t=acf.duplicate({target:t,search:n,replace:e,append:function(e,t){i.append(t)}}),n=acf.getFieldObject(t);n.prop("key",e),n.prop("ID",0),n.prop("label",""),n.prop("name",""),t.attr("data-key",e),t.attr("data-id",e),n.updateParent();var a=n.$input("label");setTimeout(function(){a.trigger("focus")},251),n.open(),this.renderFields(i),acf.doAction("add_field_object",n),acf.doAction("append_field_object",n)}})}(jQuery),function(a){new acf.Model({id:"locationManager",wait:"ready",events:{"click .add-location-rule":"onClickAddRule","click .add-location-group":"onClickAddGroup","click .remove-location-rule":"onClickRemoveRule","change .refresh-location-rule":"onChangeRemoveRule"},initialize:function(){this.$el=a("#acf-field-group-locations")},onClickAddRule:function(e,t){this.addRule(t.closest("tr"))},onClickRemoveRule:function(e,t){this.removeRule(t.closest("tr"))},onChangeRemoveRule:function(e,t){this.changeRule(t.closest("tr"))},onClickAddGroup:function(e,t){this.addGroup()},addRule:function(e){acf.duplicate(e)},removeRule:function(e){(0==e.siblings("tr").length?e.closest(".rule-group"):e).remove()},changeRule:function(t){var e=t.closest(".rule-group"),i=t.find("td.param select").attr("name").replace("[param]",""),n={action:"acf/field_group/render_location_rule"};n.rule=acf.serialize(t,i),n.rule.id=t.data("id"),n.rule.group=e.data("id"),acf.disable(t.find("td.value")),a.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(n),type:"post",dataType:"html",success:function(e){e&&t.replaceWith(e)}})},addGroup:function(){var e=this.$(".rule-group:last");$group2=acf.duplicate(e),$group2.find("h4").text(acf.__("or")),$group2.find("tr").not(":first").remove()}})}(jQuery),function(l){var e=acf.getCompatibility(acf);e.field_group={save_field:function(e,t){t=void 0!==t?t:"settings",acf.getFieldObject(e).save(t)},delete_field:function(e,t){t=void 0===t||t,acf.getFieldObject(e).delete({animate:t})},update_field_meta:function(e,t,i){acf.getFieldObject(e).prop(t,i)},delete_field_meta:function(e,t){acf.getFieldObject(e).prop(t,null)}},e.field_group.field_object=acf.model.extend({type:"",o:{},$field:null,$settings:null,tag:function(e){var t=this.type,i=e.split("_");return i.splice(1,0,"field"),e=i.join("_"),t&&(e+="/type="+t),e},selector:function(){var e=".acf-field-object",t=this.type;return t&&(e+="-"+t,e=acf.str_replace("_","-",e)),e},_add_action:function(e,t){var i=this;acf.add_action(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_filter:function(e,t){var i=this;acf.add_filter(this.tag(e),function(e){i.set("$field",e),i[t].apply(i,arguments)})},_add_event:function(e,t){var i=this,n=e.substr(0,e.indexOf(" ")),a=e.substr(e.indexOf(" ")+1),e=this.selector();l(document).on(n,e+" "+a,function(e){e.$el=l(this),e.$field=e.$el.closest(".acf-field-object"),i.set("$field",e.$field),i[t].apply(i,[e])})},_set_$field:function(){this.o=this.$field.data(),this.$settings=this.$field.find("> .settings > table > tbody"),this.focus()},focus:function(){},setting:function(e){return this.$settings.find("> .acf-field-setting-"+e)}});new acf.Model({actions:{open_field_object:"onOpenFieldObject",close_field_object:"onCloseFieldObject",add_field_object:"onAddFieldObject",duplicate_field_object:"onDuplicateFieldObject",delete_field_object:"onDeleteFieldObject",change_field_object_type:"onChangeFieldObjectType",change_field_object_label:"onChangeFieldObjectLabel",change_field_object_name:"onChangeFieldObjectName",change_field_object_parent:"onChangeFieldObjectParent",sortstop_field_object:"onChangeFieldObjectParent"},onOpenFieldObject:function(e){acf.doAction("open_field",e.$el),acf.doAction("open_field/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onCloseFieldObject:function(e){acf.doAction("close_field",e.$el),acf.doAction("close_field/type="+e.get("type"),e.$el)},onAddFieldObject:function(e){acf.doAction("add_field",e.$el),acf.doAction("add_field/type="+e.get("type"),e.$el)},onDuplicateFieldObject:function(e){acf.doAction("duplicate_field",e.$el),acf.doAction("duplicate_field/type="+e.get("type"),e.$el)},onDeleteFieldObject:function(e){acf.doAction("delete_field",e.$el),acf.doAction("delete_field/type="+e.get("type"),e.$el)},onChangeFieldObjectType:function(e){acf.doAction("change_field_type",e.$el),acf.doAction("change_field_type/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onChangeFieldObjectLabel:function(e){acf.doAction("change_field_label",e.$el),acf.doAction("change_field_label/type="+e.get("type"),e.$el)},onChangeFieldObjectName:function(e){acf.doAction("change_field_name",e.$el),acf.doAction("change_field_name/type="+e.get("type"),e.$el)},onChangeFieldObjectParent:function(e){acf.doAction("update_field_parent",e.$el)}})}(jQuery);
\ No newline at end of file
+!function(n){new acf.Model({id:"fieldGroupManager",events:{"submit #post":"onSubmit",'click a[href="#"]':"onClick","click .submitdelete":"onClickTrash"},filters:{find_fields_args:"filterFindFieldArgs"},onSubmit:function(e,t){var i=n("#titlewrap #title");i.val()||(e.preventDefault(),acf.unlockForm(t),alert(acf.__("Field group title is required")),i.trigger("focus"))},onClick:function(e){e.preventDefault()},onClickTrash:function(e){confirm(acf.__("Move to trash. Are you sure?"))||e.preventDefault()},filterFindFieldArgs:function(e){return e.visible=!0,e}}),new acf.Model({id:"screenOptionsManager",wait:"prepare",events:{change:"onChange"},initialize:function(){var e=n("#adv-settings"),t=n("#acf-append-show-on-screen");e.find(".metabox-prefs").append(t.html()),e.find(".metabox-prefs br").remove(),t.remove(),this.$el=n("#acf-field-key-hide"),this.render()},isChecked:function(){return this.$el.prop("checked")},onChange:function(e,t){var i=this.isChecked()?1:0;acf.updateUserSetting("show_field_keys",i),this.render()},render:function(){this.isChecked()?n("#acf-field-group-fields").addClass("show-field-keys"):n("#acf-field-group-fields").removeClass("show-field-keys")}}),new acf.Model({actions:{new_field:"onNewField"},onNewField:function(e){var t,i;e.has("append")&&(i=e.get("append"),(t=e.$el.siblings('[data-name="'+i+'"]').first()).length&&((t=(i=t.children(".acf-input")).children("ul")).length||(i.wrapInner(''),t=i.children("ul")),i=e.$(".acf-input").html(),i=n(""+i+""),t.append(i),t.attr("data-cols",t.children().length),e.remove()))}})}(jQuery),function(r){acf.FieldObject=acf.Model.extend({eventScope:".acf-field-object",events:{"click .edit-field":"onClickEdit","click .delete-field":"onClickDelete","click .duplicate-field":"duplicate","click .move-field":"move","change .field-type":"onChangeType","change .field-required":"onChangeRequired","blur .field-label":"onChangeLabel","blur .field-name":"onChangeName",change:"onChange",changed:"onChanged"},data:{id:0,key:"",type:""},setup:function(e){this.$el=e,this.inherit(e),this.prop("ID"),this.prop("parent"),this.prop("menu_order")},$input:function(e){return r("#"+this.getInputId()+"-"+e)},$meta:function(){return this.$(".meta:first")},$handle:function(){return this.$(".handle:first")},$settings:function(){return this.$(".settings:first")},$setting:function(e){return this.$(".acf-field-settings:first > .acf-field-setting-"+e)},getParent:function(){return acf.getFieldObjects({child:this.$el,limit:1}).pop()},getParents:function(){return acf.getFieldObjects({child:this.$el})},getFields:function(){return acf.getFieldObjects({parent:this.$el})},getInputName:function(){return"acf_fields["+this.get("id")+"]"},getInputId:function(){return"acf_fields-"+this.get("id")},newInput:function(e,t){var i=this.getInputId(),n=this.getInputName();e&&(i+="-"+e,n+="["+e+"]");t=r("").attr({id:i,name:n,value:t});return this.$("> .meta").append(t),t},getProp:function(e){if(this.has(e))return this.get(e);var t=this.$input(e),t=t.length?t.val():null;return this.set(e,t,!0),t},setProp:function(e,t){var i=this.$input(e);i.val();return i.length||(i=this.newInput(e,t)),null===t?i.remove():i.val(t),this.has(e)?this.set(e,t):this.set(e,t,!0),this},prop:function(e,t){return void 0!==t?this.setProp(e,t):this.getProp(e)},props:function(t){Object.keys(t).map(function(e){this.setProp(e,t[e])},this)},getLabel:function(){var e=this.prop("label");return e=""===e?acf.__("(no label)"):e},getName:function(){return this.prop("name")},getType:function(){return this.prop("type")},getTypeLabel:function(){var e=this.prop("type"),t=acf.get("fieldTypes");return t[e]?t[e].label:e},getKey:function(){return this.prop("key")},initialize:function(){this.addProFields()},addProFields:function(){var e;acf.data.fieldTypes.hasOwnProperty("clone")||((e=r(".field-type").not(".acf-free-field-type")).find('optgroup option[value="group"]').parent().append('"),e.find('optgroup option[value="image"]').parent().append('"),e.addClass("acf-free-field-type"))},render:function(){var e=this.$(".handle:first"),t=this.prop("menu_order"),i=this.getLabel(),n=this.prop("name"),a=this.getTypeLabel(),l=this.prop("key"),o=this.$input("required").prop("checked");e.find(".acf-icon").html(parseInt(t)+1),o&&(i+=' *'),e.find(".li-field-label strong a").html(i),e.find(".li-field-name").text(n),e.find(".li-field-type").text(a),e.find(".li-field-key").text(l),acf.doAction("render_field_object",this)},refresh:function(){acf.doAction("refresh_field_object",this)},isOpen:function(){return this.$el.hasClass("open")},onClickEdit:function(e){this.isOpen()?this.close():this.open()},open:function(){var e=this.$el.children(".settings");e.slideDown(),this.$el.addClass("open"),acf.doAction("open_field_object",this),this.trigger("openFieldObject"),acf.doAction("show",e)},close:function(){var e=this.$el.children(".settings");e.slideUp(),this.$el.removeClass("open"),acf.doAction("close_field_object",this),this.trigger("closeFieldObject"),acf.doAction("hide",e)},serialize:function(){return acf.serialize(this.$el,this.getInputName())},save:function(e){e=e||"settings","settings"!==this.getProp("save")&&(this.setProp("save",e),this.$el.attr("data-save",e),acf.doAction("save_field_object",this,e))},submit:function(){var e=this.getInputName(),t=this.get("save");this.isOpen()&&this.close(),"settings"==t||("meta"==t?this.$('> .settings [name^="'+e+'"]'):this.$('[name^="'+e+'"]')).remove(),acf.doAction("submit_field_object",this)},onChange:function(e,t){this.save(),acf.doAction("change_field_object",this)},onChanged:function(e,t,i,n){"save"!=i&&(-1<["menu_order","parent"].indexOf(i)?this.save("meta"):this.save(),-1<["menu_order","label","required","name","type","key"].indexOf(i)&&this.render(),acf.doAction("change_field_object_"+i,this,n))},onChangeLabel:function(e,t){t=t.val();this.set("label",t),""==this.prop("name")&&(t=acf.applyFilters("generate_field_object_name",acf.strSanitize(t),this),this.prop("name",t))},onChangeName:function(e,t){t=t.val();this.set("name",t),"field_"===t.substr(0,6)&&alert(acf.__('The string "field_" may not be used at the start of a field name'))},onChangeRequired:function(e,t){t=t.prop("checked")?1:0;this.set("required",t)},delete:function(e){e=acf.parseArgs(e,{animate:!0});var t,i=this.prop("ID");i&&(i=(t=r("#_acf_delete_fields")).val()+"|"+i,t.val(i)),acf.doAction("delete_field_object",this),e.animate?this.removeAnimate():this.remove()},onClickDelete:function(e,t){if(e.shiftKey)return this.delete();this.$el.addClass("-hover");acf.newTooltip({confirmRemove:!0,target:t,context:this,confirm:function(){this.delete()},cancel:function(){this.$el.removeClass("-hover")}})},removeAnimate:function(){var e=this,t=this.$el.parent(),i=acf.findFieldObjects({sibling:this.$el});acf.remove({target:this.$el,endHeight:i.length?0:50,complete:function(){e.remove(),acf.doAction("removed_field_object",e,t)}}),acf.doAction("remove_field_object",e,t)},duplicate:function(){var e=acf.uniqid("field_"),t=acf.duplicate({target:this.$el,search:this.get("id"),replace:e});t.attr("data-key",e);var i=acf.getFieldObject(t);this.isOpen()?this.close():i.open();var n=i.$setting("label input");setTimeout(function(){n.trigger("focus")},251);var a,l=i.prop("label"),o=i.prop("name"),c=o.split("_").pop(),t=acf.__("copy");acf.isNumeric(c)?(l=l.replace(c,a=+c+1),o=o.replace(c,a)):0===c.indexOf(t)?(a=+c.replace(t,""),l=l.replace(c,t+(a=a?a+1:2)),o=o.replace(c,t+a)):(l+=" ("+t+")",o+="_"+t),i.prop("ID",0),i.prop("label",l),i.prop("name",o),i.prop("key",e),acf.doAction("duplicate_field_object",this,i),acf.doAction("append_field_object",i)},wipe:function(){var e=this.get("id"),t=this.get("key"),i=acf.uniqid("field_");acf.rename({target:this.$el,search:e,replace:i}),this.set("id",i),this.set("prevId",e),this.set("prevKey",t),this.prop("key",i),this.prop("ID",0),this.$el.attr("data-key",i),this.$el.attr("data-id",i),acf.doAction("wipe_field_object",this)},move:function(){function t(e){return"settings"==e.get("save")}var i,n,a,l,o,c,d=t(this);d||acf.getFieldObjects({parent:this.$el}).map(function(e){d=t(e)||e.changed}),d?alert(acf.__("This field cannot be moved until its changes have been saved")):(i=this.prop("ID"),n=this,a=!1,l=function(e){a.loading(!1),a.content(e),a.on("submit","form",o)},o=function(e,t){e.preventDefault(),acf.startButtonLoading(a.$(".button"));e={action:"acf/field_group/move_field",field_id:i,field_group_id:a.$("select").val()};r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:c})},c=function(e){a.content(e),n.removeAnimate()},function(){a=acf.newPopup({title:acf.__("Move Custom Field"),loading:!0,width:"300px"});var e={action:"acf/field_group/move_field",field_id:i};r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:l})}())},onChangeType:function(e,t){this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=this.setTimeout(function(){this.changeType(t.val())},300)},changeType:function(e){var t=this.prop("type"),i=acf.strSlugify("acf-field-object-"+t),n=acf.strSlugify("acf-field-object-"+e);this.$el.removeClass(i).addClass(n),this.$el.attr("data-type",e),this.$el.data("type",e),this.has("xhr")&&this.get("xhr").abort();var a=this.$("> .settings > table > tbody"),n=a.children('[data-setting="'+t+'"]');if(this.set("settings-"+t,n),n.detach(),this.has("settings-"+e)){var l=this.get("settings-"+e);return this.$setting("conditional_logic").before(l),void this.set("type",e)}var o=r(' | |
');this.$setting("conditional_logic").before(o);l={action:"acf/field_group/render_field_settings",field:this.serialize(),prefix:this.getInputName()},l=r.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(l),type:"post",dataType:"html",context:this,success:function(e){e&&(o.after(e),acf.doAction("append",a))},complete:function(){o.remove(),this.set("type",e)}});this.set("xhr",l)},updateParent:function(){var e=acf.get("post_id"),t=this.getParent();t&&(e=parseInt(t.prop("ID"))||t.prop("key")),this.prop("parent",e)}})}(jQuery),function(i){function n(e){return acf.strPascalCase(e||"")+"FieldSetting"}acf.registerFieldSetting=function(e){var t=e.prototype,t=n(t.type+" "+t.name);this.models[t]=e},acf.newFieldSetting=function(e){var t=e.get("setting")||"",i=e.get("name")||"",i=n(t+" "+i),i=acf.models[i]||null;return null!==i&&new i(e)},acf.getFieldSetting=function(e){return(e=e instanceof jQuery?acf.getField(e):e).setting};new acf.Model({actions:{new_field:"onNewField"},onNewField:function(e){e.setting=acf.newFieldSetting(e)}});acf.FieldSetting=acf.Model.extend({field:!1,type:"",name:"",wait:"ready",eventScope:".acf-field",events:{change:"render"},setup:function(e){var t=e.$el;this.$el=t,this.field=e,this.$fieldObject=t.closest(".acf-field-object"),this.fieldObject=acf.getFieldObject(this.$fieldObject),i.extend(this.data,e.data)},initialize:function(){this.render()},render:function(){}});var e=acf.FieldSetting.extend({type:"",name:"",render:function(){var e=this.$('input[type="radio"]:checked');"other"!=e.val()&&this.$('input[type="text"]').val(e.val())}}),t=e.extend({type:"date_picker",name:"display_format"}),a=e.extend({type:"date_picker",name:"return_format"});acf.registerFieldSetting(t),acf.registerFieldSetting(a);t=e.extend({type:"date_time_picker",name:"display_format"}),a=e.extend({type:"date_time_picker",name:"return_format"});acf.registerFieldSetting(t),acf.registerFieldSetting(a);a=e.extend({type:"time_picker",name:"display_format"}),e=e.extend({name:"return_format"});acf.registerFieldSetting(a),acf.registerFieldSetting(e);e=acf.FieldSetting.extend({type:"color_picker",name:"enable_opacity",render:function(){var e=this.fieldObject.$setting("return_format"),t=this.fieldObject.$setting("default_value"),i=e.find('input[type="radio"][value="string"]').parent("label").contents().last(),e=t.find('input[type="text"]'),t=acf.get("colorPickerL10n");this.field.val()?(i.replaceWith(t.rgba_string),e.attr("placeholder","rgba(255,255,255,0.8)")):(i.replaceWith(t.hex_string),e.attr("placeholder","#FFFFFF"))}});acf.registerFieldSetting(e)}(jQuery),function(l){var e=acf.FieldSetting.extend({type:"",name:"conditional_logic",events:{"change .conditions-toggle":"onChangeToggle","click .add-conditional-group":"onClickAddGroup","focus .condition-rule-field":"onFocusField","change .condition-rule-field":"onChangeField","change .condition-rule-operator":"onChangeOperator","click .add-conditional-rule":"onClickAdd","click .remove-conditional-rule":"onClickRemove"},$rule:!1,scope:function(e){return this.$rule=e,this},ruleData:function(e,t){return this.$rule.data.apply(this.$rule,arguments)},$input:function(e){return this.$rule.find(".condition-rule-"+e)},$td:function(e){return this.$rule.find("td."+e)},$toggle:function(){return this.$(".conditions-toggle")},$control:function(){return this.$(".rule-groups")},$groups:function(){return this.$(".rule-group")},$rules:function(){return this.$(".rule")},open:function(){var e=this.$control();e.show(),acf.enable(e)},close:function(){var e=this.$control();e.hide(),acf.disable(e)},render:function(){this.$toggle().prop("checked")?(this.renderRules(),this.open()):this.close()},renderRules:function(){var e=this;this.$rules().each(function(){e.renderRule(l(this))})},renderRule:function(e){this.scope(e),this.renderField(),this.renderOperator(),this.renderValue()},renderField:function(){var i=[],n=this.fieldObject.cid,e=this.$input("field");acf.getFieldObjects().map(function(e){var t={id:e.getKey(),text:e.getLabel()};e.cid===n&&(t.text+=acf.__("(this field)"),t.disabled=!0),acf.getConditionTypes({fieldType:e.getType()}).length||(t.disabled=!0);e=e.getParents().length;t.text="- ".repeat(e)+t.text,i.push(t)}),i.length||i.push({id:"",text:acf.__("No toggle fields available")}),acf.renderSelect(e,i),this.ruleData("field",e.val())},renderOperator:function(){var e,t,i;this.ruleData("field")&&((e=this.$input("operator")).val(),t=[],null===e.val()&&acf.renderSelect(e,[{id:this.ruleData("operator"),text:""}]),i=acf.findFieldObject(this.ruleData("field")),i=acf.getFieldObject(i),acf.getConditionTypes({fieldType:i.getType()}).map(function(e){t.push({id:e.prototype.operator,text:e.prototype.label})}),acf.renderSelect(e,t),this.ruleData("operator",e.val()))},renderValue:function(){var t,e,i,n,a;this.ruleData("field")&&this.ruleData("operator")&&(t=this.$input("value"),e=this.$td("value"),i=t.val(),n=acf.findFieldObject(this.ruleData("field")),n=acf.getFieldObject(n),(n=acf.getConditionTypes({fieldType:n.getType(),operator:this.ruleData("operator")})[0].prototype.choices(n))instanceof Array?(a=l(""),acf.renderSelect(a,n)):a=l(n),t.detach(),e.html(a),setTimeout(function(){["class","name","id"].map(function(e){a.attr(e,t.attr(e))})},0),a.prop("disabled")||acf.val(a,i,!0),this.ruleData("value",a.val()))},onChangeToggle:function(){this.render()},onClickAddGroup:function(e,t){this.addGroup()},addGroup:function(){var e=this.$(".rule-group:last"),e=acf.duplicate(e);e.find("h4").text(acf.__("or")),e.find("tr").not(":first").remove(),this.fieldObject.save()},onFocusField:function(e,t){this.renderField()},onChangeField:function(e,t){this.scope(t.closest(".rule")),this.ruleData("field",t.val()),this.renderOperator(),this.renderValue()},onChangeOperator:function(e,t){this.scope(t.closest(".rule")),this.ruleData("operator",t.val()),this.renderValue()},onClickAdd:function(e,t){t=acf.duplicate(t.closest(".rule"));this.renderRule(t)},onClickRemove:function(e,t){t=t.closest(".rule");this.fieldObject.save(),0==t.siblings(".rule").length&&t.closest(".rule-group").remove(),t.remove()}});acf.registerFieldSetting(e);new acf.Model({actions:{duplicate_field_objects:"onDuplicateFieldObjects"},onDuplicateFieldObjects:function(e,t,i){var n={},a=l();e.map(function(e){n[e.get("prevKey")]=e.get("key"),a=a.add(e.$(".condition-rule-field"))}),a.each(function(){var e=l(this),t=e.val();t&&n[t]&&(e.find("option:selected").attr("value",n[t]),e.val(n[t]))})}})}(jQuery),function(l){acf.findFieldObject=function(e){return acf.findFieldObjects({key:e,limit:1})},acf.findFieldObjects=function(e){e=e||{};var t=".acf-field-object",i=!1;return(e=acf.parseArgs(e,{id:"",key:"",type:"",limit:!1,list:null,parent:!1,sibling:!1,child:!1})).id&&(t+='[data-id="'+e.id+'"]'),e.key&&(t+='[data-key="'+e.key+'"]'),e.type&&(t+='[data-type="'+e.type+'"]'),i=e.list?e.list.children(t):e.parent?e.parent.find(t):e.sibling?e.sibling.siblings(t):e.child?e.child.parents(t):l(t),i=e.limit?i.slice(0,e.limit):i},acf.getFieldObject=function(e){return(e="string"==typeof e?acf.findFieldObject(e):e).data("acf")||acf.newFieldObject(e)},acf.getFieldObjects=function(e){var e=acf.findFieldObjects(e),t=[];return e.each(function(){var e=acf.getFieldObject(l(this));t.push(e)}),t},acf.newFieldObject=function(e){e=new acf.FieldObject(e);return acf.doAction("new_field_object",e),e};new acf.Model({priority:5,initialize:function(){["prepare","ready","append","remove"].map(function(e){this.addFieldActions(e)},this)},addFieldActions:function(e){var n=e+"_field_objects",a=e+"_field_object",l=e+"FieldObject";acf.addAction(e,function(e){var t,i=acf.getFieldObjects({parent:e});i.length&&((t=acf.arrayArgs(arguments)).splice(0,1,n,i),acf.doAction.apply(null,t))},5),acf.addAction(n,function(e){var t=acf.arrayArgs(arguments);t.unshift(a),e.map(function(e){t[1]=e,acf.doAction.apply(null,t)})},5),acf.addAction(a,function(t){var i=acf.arrayArgs(arguments);i.unshift(a);["type","name","key"].map(function(e){i[0]=a+"/"+e+"="+t.get(e),acf.doAction.apply(null,i)}),i.splice(0,2),t.trigger(l,i)},5)}}),new acf.Model({id:"fieldManager",events:{"submit #post":"onSubmit","mouseenter .acf-field-list":"onHoverSortable","click .add-field":"onClickAdd"},actions:{removed_field_object:"onRemovedField",sortstop_field_object:"onReorderField",delete_field_object:"onDeleteField",change_field_object_type:"onChangeFieldType",duplicate_field_object:"onDuplicateField"},onSubmit:function(e,t){acf.getFieldObjects().map(function(e){e.submit()})},setFieldMenuOrder:function(e){this.renderFields(e.$el.parent())},onHoverSortable:function(e,n){n.hasClass("ui-sortable")||n.sortable({handle:".acf-sortable-handle",connectWith:".acf-field-list",start:function(e,t){var i=acf.getFieldObject(t.item);t.placeholder.height(t.item.height()),acf.doAction("sortstart_field_object",i,n)},update:function(e,t){t=acf.getFieldObject(t.item);acf.doAction("sortstop_field_object",t,n)}})},onRemovedField:function(e,t){this.renderFields(t)},onReorderField:function(e,t){e.updateParent(),this.renderFields(t)},onDeleteField:function(e){e.getFields().map(function(e){e.delete({animate:!1})})},onChangeFieldType:function(e){},onDuplicateField:function(e,t){var i=t.getFields();i.length&&(i.map(function(e){e.wipe(),e.updateParent()}),acf.doAction("duplicate_field_objects",i,t,e)),this.setFieldMenuOrder(t)},renderFields:function(e){var t=acf.getFieldObjects({list:e});t.length?(e.removeClass("-empty"),t.map(function(e,t){e.prop("menu_order",t)})):e.addClass("-empty")},onClickAdd:function(e,t){t=t.closest(".acf-tfoot").siblings(".acf-field-list");this.addField(t)},addField:function(i){var e=l("#tmpl-acf-field").html(),t=l(e),n=t.data("id"),e=acf.uniqid("field_"),t=acf.duplicate({target:t,search:n,replace:e,append:function(e,t){i.append(t)}}),n=acf.getFieldObject(t);n.prop("key",e),n.prop("ID",0),n.prop("label",""),n.prop("name",""),t.attr("data-key",e),t.attr("data-id",e),n.updateParent();var a=n.$input("label");setTimeout(function(){a.trigger("focus")},251),n.open(),this.renderFields(i),acf.doAction("add_field_object",n),acf.doAction("append_field_object",n)}})}(jQuery),function(a){new acf.Model({id:"locationManager",wait:"ready",events:{"click .add-location-rule":"onClickAddRule","click .add-location-group":"onClickAddGroup","click .remove-location-rule":"onClickRemoveRule","change .refresh-location-rule":"onChangeRemoveRule"},initialize:function(){this.$el=a("#acf-field-group-locations"),this.updateGroupsClass()},onClickAddRule:function(e,t){this.addRule(t.closest("tr"))},onClickRemoveRule:function(e,t){this.removeRule(t.closest("tr"))},onChangeRemoveRule:function(e,t){this.changeRule(t.closest("tr"))},onClickAddGroup:function(e,t){this.addGroup()},addRule:function(e){acf.duplicate(e),this.updateGroupsClass()},removeRule:function(e){(0==e.siblings("tr").length?e.closest(".rule-group"):e).remove(),this.$(".rule-group:first").find("h4").text(acf.__("Show this field group if")),this.updateGroupsClass()},changeRule:function(t){var e=t.closest(".rule-group"),i=t.find("td.param select").attr("name").replace("[param]",""),n={action:"acf/field_group/render_location_rule"};n.rule=acf.serialize(t,i),n.rule.id=t.data("id"),n.rule.group=e.data("id"),acf.disable(t.find("td.value")),a.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(n),type:"post",dataType:"html",success:function(e){e&&t.replaceWith(e)}})},addGroup:function(){var e=this.$(".rule-group:last");$group2=acf.duplicate(e),$group2.find("h4").text(acf.__("or")),$group2.find("tr").not(":first").remove(),this.updateGroupsClass()},updateGroupsClass:function(){var e=this.$(".rule-group:last").closest(".rule-groups");1 .settings > table > tbody"),this.focus()},focus:function(){},setting:function(e){return this.$settings.find("> .acf-field-setting-"+e)}});new acf.Model({actions:{open_field_object:"onOpenFieldObject",close_field_object:"onCloseFieldObject",add_field_object:"onAddFieldObject",duplicate_field_object:"onDuplicateFieldObject",delete_field_object:"onDeleteFieldObject",change_field_object_type:"onChangeFieldObjectType",change_field_object_label:"onChangeFieldObjectLabel",change_field_object_name:"onChangeFieldObjectName",change_field_object_parent:"onChangeFieldObjectParent",sortstop_field_object:"onChangeFieldObjectParent"},onOpenFieldObject:function(e){acf.doAction("open_field",e.$el),acf.doAction("open_field/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onCloseFieldObject:function(e){acf.doAction("close_field",e.$el),acf.doAction("close_field/type="+e.get("type"),e.$el)},onAddFieldObject:function(e){acf.doAction("add_field",e.$el),acf.doAction("add_field/type="+e.get("type"),e.$el)},onDuplicateFieldObject:function(e){acf.doAction("duplicate_field",e.$el),acf.doAction("duplicate_field/type="+e.get("type"),e.$el)},onDeleteFieldObject:function(e){acf.doAction("delete_field",e.$el),acf.doAction("delete_field/type="+e.get("type"),e.$el)},onChangeFieldObjectType:function(e){acf.doAction("change_field_type",e.$el),acf.doAction("change_field_type/type="+e.get("type"),e.$el),acf.doAction("render_field_settings",e.$el),acf.doAction("render_field_settings/type="+e.get("type"),e.$el)},onChangeFieldObjectLabel:function(e){acf.doAction("change_field_label",e.$el),acf.doAction("change_field_label/type="+e.get("type"),e.$el)},onChangeFieldObjectName:function(e){acf.doAction("change_field_name",e.$el),acf.doAction("change_field_name/type="+e.get("type"),e.$el)},onChangeFieldObjectParent:function(e){acf.doAction("update_field_parent",e.$el)}})}(jQuery);
\ No newline at end of file
diff --git a/assets/build/js/acf-input.js b/assets/build/js/acf-input.js
index 37aec7b..2c763b6 100644
--- a/assets/build/js/acf-input.js
+++ b/assets/build/js/acf-input.js
@@ -7729,10 +7729,25 @@
placeholder: this.get('placeholder'),
multiple: this.get('multiple'),
data: [],
- escapeMarkup: function( string ){
- return acf.escHtml( string );
- },
+ escapeMarkup: function( markup ) {
+ if (typeof markup !== 'string') {
+ return markup;
+ }
+ return acf.escHtml( markup );
+ }
};
+
+ // Only use the template if SelectWoo is not loaded to work around https://github.com/woocommerce/woocommerce/pull/30473
+ if ( ! acf.isset(window, 'jQuery', 'fn', 'selectWoo') ) {
+
+ options.templateSelection = function( selection ) {
+ var $selection = $('');
+ $selection.html( acf.escHtml( selection.text ) );
+ $selection.data('element', selection.element);
+ return $selection;
+ };
+
+ }
// multiple
if( options.multiple ) {
@@ -7788,8 +7803,12 @@
// loop
$ul.find('.select2-selection__choice').each(function() {
- // vars
- var $option = $( $(this).data('data').element );
+ // Attempt to use .data if it exists (select2 version < 4.0.6) or use our template data instead.
+ if ( $(this).data('data') ) {
+ var $option = $( $(this).data('data').element );
+ } else {
+ var $option = $( $(this).children('span.acf-selection').data('element') );
+ }
// detach and re-append to end
$option.detach().appendTo( $select );
@@ -9656,7 +9675,7 @@
var lastPostStatus = '';
wp.data.subscribe(function() {
var postStatus = editorSelect.getEditedPostAttribute( 'status' );
- useValidation = ( postStatus === 'publish' );
+ useValidation = ( postStatus === 'publish' || postStatus === 'future' );
lastPostStatus = ( postStatus !== 'publish' ) ? postStatus : lastPostStatus;
});
@@ -9676,7 +9695,7 @@
return resolve( 'Validation ignored (autosave).' );
}
- // Bail early if validation is not neeed.
+ // Bail early if validation is not needed.
if( !useValidation ) {
return resolve( 'Validation ignored (draft).' );
}
@@ -9728,6 +9747,8 @@
}
}).then(function(){
return savePost.apply(_this, _args);
+ }).catch(function(err){
+ // Nothing to do here, user is alerted of validation issues.
});
};
}
diff --git a/assets/build/js/acf-input.min.js b/assets/build/js/acf-input.min.js
index fd1d9f4..f7a16b1 100644
--- a/assets/build/js/acf-input.min.js
+++ b/assets/build/js/acf-input.min.js
@@ -1 +1 @@
-!function(e,i){var a=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return t!==i?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field");return acf.getFields(t)},show:function(t,e){t=acf.show(this.$el,t);return t&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),t},hide:function(t,e){t=acf.hide(this.$el,t);return t&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),t},enable:function(t,e){t=acf.enable(this.$el,t);return t&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),t},disable:function(t,e){t=acf.disable(this.$el,t);return t&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),t},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),t!==i&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",e.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),e=n(e),t=new(acf.models[e]||acf.Field)(t);return acf.doAction("new_field",t),t};var n=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e=t.prototype.type,i=n(e);acf.models[i]=t,a.push(e)},acf.getFieldType=function(t){t=n(t);return acf.models[t]||!1},acf.getFieldTypes=function(i){i=acf.parseArgs(i,{category:""});var n=[];return a.map(function(t){var e=acf.getFieldType(t),t=e.prototype;i.category&&t.category!==i.category||n.push(e)}),n}}(jQuery),function(n){acf.findFields=function(t){var e=".acf-field",i=!1;return(t=!(t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters?acf.applyFilters("find_fields_args",t):t).key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):n(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),i=t.limit?i.slice(0,t.limit):i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){return(t=!(t instanceof jQuery)?acf.findField(t):t).data("acf")||acf.newField(t)},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField(n(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){t=acf.findClosestField(t);return this.getField(t)};var e=function(t){var a=t+"_field",s=t+"Field";acf.addAction(a,function(e){var i=acf.arrayArgs(arguments),n=i.slice(1);["type","name","key"].map(function(t){t="/"+t+"="+e.get(t);i=[a+t,e].concat(n),acf.doAction.apply(null,i)}),-1'),e=c(''),o=c(''),r=c(""),t.append(n.html()),o.append(r),e.append(o),a.append(t),a.append(e),n.remove(),s.remove(),a.attr("colspan",2),n=t,a=e,s=r),i.addClass("acf-accordion"),n.addClass("acf-accordion-title"),a.addClass("acf-accordion-content"),l++,this.get("multi_expand")&&i.attr("multi-expand",1);var r=acf.getPreference("this.accordions")||[];void 0!==r[l-1]&&this.set("open",r[l-1]),this.get("open")&&(i.addClass("-open"),a.css("display","block")),n.prepend(d.iconHtml({open:this.get("open")}));n=i.parent();s.addClass(n.hasClass("-left")?"-left":""),s.addClass(n.hasClass("-clear")?"-clear":""),s.append(i.nextUntil(".acf-field-accordion",".acf-field")),s.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(t);var d=new acf.Model({actions:{unload:"onUnload"},events:{"click .acf-accordion-title":"onClick","invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},iconHtml:function(t){return acf.isGutenberg()?t.open?'':'':t.open?'':''},open:function(t){var e=acf.isGutenberg()?0:300;t.find(".acf-accordion-content:first").slideDown(e).css("display","block"),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!0})),t.addClass("-open"),acf.doAction("show",t),t.attr("multi-expand")||t.siblings(".acf-accordion.-open").each(function(){d.close(c(this))})},close:function(t){var e=acf.isGutenberg()?0:300;t.find(".acf-accordion-content:first").slideUp(e),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!1})),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(t){var e=[];c(".acf-accordion").each(function(){var t=c(this).hasClass("-open")?1:0;e.push(t)}),e.length&&acf.setPreference("this.accordions",e)}})}(jQuery),function(){var t=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(t)}(jQuery),function(e){var t=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var t=[];return this.$(":checked").each(function(){t.push(e(this).val())}),!!t.length&&t},onChange:function(t,e){var i=e.prop("checked"),n=e.parent("label"),e=this.$toggle();i?n.addClass("selected"):n.removeClass("selected"),e.length&&(0==this.$inputs().not(":checked").length?e.prop("checked",!0):e.prop("checked",!1))},onClickAdd:function(t,e){var i='';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked"),n=this.$('input[type="checkbox"]'),e=this.$("label");n.prop("checked",i),i?e.addClass("selected"):e.removeClass("selected")},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"color_picker",wait:"load",events:{duplicateField:"onDuplicate"},$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},setValue:function(t){acf.val(this.$input(),t),this.$inputText().iris("color",t)},initialize:function(){var e=this.$input(),i=this.$inputText(),t=function(t){setTimeout(function(){acf.val(e,i.val())},1)},t={defaultColor:!1,palettes:!0,hide:!0,change:t,clear:t},t=acf.applyFilters("color_picker_args",t,this);i.wpColorPicker(t)},onDuplicate:function(t,e,i){$colorPicker=i.find(".wp-picker-container"),$inputText=i.find('input[type="text"]'),$colorPicker.replaceWith($inputText)}});acf.registerFieldType(t)}(jQuery),function(n){var t=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur",duplicateField:"onDuplicate"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),t={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},t=acf.applyFilters("date_picker_args",t,this);acf.newDatePicker(e,t),acf.doAction("date_picker_init",e,t,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},t=(i=acf.applyFilters("date_picker_args",i,this)).dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",t),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")},onDuplicate:function(t,e,i){i.find('input[type="text"]').removeClass("hasDatepicker").removeAttr("id")}});acf.registerFieldType(t);new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("datePickerL10n");return!!i&&(void 0!==n.datepicker&&(i.isRTL=e,n.datepicker.regional[t]=i,void n.datepicker.setDefaults(i)))}});acf.newDatePicker=function(t,e){if(void 0===n.datepicker)return!1;t.datepicker(e=e||{}),n("body > #ui-datepicker-div").exists()&&n("body > #ui-datepicker-div").wrap('')}}(jQuery),function(n){var t=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),t={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0},t=acf.applyFilters("date_time_picker_args",t,this);acf.newDateTimePicker(e,t),acf.doAction("date_time_picker_init",e,t,this)}});acf.registerFieldType(t);new acf.Model({priority:5,wait:"ready",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),i=acf.get("dateTimePickerL10n");return!!i&&(void 0!==n.timepicker&&(i.isRTL=e,n.timepicker.regional[t]=i,void n.timepicker.setDefaults(i)))}});acf.newDateTimePicker=function(t,e){if(void 0===n.timepicker)return!1;t.datetimepicker(e=e||{}),n("body > #ui-datepicker-div").exists()&&n("body > #ui-datepicker-div").wrap('')}}(jQuery),function(e){var t=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},setState:function(t){this.$control().removeClass("-value -loading -searching"),(t="default"===t?this.val()?"value":"":t)&&this.$control().addClass("-"+t)},getValue:function(){var t=this.$input().val();return!!t&&JSON.parse(t)},setValue:function(t,e){var i="";t&&(i=JSON.stringify(t)),acf.val(this.$input(),i),e||(this.renderVal(t),acf.doAction("google_map_change",t,this.map,this))},renderVal:function(t){t?(this.setState("value"),this.$search().val(t.address),this.setPosition(t.lat,t.lng)):(this.setState(""),this.$search().val(""),this.map.marker.setVisible(!1))},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},setPosition:function(t,e){this.map.marker.setPosition({lat:parseFloat(t),lng:parseFloat(e)}),this.map.marker.setVisible(!0),this.center()},center:function(){var t,e=this.map.marker.getPosition();e=e?(t=e.lat(),e.lng()):(t=this.get("lat"),this.get("lng")),this.map.setCenter({lat:parseFloat(t),lng:parseFloat(e)})},initialize:function(){!function(t){if(a)return t();if(acf.isset(window,"google","maps","Geocoder"))return a=new google.maps.Geocoder,t();acf.addAction("google_map_api_loaded",t),i||(t=acf.get("google_map_api"))&&(i=!0,e.ajax({url:t,dataType:"script",cache:!0,success:function(){a=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}}))}(this.initializeMap.bind(this))},initializeMap:function(){var t=this.getValue(),e=acf.parseArgs(t,{zoom:this.get("zoom"),lat:this.get("lat"),lng:this.get("lng")}),i={scrollwheel:!1,zoom:parseInt(e.zoom),center:{lat:parseFloat(e.lat),lng:parseFloat(e.lng)},mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}},i=acf.applyFilters("google_map_args",i,this),n=new google.maps.Map(this.$canvas()[0],i),a=acf.parseArgs(i.marker,{draggable:!0,raiseOnDrag:!0,map:n}),a=acf.applyFilters("google_map_marker_args",a,this),e=new google.maps.Marker(a),a=!1;acf.isset(google,"maps","places","Autocomplete")&&(i=i.autocomplete||{},i=acf.applyFilters("google_map_autocomplete_args",i,this),(a=new google.maps.places.Autocomplete(this.$search()[0],i)).bindTo("bounds",n)),this.addMapEvents(this,n,e,a),n.acf=this,n.marker=e,n.autocomplete=a,this.map=n,t&&this.setPosition(t.lat,t.lng),acf.doAction("google_map_init",n,e,this)},addMapEvents:function(i,e,t,n){google.maps.event.addListener(e,"click",function(t){var e=t.latLng.lat(),t=t.latLng.lng();i.searchPosition(e,t)}),google.maps.event.addListener(t,"dragend",function(){var t=this.getPosition().lat(),e=this.getPosition().lng();i.searchPosition(t,e)}),n&&google.maps.event.addListener(n,"place_changed",function(){var t=this.getPlace();i.searchPlace(t)}),google.maps.event.addListener(e,"zoom_changed",function(){var t=i.val();t&&(t.zoom=e.getZoom(),i.setValue(t,!0))})},searchPosition:function(i,n){this.setState("loading"),a.geocode({location:{lat:i,lng:n}},function(t,e){this.setState(""),"OK"!==e?this.showNotice({text:acf.__("Location not found: %s").replace("%s",e),type:"warning"}):((t=this.parseResult(t[0])).lat=i,t.lng=n,this.val(t))}.bind(this))},searchPlace:function(t){var e;t&&(t.geometry?(t.formatted_address=this.$search().val(),e=this.parseResult(t),this.val(e)):t.name&&this.searchAddress(t.name))},searchAddress:function(i){if(i){var t=i.split(",");if(2==t.length){var e=parseFloat(t[0]),t=parseFloat(t[1]);if(e&&t)return this.searchPosition(e,t)}this.setState("loading"),a.geocode({address:i},function(t,e){this.setState(""),"OK"!==e?this.showNotice({text:acf.__("Location not found: %s").replace("%s",e),type:"warning"}):((t=this.parseResult(t[0])).address=i,this.val(t))}.bind(this))}},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));this.setState("loading"),navigator.geolocation.getCurrentPosition(function(t){this.setState("");var e=t.coords.latitude,t=t.coords.longitude;this.searchPosition(e,t)}.bind(this),function(t){this.setState("")}.bind(this))},parseResult:function(t){var e={address:t.formatted_address,lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};e.zoom=this.map.getZoom(),t.place_id&&(e.place_id=t.place_id),t.name&&(e.name=t.name);var i,n={street_number:["street_number"],street_name:["street_address","route"],city:["locality"],state:["administrative_area_level_1","administrative_area_level_2","administrative_area_level_3","administrative_area_level_4","administrative_area_level_5"],post_code:["postal_code"],country:["country"]};for(i in n)for(var a=n[i],s=0;s');e("body").append(t);t=this.getNodeValue();wpLink.open("acf-link-textarea",t.url,t.title,null)},onOpen:function(){e("#wp-link-wrap").addClass("has-text-field");var t=this.getNodeValue();this.setInputValue(t),t.url&&wpLinkL10n&&e("#wp-link-submit").val(wpLinkL10n.update)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;var t=e("#wp-link-submit");(t.is(":hover")||t.is(":focus"))&&(t=this.getInputValue(),this.setNodeValue(t)),this.off("wplink-open"),this.off("wplink-close"),e("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function(i){var t=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var t=this.val(),e=this.getSearchVal();if(!e)return this.clear();(e="http"!=e.substr(0,4)?"http://"+e:e)!==t&&((t=this.get("timeout"))&&clearTimeout(t),e=i.proxy(this.search,this,e),this.set("timeout",setTimeout(e,300)))},search:function(t){var e={action:"acf/fields/oembed/search",s:t,field_key:this.get("key")};(t=this.get("xhr"))&&t.abort(),this.showLoading();t=i.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",t)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return t="other"===t&&this.get("other_choice")?this.$inputText().val():t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),this.$input().val(),!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(t)}(jQuery),function(s){var t=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var t=[];return this.$listItems("values").each(function(){t.push(s(this).data("id"))}),!!t.length&&t},newChoice:function(t){return["",''+t.text+"",""].join("")},newValue:function(t){return["",'',''+t.text,'',"",""].join("")},initialize:function(){var t=this.proxy(acf.once(function(){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:this.proxy(function(){this.$input().trigger("change")})}),this.$list("choices").scrollTop(0).on("scroll",this.proxy(this.onScrollChoices)),this.fetch()}));this.$el.one("mouseover",t),this.$el.one("focus","input",t),acf.onceInView(this.$el,t)},onScrollChoices:function(t){var e,i,n,a;!this.get("loading")&&this.get("more")&&(a=this.$list("choices"),e=Math.ceil(a.scrollTop()),i=Math.ceil(a[0].scrollHeight),n=Math.ceil(a.innerHeight()),a=this.get("paged")||1,i<=e+n&&(this.set("paged",a+1),this.fetch()))},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(0=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");e=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(e),this.$input().trigger("change")},onClickRemove:function(t,e){t.preventDefault();t=e.parent(),e=t.parent(),t=t.data("id");e.remove(),this.$listItem("choices",t).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t,e=this.$control().data();for(t in e)e[t]=this.get(t);return e.action="acf/fields/relationship/query",e.field_key=this.get("key"),e=acf.applyFilters("relationship_ajax_data",e,this)},fetch:function(){(i=this.get("xhr"))&&i.abort();var t=this.getAjaxData(),a=this.$list("choices");1==t.paged&&a.html("");var e=s(' '+acf.__("Loading")+"");a.append(e),this.set("loading",!0);var i=s.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(t),context:this,success:function(t){if(!t||!t.results||!t.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append(""+acf.__("No matches found")+""));this.set("more",t.more);var t=this.walkChoices(t.results),e=s(t),t=this.val();t&&t.length&&t.map(function(t){e.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),a.append(e);var i=!1,n=!1;a.find(".acf-rel-label").each(function(){var t=s(this),e=t.siblings("ul");if(i&&i.text()==t.text())return n.append(e.children()),void s(this).parent().remove();i=t,n=e})},complete:function(){this.set("loading",!1),e.remove()}});this.set("xhr",i)},walkChoices:function(t){var i=function(t){var e="";return s.isArray(t)?t.map(function(t){e+=i(t)}):s.isPlainObject(t)&&(void 0!==t.children?(e+=''+acf.escHtml(t.text)+'"):e+=''+acf.escHtml(t.text)+""),e};return i(t)}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove",duplicateField:"onDuplicate"},$input:function(){return this.$("select")},initialize:function(){var t,e=this.$input();this.inherit(e),this.get("ui")&&(t=(t=this.get("ajax_action"))||"acf/fields/"+this.get("type")+"/query",this.select2=acf.newSelect2(e,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:t}))},onRemove:function(){this.select2&&this.select2.destroy()},onDuplicate:function(t,e,i){this.select2&&(i.find(".select2-container").remove(),i.find("select").removeClass("select2-hidden-accessible"))}});acf.registerFieldType(t)}(jQuery),function(n){var e="tab",t=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,events:{duplicateField:"onDuplicate"},findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return!(this.events={});var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new s(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,e),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,e),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable(e)})},disable:function(t){this.getFields().map(function(t){t.disable(e)})},onDuplicate:function(t,e,i){this.isActive()&&i.prevAll(".acf-tab-wrap:first").remove()}});acf.registerFieldType(t);var a=0,s=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(t){n.extend(this.data,t),this.tabs=[],this.active=!1;var e=this.get("placement"),i=this.get("before"),t=i.parent();"left"==e&&t.hasClass("acf-fields")&&t.addClass("-sidebar"),i.is("tr")?this.$el=n(' |
'):this.$el=n(''),i.before(this.$el),this.set("index",a,!0),a++},initializeTabs:function(){var t=this.getVisible().shift(),e=(acf.getPreference("this.tabs")||[])[this.get("index")];(t=this.tabs[e]&&this.tabs[e].isVisible()?this.tabs[e]:t)?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(e){this.tabs.map(function(t){e.cid!==t.cid&&this.closeTab(t)},this),this.openTab(e)},addTab:function(t,e){t=n(""+t.outerHTML()+"");this.$("ul").append(t);e=new i({$el:t,field:e,group:this});return this.tabs.push(e),e},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){var t,e,i;"left"===this.get("placement")&&(t=this.$el.parent(),i=this.$el.children("ul"),e=t.is("td")?"height":"min-height",i=i.position().top+i.outerHeight(!0)-1,t.css(e,i))}}),i=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}});new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return n(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var e=[];this.getTabs().map(function(t){t=t.hasActive()?t.getActive().index():0;e.push(t)}),e.length&&acf.setPreference("this.tabs",e)}})}(jQuery),function(){var t=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(t)}(jQuery),function(){var t=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(t)}(jQuery),function(){var t=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(t)}(jQuery),function(p){var t=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio",removeField:"onRemove"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return t="multi_select"==t?"select":t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){var t=this.getRelatedPrototype();t.onRemove&&t.onRemove.apply(this,arguments)},onClickAdd:function(t,e){var i=this,n=!1,a=!1,s=!1,o=!1,r=!1,c=!1,l=function(t){n.loading(!1),n.content(t),a=n.$("form"),s=n.$('input[name="term_name"]'),o=n.$('select[name="term_parent"]'),r=n.$(".acf-submit-button"),s.trigger("focus"),n.on("submit","form",d)},d=function(t,e){if(t.preventDefault(),t.stopImmediatePropagation(),""===s.val())return s.trigger("focus"),!1;acf.startButtonLoading(r);t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key"),term_name:s.val(),term_parent:o.length?o.val():0};p.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"json",success:u})},u=function(t){acf.stopButtonLoading(r),c&&c.remove(),c=acf.isAjaxSuccess(t)?(s.val(""),f(t.data),acf.newNotice({type:"success",text:acf.getAjaxMessage(t),target:a,timeout:2e3,dismiss:!1})):acf.newNotice({type:"error",text:acf.getAjaxError(t),target:a,timeout:2e3,dismiss:!1}),s.trigger("focus")},f=function(e){var t=p('");e.term_parent?o.children('option[value="'+e.term_parent+'"]').after(t):o.append(t),acf.getFields({type:"taxonomy"}).map(function(t){t.get("taxonomy")==i.get("taxonomy")&&t.appendTerm(e)}),i.selectTerm(e.term_id)};!function(){n=acf.newPopup({title:e.attr("title"),loading:!0,width:"300px"});var t={action:"acf/fields/taxonomy/add_term",field_key:i.get("key")};p.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(t),type:"post",dataType:"html",success:l})}()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(t){var e=this.$("[name]:first").attr("name"),i=this.$("ul:first");"checkbox"==this.getRelatedType()&&(e+="[]");e=p(['',"",""].join(""));t.term_parent&&((i=(t=i.find('li[data-id="'+t.term_parent+'"]')).children("ul")).exists()||(i=p(''),t.append(i))),i.append(e)},selectTerm:function(t){"select"==this.getRelatedType()?this.select2.selectOption(t):this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClickRadio:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(t)}(jQuery),function(i){var t=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),t={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0,onClose:function(t,e,i){e=e.dpDiv.find(".ui-datepicker-close");!t&&e.is(":hover")&&i._updateDateTime()}},t=acf.applyFilters("time_picker_args",t,this);acf.newTimePicker(e,t),acf.doAction("time_picker_init",e,t,this)}});acf.registerFieldType(t),acf.newTimePicker=function(t,e){if(void 0===i.timepicker)return!1;t.timepicker(e=e||{}),i("body > #ui-datepicker-div").exists()&&i("body > #ui-datepicker-div").wrap('')}}(jQuery),function(){var t=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t,e,i=this.$switch();i.length&&(t=i.children(".acf-switch-on"),e=i.children(".acf-switch-off"),(i=Math.max(t.width(),e.width()))&&(t.css("min-width",i),e.css("min-width",i)))},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(t)}(jQuery),function(){var t=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",unmountField:"disableEditor",remountField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-"),s=e.data(),e=e.val();acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),this.$input().data(s).val(e),acf.tinymce.initialize(a,i)},onMousedown:function(t){t.preventDefault();t=this.$control();t.removeClass("delay"),t.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(t)}(jQuery),function(e){var s=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(t){e.extend(this.data,t)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return''}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;e={rule:t,target:i,conditions:e,field:n},n=n.get("type"),t=t.operator;return new(acf.getConditionTypes({fieldType:n,operator:t})[0]||acf.Condition)(e)};function n(t){return acf.strPascalCase(t||"")+"Condition"}acf.registerConditionType=function(t){var e=t.prototype.type,i=n(e);acf.models[i]=t,s.push(e)},acf.getConditionType=function(t){t=n(t);return acf.models[t]||!1},acf.registerConditionForFieldType=function(t,e){t=acf.getConditionType(t);t&&t.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(n){n=acf.parseArgs(n,{fieldType:"",operator:""});var a=[];return s.map(function(t){var e=acf.getConditionType(t),i=e.prototype.fieldTypes,t=e.prototype.operator;n.fieldType&&-1===i.indexOf(n.fieldType)||n.operator&&t!==n.operator||a.push(e)}),a}}(jQuery),function(){function a(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return!!(i=!i.length?acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0}):i).length&&i[0]}var t="conditional_logic";new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}});acf.Field.prototype.getField=function(t){var e=a(this,t);if(e)return e;for(var i=this.parents(),n=0;n'}});acf.registerConditionType(i);var t=i.extend({type:"hasNoValue",operator:"==empty",label:s("Has no value"),match:function(t,e){return!i.prototype.match.apply(this,arguments)}});acf.registerConditionType(t);var o=acf.Condition.extend({type:"equalTo",operator:"==",label:s("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(t,e){return acf.isNumeric(t.value)?(i=t.value,n=e.val(),parseFloat(i)===parseFloat(n)):a(t.value,e.val());var i,n},choices:function(t){return''}});acf.registerConditionType(o);var e=o.extend({type:"notEqualTo",operator:"!=",label:s("Value is not equal to"),match:function(t,e){return!o.prototype.match.apply(this,arguments)}});acf.registerConditionType(e);t=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:s("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return function(t,e){e=new RegExp(n(e),"gi");return n(t).match(e)}(e.val(),t.value)},choices:function(t){return''}});acf.registerConditionType(t);t=acf.Condition.extend({type:"contains",operator:"==contains",label:s("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed","select"],match:function(t,e){return e=e.val(),t=t.value,-1'}});acf.registerConditionType(t);t=o.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:s("Checked")}]}});acf.registerConditionType(t);t=e.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:s("Checked")}]}});acf.registerConditionType(t);var r=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:s("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?(e=t.value,-1",label:s("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){e=e.val();return e instanceof Array&&(e=e.length),e=e,t=t.value,parseFloat(e)>parseFloat(t)},choices:function(t){return''}});acf.registerConditionType(t);e=t.extend({type:"lessThan",operator:"<",label:s("Value is less than"),match:function(t,e){e=e.val();return e instanceof Array&&(e=e.length),e=e,t=t.value,parseFloat(e)'}});acf.registerConditionType(e);t=t.extend({type:"selectionGreaterThan",label:s("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(t);e=e.extend({type:"selectionLessThan",label:s("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(e)}(jQuery),function(t){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{validation_failure:"startListening",validation_success:"stopListening"},events:{"change form .acf-field":"startListening","submit form":"stopListening"},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,t(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,t(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function(e){new acf.Model({wait:"prepare",priority:1,initialize:function(){(acf.get("postboxes")||[]).map(acf.newPostbox)}});acf.getPostbox=function(t){return"string"==typeof arguments[0]&&(t=e("#"+arguments[0])),acf.getInstance(t)},acf.getPostboxes=function(){return acf.getInstances(e(".acf-postbox"))},acf.newPostbox=function(t){return new acf.models.Postbox(t)},acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",edit:""},setup:function(t){t.editLink&&(t.edit=t.editLink),e.extend(this.data,t),this.$el=this.$postbox()},$postbox:function(){return e("#"+this.get("id"))},$hide:function(){return e("#"+this.get("id")+"-hide")},$hideLabel:function(){return this.$hide().parent()},$hndle:function(){return this.$("> .hndle")},$handleActions:function(){return this.$("> .postbox-header .handle-actions")},$inside:function(){return this.$("> .inside")},isVisible:function(){return this.$el.hasClass("acf-hidden")},initialize:function(){this.$el.addClass("acf-postbox"),this.$el.removeClass("hide-if-js"),"block"===acf.get("editor")||"default"!==(t=this.get("style"))&&this.$el.addClass(t),this.$inside().addClass("acf-fields").addClass("-"+this.get("label"));var t,e=this.get("edit");e&&(t='',(e=this.$handleActions()).length?e.prepend(t):this.$hndle().append(t)),this.show()},show:function(){this.$hideLabel().show(),this.$hide().prop("checked",!0),this.$el.show().removeClass("acf-hidden"),acf.doAction("show_postbox",this)},enable:function(){acf.enable(this.$el,"postbox")},showEnable:function(){this.enable(),this.show()},hide:function(){this.$hideLabel().hide(),this.$el.hide().addClass("acf-hidden"),acf.doAction("hide_postbox",this)},disable:function(){acf.disable(this.$el,"postbox")},hideDisable:function(){this.disable(),this.hide()},html:function(t){this.$inside().html(t),acf.doAction("append",this.$el)}})}(jQuery),function(a){acf.newMediaPopup=function(t){var e=null,e=new("edit"==(t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}})).mode?acf.models.EditMediaPopup:acf.models.SelectMediaPopup)(t);return t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};function e(){var t=acf.get("post_id");return acf.isNumeric(t)?t:0}acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e,i=acf.getMimeTypes();if(void 0!==i[t])return i[t];for(e in i)if(-1!==e.indexOf(t))return i[e];return!1};var n=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(t){a.extend(this.data,t)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);(e.acf=this).addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=e()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(i,t){i.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},i),i.on("content:render:edit-image",function(){var t=this.state().get("image"),t=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(t),t.loadEditor()},i),i.on("select",function(){var t=i.state().get("selection");t&&t.each(function(t,e){i.acf.get("select").apply(i.acf,[t,e])})}),i.on("close",function(){setTimeout(function(){i.acf.get("close").apply(i.acf),i.acf.remove()},1)})}});acf.models.SelectMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(e,t){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),e.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),e.on("content:activate:browse",function(){var t=!1;try{t=e.content.get().toolbar}catch(t){return void console.log(t)}e.acf.customizeFilters.apply(e.acf,[t])}),n.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(t){var i,e=t.get("filters");"image"==this.get("type")&&(e.filters.all.text=acf.__("All images"),delete e.filters.audio,delete e.filters.video,delete e.filters.image,a.each(e.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes")&&this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){t=acf.getMimeType(t);t&&(e.filters[t]={text:t,props:{status:null,type:t,uploadedTo:null,orderby:"date",order:"DESC"},priority:20})}),"uploadedTo"===this.get("library")&&(i=this.frame.options.library.uploadedTo,delete e.filters.unattached,delete e.filters.uploaded,a.each(e.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=i}));var n=this.get("field");a.each(e.filters,function(t,e){e.props._acfuploader=n}),t.get("search").model.attributes._acfuploader=n,e.renderFilters&&e.renderFilters()}}),acf.models.EditMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(i,t){i.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var t=this.state().get("selection"),e=wp.media.attachment(i.acf.get("attachment"));t.add(e)},i),n.prototype.addFrameEvents.apply(this,arguments)}});new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){var t;acf.isset(window,"wp","media","view")&&((t=e())&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsButton(),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary())},customizeAttachmentsButton:function(){var t;acf.isset(wp,"media","view","Button")&&(t=wp.media.view.Button,wp.media.view.Button=t.extend({initialize:function(){var t=_.defaults(this.options,this.defaults);this.model=new Backbone.Model(t),this.listenTo(this.model,"change",this.render)}}))},customizeAttachmentsRouter:function(){var t;acf.isset(wp,"media","view","Router")&&(t=wp.media.view.Router,wp.media.view.Router=t.extend({addExpand:function(){var t=a(['',''+acf.__("Expand Details")+"",''+acf.__("Collapse Details")+"",""].join(""));t.on("click",function(t){t.preventDefault();t=a(this).closest(".media-modal");t.hasClass("acf-expanded")?t.removeClass("acf-expanded"):t.addClass("acf-expanded")}),this.$el.append(t)},initialize:function(){return t.prototype.initialize.apply(this,arguments),this.addExpand(),this}}))},customizeAttachmentFilters:function(){acf.isset(wp,"media","view","AttachmentFilters","All")&&(wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(t,e){return{el:a("").val(e).html(t.text)[0],priority:t.priority||50}},this).sortBy("priority").pluck("el").value())})},customizeAttachmentCompat:function(){var t,e;acf.isset(wp,"media","view","AttachmentCompat")&&(t=wp.media.view.AttachmentCompat,e=!1,wp.media.view.AttachmentCompat=t.extend({render:function(){return this.rendered?this:(t.prototype.render.apply(this,arguments),this.$("#acf-form-data").length&&(clearTimeout(e),e=setTimeout(a.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50)),this)},save:function(t){var e;t&&t.preventDefault(),e=acf.serializeForAjax(this.$el),this.controller.trigger("attachment:compat:waiting",["waiting"]),this.model.saveCompat(e).always(_.bind(this.postSave,this))}}))},customizeAttachmentLibrary:function(){var o;acf.isset(wp,"media","view","Attachment","Library")&&(o=wp.media.view.Attachment.Library,wp.media.view.Attachment.Library=o.extend({render:function(){var t=acf.isget(this,"controller","acf"),e=acf.isget(this,"model","attributes");return t&&e&&(e.acf_errors&&this.$el.addClass("acf-disabled"),(t=t.get("selected"))&&-1',''+acf.__("Restricted")+"",''+n+"",''+a+"",""].join("")),e.reset(),void e.single(i)}return o.prototype.toggleSelection.apply(this,arguments)}}))}})}(jQuery),function(u){acf.screen=new acf.Model({active:!0,xhr:!1,timeout:!1,wait:"load",events:{"change #page_template":"onChange","change #parent_id":"onChange","change #post-formats-select":"onChange","change .categorychecklist":"onChange","change .tagsdiv":"onChange",'change .acf-taxonomy-field[data-save="1"]':"onChange","change #product-type":"onChange"},isPost:function(){return"post"===acf.get("screen")},isUser:function(){return"user"===acf.get("screen")},isTaxonomy:function(){return"taxonomy"===acf.get("screen")},isAttachment:function(){return"attachment"===acf.get("screen")},isNavMenu:function(){return"nav_menu"===acf.get("screen")},isWidget:function(){return"widget"===acf.get("screen")},isComment:function(){return"comment"===acf.get("screen")},getPageTemplate:function(){var t=u("#page_template");return t.length?t.val():null},getPageParent:function(t,e){return(e=u("#parent_id")).length?e.val():null},getPageType:function(t,e){return this.getPageParent()?"child":"parent"},getPostType:function(){return u("#post_type").val()},getPostFormat:function(t,e){if((e=u("#post-formats-select input:checked")).length){e=e.val();return"0"==e?"standard":e}return null},getPostCoreTerms:function(){var t,e={},i=acf.serialize(u(".categorydiv, .tagsdiv"));for(t in i.tax_input&&(e=i.tax_input),i.post_category&&(e.category=i.post_category),e)acf.isArray(e[t])||(e[t]=e[t].split(/,[\s]?/));return e},getPostTerms:function(){var t,i=this.getPostCoreTerms();for(t in acf.getFields({type:"taxonomy"}).map(function(t){var e;t.get("save")&&(e=t.val(),t=t.get("taxonomy"),e&&(i[t]=i[t]||[],e=acf.isArray(e)?e:[e],i[t]=i[t].concat(e)))}),null!==(productType=this.getProductType())&&(i.product_type=[productType]),i)i[t]=acf.uniqueArray(i[t]);return i},getProductType:function(){var t=u("#product-type");return t.length?t.val():null},check:function(){var e;"post"===acf.get("screen")&&(this.xhr&&this.xhr.abort(),e=acf.parseArgs(this.data,{action:"acf/ajax/check_screen",screen:acf.get("screen"),exists:[]}),this.isPost()&&(e.post_id=acf.get("post_id")),null!==(postType=this.getPostType())&&(e.post_type=postType),null!==(pageTemplate=this.getPageTemplate())&&(e.page_template=pageTemplate),null!==(pageParent=this.getPageParent())&&(e.page_parent=pageParent),null!==(pageType=this.getPageType())&&(e.page_type=pageType),null!==(postFormat=this.getPostFormat())&&(e.post_format=postFormat),null!==(postTerms=this.getPostTerms())&&(e.post_terms=postTerms),acf.getPostboxes().map(function(t){e.exists.push(t.get("key"))}),e=acf.applyFilters("check_screen_args",e),this.xhr=u.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:function(t){"post"==acf.get("screen")?this.renderPostScreen(t):"user"==acf.get("screen")&&this.renderUserScreen(t),acf.doAction("check_screen_complete",t,e)}}))},onChange:function(t,e){this.setTimeout(this.check,1)},renderPostScreen:function(c){function l(t,e){var i,n=u._data(t[0]).events;for(i in n)for(var a=0;a