Version Description
- [Improved] Improving welcome message with download instructions
- [Fixed] Text / Fix JS issue where metaboxes are not hiding - http://support.advancedcustomfields.com/discussion/5443/bug-content-editor
- [Fixed] Test / Fix lite mode issue causing category / user fields not to show
- [Fixed] Sanitize field names - http://support.advancedcustomfields.com/discussion/5262/sanitize_title-on-field-name
- [Fixed] Test / Fix conditional logic not working for mutli-select - http://support.advancedcustomfields.com/discussion/5409/conditional-logic-with-multiple-select-field
- [Fixed] Test / Fix field group duplication in WooCommerce category w SEO plugin - http://support.advancedcustomfields.com/discussion/5440/acf-woocommerce-product-category-taxonomy-bug
Download this release
Release Info
Developer | elliotcondon |
Plugin | Advanced Custom Fields |
Version | 4.0.1 |
Comparing to | |
See all releases |
Code changes from version 4.0.0 to 4.0.1
- README.md +7 -53
- acf.php +12 -8
- core/controllers/everything_fields.php +2 -2
- core/controllers/field_groups.php +110 -10
- core/controllers/input.php +7 -10
- core/controllers/upgrade.php +25 -1
- core/fields/_functions.php +6 -1
- css/acf.css +31 -1
- css/global.css +29 -0
- js/input/actions.js +10 -2
- readme.txt +36 -11
README.md
CHANGED
@@ -1,57 +1,11 @@
|
|
1 |
-
# Advanced Custom Fields
|
2 |
-
|
3 |
-
Welcome to the beta repository for Advanced Custom Fields v4.0.
|
4 |
-
This repository will be temporarily available for beta testing, issue reporting and bug fixing. Once the v4.0 plugin is ready, this repository will be removed and all code will be available on the WordPress.org website as per usual.
|
5 |
|
|
|
6 |
|
7 |
-----------------------
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
During this proccess, the entire plugin has been re written to use actions and filters instead of nested class structures. Hopefuly, as a result, we will see some Performance increases from both PHP and SQL!
|
15 |
-
|
16 |
-
|
17 |
-
### Where are the Add-ons?
|
18 |
-
|
19 |
-
The add-ons are currently not available for download, however, over the next few days a new page will appear on the ACF website where you can enter your activation code / login to your account and download the add-on files.
|
20 |
-
|
21 |
-
Each add-on is now a plugin which will pull updates from the ACF website. Each plugin has also been writen to allow for theme inclusion! Meaning, you don't need to install the plugin, you can simply include it in your functions.php file. Doing this, however, will prevent any plugin updates.
|
22 |
-
|
23 |
-
|
24 |
-
### Participate in Testing
|
25 |
-
|
26 |
-
If you have the time, please participate in this beta testing. The more developers we can get, the quicker this new version can be released!
|
27 |
-
Please report all issues related to this beta version here on github, not on the ACF support forum.
|
28 |
-
|
29 |
-
|
30 |
-
### New Featues
|
31 |
-
* [Optimized] Optimize performance by removing heavy class structure and implementing light weight hooks & filters!
|
32 |
-
* [Fixed] Fix issue with Preview / Draft where preview would not save custom field data - http://support.advancedcustomfields.com/discussion/4401/cannot-preview-or-schedule-content-to-be-published
|
33 |
-
* [Changed] Remove all Add-on code from the core plugin and separate into individual plugins with self hosted updates
|
34 |
-
* [Added] Add field group title validation
|
35 |
-
* [Fixed] Fix WPML issue where get_field_object / get_field find the wrong field
|
36 |
-
* [Fixed] Fix duplicate functionality - http://support.advancedcustomfields.com/discussion/4471/duplicate-fields-in-admin-doesn039t-replicate-repeater-fields
|
37 |
-
* [Added] Add conditional statements to tab field - http://support.advancedcustomfields.com/discussion/4674/conditional-tabs
|
38 |
-
* [Improved] Improved creating / registering a custom field - Need to ad documnetation - For now, please look at the core/fields/dummy.php file and see how a field is made!
|
39 |
-
* [Added] Add new Hooks / Filter - Need to add documnetation
|
40 |
-
|
41 |
-
|
42 |
-
### Download Add-Ons
|
43 |
-
You can now download your purchased Add-ons here: http://www.advancedcustomfields.com/add-ons-download/
|
44 |
-
|
45 |
-
|
46 |
-
### Known Issues
|
47 |
-
* The register_field() function has been removed as there is a new way to create / regsiter your own field type. This means that all previously submitted add-ons will not work. I will help all developers re-make their add-ons for v4.
|
48 |
-
* No add-ons are included in the plugin - these will be released seperatly soon
|
49 |
-
* Export page is not yet available
|
50 |
-
|
51 |
-
|
52 |
-
### Things to be improved
|
53 |
-
* Caching - Please feel free to offer any advice for caching in the plugin
|
54 |
-
|
55 |
-
|
56 |
-
### Thank You
|
57 |
-
A BIG THANK YOU to everyone who can help assist in this new version!
|
1 |
+
# Advanced Custom Fields
|
|
|
|
|
|
|
2 |
|
3 |
+
Welcome to the official repository for Advanced Custom Fields WordPress plugin.
|
4 |
|
5 |
-----------------------
|
6 |
|
7 |
+
* Readme : https://github.com/elliotcondon/acf/blob/master/readme.txt
|
8 |
+
* WordPress repository: http://wordpress.org/extend/plugins/advanced-custom-fields/
|
9 |
+
* Website : http://advancedcustomfields.com/
|
10 |
+
* Documentation: http://www.advancedcustomfields.com/resources/
|
11 |
+
* Support: http://support.advancedcustomfields.com/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress. Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker, repeater, flexible content, gallery and more!
|
6 |
-
Version: 4.0.
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
@@ -28,13 +28,17 @@ include_once('core/controllers/field_group.php');
|
|
28 |
include_once('core/controllers/input.php');
|
29 |
include_once('core/controllers/location.php');
|
30 |
|
31 |
-
if( is_admin()
|
32 |
{
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
|
@@ -62,7 +66,7 @@ class Acf
|
|
62 |
$this->settings = array(
|
63 |
'path' => apply_filters('acf/helpers/get_path', __FILE__),
|
64 |
'dir' => apply_filters('acf/helpers/get_dir', __FILE__),
|
65 |
-
'version' => '4.0.
|
66 |
'upgrade_version' => '3.4.1',
|
67 |
);
|
68 |
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress. Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker, repeater, flexible content, gallery and more!
|
6 |
+
Version: 4.0.1
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
28 |
include_once('core/controllers/input.php');
|
29 |
include_once('core/controllers/location.php');
|
30 |
|
31 |
+
if( is_admin() )
|
32 |
{
|
33 |
+
if( !ACF_LITE )
|
34 |
+
{
|
35 |
+
include_once('core/controllers/export.php');
|
36 |
+
include_once('core/controllers/addons.php');
|
37 |
+
include_once('core/controllers/third_party.php');
|
38 |
+
include_once('core/controllers/upgrade.php');
|
39 |
+
}
|
40 |
+
|
41 |
+
include_once('core/controllers/everything_fields.php');
|
42 |
}
|
43 |
|
44 |
|
66 |
$this->settings = array(
|
67 |
'path' => apply_filters('acf/helpers/get_path', __FILE__),
|
68 |
'dir' => apply_filters('acf/helpers/get_dir', __FILE__),
|
69 |
+
'version' => '4.0.1',
|
70 |
'upgrade_version' => '3.4.1',
|
71 |
);
|
72 |
|
core/controllers/everything_fields.php
CHANGED
@@ -266,7 +266,7 @@ $(document).ready(function(){
|
|
266 |
{
|
267 |
if($this->data['page_action'] == "add")
|
268 |
{
|
269 |
-
echo "$('#createuser > table.form-table > tbody').append( html );";
|
270 |
}
|
271 |
else
|
272 |
{
|
@@ -285,7 +285,7 @@ $(document).ready(function(){
|
|
285 |
}
|
286 |
else
|
287 |
{
|
288 |
-
echo "$('#edittag > table.form-table > tbody').append( html );";
|
289 |
}
|
290 |
}
|
291 |
elseif($this->data['page_type'] == "media")
|
266 |
{
|
267 |
if($this->data['page_action'] == "add")
|
268 |
{
|
269 |
+
echo "$('#createuser > table.form-table:last > tbody').append( html );";
|
270 |
}
|
271 |
else
|
272 |
{
|
285 |
}
|
286 |
else
|
287 |
{
|
288 |
+
echo "$('#edittag > table.form-table:last > tbody').append( html );";
|
289 |
}
|
290 |
}
|
291 |
elseif($this->data['page_type'] == "media")
|
core/controllers/field_groups.php
CHANGED
@@ -255,9 +255,19 @@ class acf_field_groups
|
|
255 |
<h2 class="nav-tab-wrapper">
|
256 |
<a class="acf-tab-toggle nav-tab <?php if( $tab == 'whats-new' ){ echo 'nav-tab-active'; } ?>" href="<?php echo admin_url('edit.php?post_type=acf&info=whats-new'); ?>"><?php _e("What’s New",'acf'); ?></a>
|
257 |
<a class="acf-tab-toggle nav-tab <?php if( $tab == 'changelog' ){ echo 'nav-tab-active'; } ?>" href="<?php echo admin_url('edit.php?post_type=acf&info=changelog'); ?>"><?php _e("Changelog",'acf'); ?></a>
|
|
|
|
|
|
|
258 |
</h2>
|
259 |
|
260 |
-
<?php if( $tab == 'whats-new' ):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
<table id="acf-add-ons-table" class="alignright">
|
263 |
<tr>
|
@@ -269,15 +279,28 @@ class acf_field_groups
|
|
269 |
<td><img src="<?php echo $dir; ?>images/add-ons/flexible-content-field-thumb.jpg" /></td>
|
270 |
</tr>
|
271 |
</table>
|
272 |
-
|
273 |
-
<h3><?php _e("Add-ons",'acf'); ?></h3>
|
274 |
|
275 |
-
<
|
276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
|
278 |
-
<
|
279 |
-
<p><?php _e("Download links can be found alongside the activation code in your ACF receipt.",'acf'); ?> <a href="http://www.advancedcustomfields.com/store/account/" target="_blank"><?php _e("Visit your account",'acf'); ?></a>.<br />
|
280 |
-
<?php _e("For faster access, this",'acf'); ?> <a href="http://www.advancedcustomfields.com/add-ons-download/" target="_blank"><?php _e("download page",'acf'); ?></a> <?php _e("has also been created.",'acf'); ?></p>
|
281 |
|
282 |
<hr />
|
283 |
|
@@ -319,7 +342,7 @@ class acf_field_groups
|
|
319 |
<h3><?php _e("Thank You",'acf'); ?></h3>
|
320 |
<p><?php _e("A <strong>BIG</strong> thank you to everyone who has helped test the version 4 beta and for all the support I have received.",'acf'); ?></p>
|
321 |
<p><?php _e("Without you all, this release would not have been possible!",'acf'); ?></p>
|
322 |
-
|
323 |
<?php elseif( $tab == 'changelog' ): ?>
|
324 |
|
325 |
<h3><?php _e("Changelog for",'acf'); ?> <?php echo $version; ?></h3>
|
@@ -336,12 +359,89 @@ class acf_field_groups
|
|
336 |
<?php foreach( $items as $item ):
|
337 |
|
338 |
$item = explode('http', $item);
|
339 |
-
|
340 |
|
341 |
?>
|
342 |
<li><?php echo $item[0]; ?><?php if( isset($item[1]) ): ?><a href="http<?php echo $item[1]; ?>" target="_blank"><?php _e("Learn more",'acf'); ?></a><?php endif; ?></li>
|
343 |
<?php endforeach; ?>
|
344 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
|
346 |
<?php endif; ?>
|
347 |
|
255 |
<h2 class="nav-tab-wrapper">
|
256 |
<a class="acf-tab-toggle nav-tab <?php if( $tab == 'whats-new' ){ echo 'nav-tab-active'; } ?>" href="<?php echo admin_url('edit.php?post_type=acf&info=whats-new'); ?>"><?php _e("What’s New",'acf'); ?></a>
|
257 |
<a class="acf-tab-toggle nav-tab <?php if( $tab == 'changelog' ){ echo 'nav-tab-active'; } ?>" href="<?php echo admin_url('edit.php?post_type=acf&info=changelog'); ?>"><?php _e("Changelog",'acf'); ?></a>
|
258 |
+
<?php if( $tab == 'download-add-ons' ): ?>
|
259 |
+
<a class="acf-tab-toggle nav-tab nav-tab-active" href="<?php echo admin_url('edit.php?post_type=acf&info=download-add-ons'); ?>"><?php _e("Download Add-ons",'acf'); ?></a>
|
260 |
+
<?php endif; ?>
|
261 |
</h2>
|
262 |
|
263 |
+
<?php if( $tab == 'whats-new' ):
|
264 |
+
|
265 |
+
$ac_repeater = get_option('acf_repeater_ac', '');
|
266 |
+
$ac_options_page = get_option('acf_options_page_ac', '');
|
267 |
+
$ac_flexible_content = get_option('acf_flexible_content_ac', '');
|
268 |
+
$ac_gallery = get_option('acf_gallery_ac', '');
|
269 |
+
|
270 |
+
?>
|
271 |
|
272 |
<table id="acf-add-ons-table" class="alignright">
|
273 |
<tr>
|
279 |
<td><img src="<?php echo $dir; ?>images/add-ons/flexible-content-field-thumb.jpg" /></td>
|
280 |
</tr>
|
281 |
</table>
|
|
|
|
|
282 |
|
283 |
+
<div style="margin-right: 300px;">
|
284 |
+
|
285 |
+
<h3><?php _e("Add-ons",'acf'); ?></h3>
|
286 |
+
|
287 |
+
<h4><?php _e("Activation codes have grown into plugins!",'acf'); ?></h4>
|
288 |
+
<p><?php _e("Add-ons are now activated by downloading and installing individual plugins. Although these plugins will not be hosted on the wordpress.org repository, each Add-on will continue to receive updates in the usual way.",'acf'); ?></p>
|
289 |
+
|
290 |
+
|
291 |
+
<?php if( $ac_repeater || $ac_options_page || $ac_flexible_content || $ac_gallery ): ?>
|
292 |
+
<div class="acf-alert acf-alert-success">
|
293 |
+
<p>This website uses premium Add-ons which need to be downloaded <a href="<?php echo admin_url('edit.php?post_type=acf&info=download-add-ons'); ?>" class="acf-button" style="display: inline-block;">Download your activated Add-ons</a></p>
|
294 |
+
</div>
|
295 |
+
<?php else: ?>
|
296 |
+
<div class="acf-alert acf-alert-success">
|
297 |
+
<p><?php _e("This website does not use premium Add-ons and will not be affected by this change.",'acf'); ?></p>
|
298 |
+
</div>
|
299 |
+
<?php endif; ?>
|
300 |
+
|
301 |
+
</div>
|
302 |
|
303 |
+
<div class="clear"></div>
|
|
|
|
|
304 |
|
305 |
<hr />
|
306 |
|
342 |
<h3><?php _e("Thank You",'acf'); ?></h3>
|
343 |
<p><?php _e("A <strong>BIG</strong> thank you to everyone who has helped test the version 4 beta and for all the support I have received.",'acf'); ?></p>
|
344 |
<p><?php _e("Without you all, this release would not have been possible!",'acf'); ?></p>
|
345 |
+
|
346 |
<?php elseif( $tab == 'changelog' ): ?>
|
347 |
|
348 |
<h3><?php _e("Changelog for",'acf'); ?> <?php echo $version; ?></h3>
|
359 |
<?php foreach( $items as $item ):
|
360 |
|
361 |
$item = explode('http', $item);
|
|
|
362 |
|
363 |
?>
|
364 |
<li><?php echo $item[0]; ?><?php if( isset($item[1]) ): ?><a href="http<?php echo $item[1]; ?>" target="_blank"><?php _e("Learn more",'acf'); ?></a><?php endif; ?></li>
|
365 |
<?php endforeach; ?>
|
366 |
</ul>
|
367 |
+
|
368 |
+
<?php elseif( $tab == 'download-add-ons' ): ?>
|
369 |
+
|
370 |
+
<h3><?php _e("Overview",'acf'); ?></h3>
|
371 |
+
|
372 |
+
<p>Previously, all Add-ons were unlocked via an activation code (purchased from the ACF Add-ons store). New to v4, all Add-ons act as separate plugins which need to be individually downloaded, installed and updated.</p>
|
373 |
+
|
374 |
+
<p>This page will assist you in downloading and installing each available Add-on.</p>
|
375 |
+
|
376 |
+
<h3><?php _e("Available Add-ons",'acf'); ?></h3>
|
377 |
+
|
378 |
+
<p>The following Add-ons have been detected as activated on this website.</p>
|
379 |
+
|
380 |
+
<?php
|
381 |
+
|
382 |
+
$ac_repeater = get_option('acf_repeater_ac', '');
|
383 |
+
$ac_options_page = get_option('acf_options_page_ac', '');
|
384 |
+
$ac_flexible_content = get_option('acf_flexible_content_ac', '');
|
385 |
+
$ac_gallery = get_option('acf_gallery_ac', '');
|
386 |
+
|
387 |
+
?>
|
388 |
+
<table class="widefat" id="acf-download-add-ons-table">
|
389 |
+
<thead>
|
390 |
+
<tr>
|
391 |
+
<th colspan="2">Name</th>
|
392 |
+
<th>Activation Code</th>
|
393 |
+
<th>Download</th>
|
394 |
+
</tr>
|
395 |
+
</thead>
|
396 |
+
<tbody>
|
397 |
+
<?php if( $ac_repeater ): ?>
|
398 |
+
<tr>
|
399 |
+
<td class="td-image"><img src="<?php echo $dir; ?>images/add-ons/repeater-field-thumb.jpg" style="width:50px" /></td>
|
400 |
+
<th class="td-name">Repeater Field</th>
|
401 |
+
<td class="td-code">XXXX-XXXX-XXXX-<?php echo substr($ac_repeater,-4); ?></td>
|
402 |
+
<td class="td-download"><a class="button" href="http://download.advancedcustomfields.com/<?php echo $ac_repeater; ?>/trunk">Download</a></td>
|
403 |
+
</tr>
|
404 |
+
<?php endif; ?>
|
405 |
+
<?php if( $ac_gallery ): ?>
|
406 |
+
<tr>
|
407 |
+
<td><img src="<?php echo $dir; ?>images/add-ons/gallery-field-thumb.jpg" /></td>
|
408 |
+
<th>Gallery Field</th>
|
409 |
+
<td>XXXX-XXXX-XXXX-<?php echo substr($ac_gallery,-4); ?></td>
|
410 |
+
<td><a class="button" href="http://download.advancedcustomfields.com/<?php echo $ac_gallery; ?>/trunk">Download</a></td>
|
411 |
+
</tr>
|
412 |
+
<?php endif; ?>
|
413 |
+
<?php if( $ac_options_page ): ?>
|
414 |
+
<tr>
|
415 |
+
<td><img src="<?php echo $dir; ?>images/add-ons/options-page-thumb.jpg" /></td>
|
416 |
+
<th>Options Page</th>
|
417 |
+
<td>XXXX-XXXX-XXXX-<?php echo substr($ac_options_page,-4); ?></td>
|
418 |
+
<td><a class="button" href="http://download.advancedcustomfields.com/<?php echo $ac_options_page; ?>/trunk">Download</a></td>
|
419 |
+
</tr>
|
420 |
+
<?php endif; ?>
|
421 |
+
<?php if($ac_flexible_content): ?>
|
422 |
+
<tr>
|
423 |
+
<td><img src="<?php echo $dir; ?>images/add-ons/flexible-content-field-thumb.jpg" /></td>
|
424 |
+
<th>Flexible Content</th>
|
425 |
+
<td>XXXX-XXXX-XXXX-<?php echo substr($ac_flexible_content,-4); ?></td>
|
426 |
+
<td><a class="button" href="http://download.advancedcustomfields.com/<?php echo $ac_flexible_content; ?>/trunk">Download</a></td>
|
427 |
+
</tr>
|
428 |
+
<?php endif; ?>
|
429 |
+
</tbody>
|
430 |
+
</table>
|
431 |
+
|
432 |
+
|
433 |
+
|
434 |
+
<h3><?php _e("Installation",'acf'); ?></h3>
|
435 |
+
|
436 |
+
<p>For each Add-on available, please perform the following:</p>
|
437 |
+
<ol>
|
438 |
+
<li>Download the Add-on plugin (.zip file) to your desktop</li>
|
439 |
+
<li>Navigate to <a target="_blank" href="<?php echo admin_url('plugin-install.php?tab=upload'); ?>">Plugins > Add New > Upload</a></li>
|
440 |
+
<li>Use the uploader to browse, select and install your Add-on (.zip file)</li>
|
441 |
+
<li>Once the plugin has been uploaded and installed, click the "Activate Plugin" link</li>
|
442 |
+
<li>The Add-on is now installed and activated!</li>
|
443 |
+
</ol>
|
444 |
+
|
445 |
|
446 |
<?php endif; ?>
|
447 |
|
core/controllers/input.php
CHANGED
@@ -164,7 +164,7 @@ class acf_input
|
|
164 |
$style = '';
|
165 |
if( isset($metabox_ids[0]) )
|
166 |
{
|
167 |
-
$style = $this->
|
168 |
}
|
169 |
|
170 |
|
@@ -217,19 +217,15 @@ class acf_input
|
|
217 |
|
218 |
|
219 |
/*
|
220 |
-
*
|
221 |
*
|
222 |
* @description: called by admin_head to generate acf css style (hide other metaboxes)
|
223 |
* @since 2.0.5
|
224 |
* @created: 23/06/12
|
225 |
*/
|
226 |
|
227 |
-
function
|
228 |
{
|
229 |
-
// global
|
230 |
-
global $acf_field_group;
|
231 |
-
|
232 |
-
|
233 |
// vars
|
234 |
$options = apply_filters('acf/field_group/get_options', array(), $acf_id);
|
235 |
$html = '';
|
@@ -302,11 +298,11 @@ class acf_input
|
|
302 |
* @created: 23/06/12
|
303 |
*/
|
304 |
|
305 |
-
function
|
306 |
{
|
307 |
// vars
|
308 |
$options = array(
|
309 |
-
'
|
310 |
'nonce' => ''
|
311 |
);
|
312 |
|
@@ -322,7 +318,7 @@ class acf_input
|
|
322 |
|
323 |
|
324 |
// return style
|
325 |
-
echo $this->
|
326 |
|
327 |
|
328 |
// die
|
@@ -527,6 +523,7 @@ endif;
|
|
527 |
|
528 |
function input_admin_enqueue_scripts()
|
529 |
{
|
|
|
530 |
// scripts
|
531 |
wp_enqueue_script(array(
|
532 |
'jquery',
|
164 |
$style = '';
|
165 |
if( isset($metabox_ids[0]) )
|
166 |
{
|
167 |
+
$style = $this->get_style( $metabox_ids[0] );
|
168 |
}
|
169 |
|
170 |
|
217 |
|
218 |
|
219 |
/*
|
220 |
+
* get_style
|
221 |
*
|
222 |
* @description: called by admin_head to generate acf css style (hide other metaboxes)
|
223 |
* @since 2.0.5
|
224 |
* @created: 23/06/12
|
225 |
*/
|
226 |
|
227 |
+
function get_style( $acf_id )
|
228 |
{
|
|
|
|
|
|
|
|
|
229 |
// vars
|
230 |
$options = apply_filters('acf/field_group/get_options', array(), $acf_id);
|
231 |
$html = '';
|
298 |
* @created: 23/06/12
|
299 |
*/
|
300 |
|
301 |
+
function ajax_get_style()
|
302 |
{
|
303 |
// vars
|
304 |
$options = array(
|
305 |
+
'acf_id' => 0,
|
306 |
'nonce' => ''
|
307 |
);
|
308 |
|
318 |
|
319 |
|
320 |
// return style
|
321 |
+
echo $this->get_style( $options['acf_id'] );
|
322 |
|
323 |
|
324 |
// die
|
523 |
|
524 |
function input_admin_enqueue_scripts()
|
525 |
{
|
526 |
+
|
527 |
// scripts
|
528 |
wp_enqueue_script(array(
|
529 |
'jquery',
|
core/controllers/upgrade.php
CHANGED
@@ -25,7 +25,7 @@ class acf_upgrade
|
|
25 |
// actions
|
26 |
add_action('admin_menu', array($this,'admin_menu'), 11);
|
27 |
add_action('wp_ajax_acf_upgrade', array($this, 'upgrade_ajax'));
|
28 |
-
|
29 |
}
|
30 |
|
31 |
|
@@ -67,10 +67,34 @@ class acf_upgrade
|
|
67 |
}
|
68 |
}
|
69 |
|
|
|
70 |
add_submenu_page('edit.php?post_type=acf', __('Upgrade','acf'), __('Upgrade','acf'), 'manage_options','acf-upgrade', array($this,'html') );
|
71 |
}
|
72 |
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/*
|
75 |
* html
|
76 |
*
|
25 |
// actions
|
26 |
add_action('admin_menu', array($this,'admin_menu'), 11);
|
27 |
add_action('wp_ajax_acf_upgrade', array($this, 'upgrade_ajax'));
|
28 |
+
//add_action('admin_footer', array($this, 'admin_footer'), 99);
|
29 |
}
|
30 |
|
31 |
|
67 |
}
|
68 |
}
|
69 |
|
70 |
+
|
71 |
add_submenu_page('edit.php?post_type=acf', __('Upgrade','acf'), __('Upgrade','acf'), 'manage_options','acf-upgrade', array($this,'html') );
|
72 |
}
|
73 |
|
74 |
|
75 |
+
/*
|
76 |
+
* admin_footer
|
77 |
+
*
|
78 |
+
* @description:
|
79 |
+
* @since: 3.6
|
80 |
+
* @created: 3/04/13
|
81 |
+
*/
|
82 |
+
|
83 |
+
function admin_footer()
|
84 |
+
{
|
85 |
+
// Mesages
|
86 |
+
$dismissed = get_option('acf_dismissed', array());
|
87 |
+
|
88 |
+
if( !in_array('download_addons', $dismissed) )
|
89 |
+
{
|
90 |
+
// update db
|
91 |
+
//$dismissed[] = 'download_addons';
|
92 |
+
//update_option('acf_dismissed', $dismissed );
|
93 |
+
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
/*
|
99 |
* html
|
100 |
*
|
core/fields/_functions.php
CHANGED
@@ -416,7 +416,7 @@ class acf_field_functions
|
|
416 |
$id = str_replace('[', '-', $id); // location rules (select) does'nt have "fields[" in it
|
417 |
$id = str_replace(']', '', $id);
|
418 |
|
419 |
-
$field['id'] = 'acf-' . $id;
|
420 |
}
|
421 |
|
422 |
|
@@ -435,6 +435,11 @@ class acf_field_functions
|
|
435 |
|
436 |
function update_field( $field, $post_id )
|
437 |
{
|
|
|
|
|
|
|
|
|
|
|
438 |
// filters
|
439 |
$field = apply_filters('acf/update_field/type=' . $field['type'], $field, $post_id ); // new filter
|
440 |
|
416 |
$id = str_replace('[', '-', $id); // location rules (select) does'nt have "fields[" in it
|
417 |
$id = str_replace(']', '', $id);
|
418 |
|
419 |
+
$field['id'] = 'acf-field-' . $id;
|
420 |
}
|
421 |
|
422 |
|
435 |
|
436 |
function update_field( $field, $post_id )
|
437 |
{
|
438 |
+
// sanitize field name
|
439 |
+
// - http://support.advancedcustomfields.com/discussion/5262/sanitize_title-on-field-name
|
440 |
+
$field['name'] = sanitize_title( $field['name'] );
|
441 |
+
|
442 |
+
|
443 |
// filters
|
444 |
$field = apply_filters('acf/update_field/type=' . $field['type'], $field, $post_id ); // new filter
|
445 |
|
css/acf.css
CHANGED
@@ -255,7 +255,7 @@ body.custom-fields_page_acf-settings .wp-pointer-arrow {
|
|
255 |
}
|
256 |
|
257 |
#acf-add-ons-table {
|
258 |
-
|
259 |
}
|
260 |
|
261 |
#acf-add-ons-table img {
|
@@ -291,6 +291,36 @@ body.custom-fields_page_acf-settings .wp-pointer-arrow {
|
|
291 |
}
|
292 |
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
/*--------------------------------------------------------------------------
|
296 |
*
|
255 |
}
|
256 |
|
257 |
#acf-add-ons-table {
|
258 |
+
|
259 |
}
|
260 |
|
261 |
#acf-add-ons-table img {
|
291 |
}
|
292 |
|
293 |
|
294 |
+
/*
|
295 |
+
* Download
|
296 |
+
*/
|
297 |
+
|
298 |
+
|
299 |
+
#acf-download-add-ons-table {
|
300 |
+
width: auto;
|
301 |
+
min-width: 500px;
|
302 |
+
}
|
303 |
+
|
304 |
+
#acf-download-add-ons-table img {
|
305 |
+
width: 50px;
|
306 |
+
}
|
307 |
+
|
308 |
+
#acf-download-add-ons-table td {
|
309 |
+
vertical-align: middle;
|
310 |
+
}
|
311 |
+
|
312 |
+
#acf-download-add-ons-table td.td-image {
|
313 |
+
width: 50px;
|
314 |
+
}
|
315 |
+
|
316 |
+
#acf-download-add-ons-table td.td-name {
|
317 |
+
|
318 |
+
}
|
319 |
+
|
320 |
+
#acf-download-add-ons-table td.td-download {
|
321 |
+
width: 90px;
|
322 |
+
}
|
323 |
+
|
324 |
|
325 |
/*--------------------------------------------------------------------------
|
326 |
*
|
css/global.css
CHANGED
@@ -77,6 +77,35 @@ input.ir { border: 0 none; background: none; }
|
|
77 |
color: #B94A48;
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
/*--------------------------------------------------------------------------------------------
|
82 |
*
|
77 |
color: #B94A48;
|
78 |
}
|
79 |
|
80 |
+
.acf-alert.acf-alert-success {
|
81 |
+
background-color: #DFF0D8;
|
82 |
+
border-color: #D6E9C6;
|
83 |
+
color: #468847;
|
84 |
+
}
|
85 |
+
|
86 |
+
.acf-message {
|
87 |
+
background: #2F353E;
|
88 |
+
border-radius: 4px 4px 4px 4px;
|
89 |
+
border: #000 solid 1px;
|
90 |
+
color: #fff;
|
91 |
+
text-shadow: 0 1px 0 #000;
|
92 |
+
padding: 0 10px;
|
93 |
+
margin: 10px 0;
|
94 |
+
}
|
95 |
+
|
96 |
+
.acf-message p {
|
97 |
+
font-size: 15px;
|
98 |
+
margin: 15px 0;
|
99 |
+
}
|
100 |
+
|
101 |
+
.acf-message .acf-button,
|
102 |
+
.acf-alert .acf-button{
|
103 |
+
font-size: 15px;
|
104 |
+
padding: 8px 12px;
|
105 |
+
margin-left: 5px;
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
|
110 |
/*--------------------------------------------------------------------------------------------
|
111 |
*
|
js/input/actions.js
CHANGED
@@ -422,16 +422,24 @@ var acf = {
|
|
422 |
}
|
423 |
else
|
424 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
if( options.operator == "==" )
|
426 |
{
|
427 |
-
if(
|
428 |
{
|
429 |
r = true;
|
430 |
}
|
431 |
}
|
432 |
else
|
433 |
{
|
434 |
-
if(
|
435 |
{
|
436 |
r = true;
|
437 |
}
|
422 |
}
|
423 |
else
|
424 |
{
|
425 |
+
// get val and make sure it is an array
|
426 |
+
var val = toggle.find('*[name]:last').val();
|
427 |
+
if( !$.isArray(val) )
|
428 |
+
{
|
429 |
+
val = [ val ];
|
430 |
+
}
|
431 |
+
|
432 |
+
|
433 |
if( options.operator == "==" )
|
434 |
{
|
435 |
+
if( $.inArray(options.value, val) > -1 )
|
436 |
{
|
437 |
r = true;
|
438 |
}
|
439 |
}
|
440 |
else
|
441 |
{
|
442 |
+
if( $.inArray(options.value, val) < 0 )
|
443 |
{
|
444 |
r = true;
|
445 |
}
|
readme.txt
CHANGED
@@ -8,6 +8,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
8 |
|
9 |
Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
10 |
|
|
|
11 |
== Description ==
|
12 |
|
13 |
Advanced Custom Fields is the perfect solution for any wordpress website which needs more flexible data like other Content Management Systems.
|
@@ -23,36 +24,51 @@ Advanced Custom Fields is the perfect solution for any wordpress website which n
|
|
23 |
* Tab (Group fields into tabs)
|
24 |
* Text (type text, api returns text)
|
25 |
* Text Area (type text, api returns text with `<br />` tags)
|
|
|
|
|
|
|
|
|
26 |
* WYSIWYG (a wordpress wysiwyg editor, api returns html)
|
27 |
* Image (upload an image, api returns the url)
|
28 |
* File (upload a file, api returns the url)
|
|
|
29 |
* Select (drop down list of choices, api returns chosen item)
|
30 |
-
* Checkbox (
|
31 |
-
*
|
32 |
-
* Post Object (select 1 or more page, post or custom post types, api returns post objects)
|
33 |
-
* Date Picker (jquery date picker, options for format, api returns string)
|
34 |
* True / False (tick box with message, api returns true or false)
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
* Color Picker (Farbtastic!)
|
|
|
37 |
* Repeater (ability to create repeatable blocks of fields!)
|
38 |
* Flexible Content (ability to create flexible blocks of fields!)
|
39 |
* Gallery (Add, edit and order multiple images in 1 simple field)
|
|
|
40 |
|
41 |
= Tested on =
|
42 |
* Mac Firefox :)
|
43 |
* Mac Safari :)
|
44 |
* Mac Chrome :)
|
45 |
* PC Firefox :)
|
46 |
-
* PC ie7
|
47 |
|
48 |
= Website =
|
49 |
http://www.advancedcustomfields.com/
|
50 |
|
51 |
= Documentation =
|
52 |
-
http://www.advancedcustomfields.com/
|
53 |
-
|
54 |
-
|
55 |
-
http://www.advancedcustomfields.com/
|
|
|
|
|
|
|
56 |
|
57 |
= Bug Submission and Forum Support =
|
58 |
http://support.advancedcustomfields.com/
|
@@ -85,12 +101,21 @@ http://support.advancedcustomfields.com/
|
|
85 |
|
86 |
3. The Page edit screen after creating the Advanced Custom Fields
|
87 |
|
88 |
-
4. Simple and intuitive API. Read the documentation at: http://www.advancedcustomfields.com/
|
89 |
|
90 |
|
91 |
== Changelog ==
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
= 4.0.0 =
|
|
|
94 |
* [Optimized] Optimize performance by removing heavy class structure and implementing light weight hooks & filters!
|
95 |
* [Changed] Remove all Add-on code from the core plugin and separate into individual plugins with self hosted updates
|
96 |
* [Added] Add field 'Taxonomy'
|
8 |
|
9 |
Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
10 |
|
11 |
+
|
12 |
== Description ==
|
13 |
|
14 |
Advanced Custom Fields is the perfect solution for any wordpress website which needs more flexible data like other Content Management Systems.
|
24 |
* Tab (Group fields into tabs)
|
25 |
* Text (type text, api returns text)
|
26 |
* Text Area (type text, api returns text with `<br />` tags)
|
27 |
+
* Number (type number, api returns integer)
|
28 |
+
* Email (type email, api returns text)
|
29 |
+
* Password (type password, api returns text)
|
30 |
+
|
31 |
* WYSIWYG (a wordpress wysiwyg editor, api returns html)
|
32 |
* Image (upload an image, api returns the url)
|
33 |
* File (upload a file, api returns the url)
|
34 |
+
|
35 |
* Select (drop down list of choices, api returns chosen item)
|
36 |
+
* Checkbox (tickbox list of choices, api returns array of choices)
|
37 |
+
* Radio Buttons ( radio button list of choices, api returns chosen item)
|
|
|
|
|
38 |
* True / False (tick box with message, api returns true or false)
|
39 |
+
|
40 |
+
* Page Link (select 1 or more page, post or custom post types, api returns the selected url)
|
41 |
+
* Post Object (select 1 or more page, post or custom post types, api returns the selected post objects)
|
42 |
+
* Relationship (search, select and order post objects with a tidy interface, api returns the selected post objects)
|
43 |
+
* Taxonomy (select taxonomy terms with options to load, display and save, api returns the selected term objects)
|
44 |
+
* User (select 1 or more WP users, api returns the selected user objects)
|
45 |
+
|
46 |
+
* Date Picker (jquery date picker, options for format, api returns string)
|
47 |
* Color Picker (Farbtastic!)
|
48 |
+
|
49 |
* Repeater (ability to create repeatable blocks of fields!)
|
50 |
* Flexible Content (ability to create flexible blocks of fields!)
|
51 |
* Gallery (Add, edit and order multiple images in 1 simple field)
|
52 |
+
* [Custom](http://www.advancedcustomfields.com/resources/tutorials/creating-a-new-field-type/) (Create your own field type!)
|
53 |
|
54 |
= Tested on =
|
55 |
* Mac Firefox :)
|
56 |
* Mac Safari :)
|
57 |
* Mac Chrome :)
|
58 |
* PC Firefox :)
|
59 |
+
* PC ie7 :S
|
60 |
|
61 |
= Website =
|
62 |
http://www.advancedcustomfields.com/
|
63 |
|
64 |
= Documentation =
|
65 |
+
* [Getting Started](http://www.advancedcustomfields.com/resources/#getting-started)
|
66 |
+
* [Field Types](http://www.advancedcustomfields.com/resources/#field-types)
|
67 |
+
* [Functions](http://www.advancedcustomfields.com/resources/#functions)
|
68 |
+
* [Actions](http://www.advancedcustomfields.com/resources/#actions)
|
69 |
+
* [Filters](http://www.advancedcustomfields.com/resources/#filters)
|
70 |
+
* [How to guides](http://www.advancedcustomfields.com/resources/#how-to)
|
71 |
+
* [Tutorials](http://www.advancedcustomfields.com/resources/#tutorials)
|
72 |
|
73 |
= Bug Submission and Forum Support =
|
74 |
http://support.advancedcustomfields.com/
|
101 |
|
102 |
3. The Page edit screen after creating the Advanced Custom Fields
|
103 |
|
104 |
+
4. Simple and intuitive API. Read the documentation at: http://www.advancedcustomfields.com/resources/
|
105 |
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 4.0.1 =
|
110 |
+
* [Improved] Improving welcome message with download instructions
|
111 |
+
* [Fixed] Text / Fix JS issue where metaboxes are not hiding - http://support.advancedcustomfields.com/discussion/5443/bug-content-editor
|
112 |
+
* [Fixed] Test / Fix lite mode issue causing category / user fields not to show
|
113 |
+
* [Fixed] Sanitize field names - http://support.advancedcustomfields.com/discussion/5262/sanitize_title-on-field-name
|
114 |
+
* [Fixed] Test / Fix conditional logic not working for mutli-select - http://support.advancedcustomfields.com/discussion/5409/conditional-logic-with-multiple-select-field
|
115 |
+
* [Fixed] Test / Fix field group duplication in WooCommerce category w SEO plugin - http://support.advancedcustomfields.com/discussion/5440/acf-woocommerce-product-category-taxonomy-bug
|
116 |
+
|
117 |
= 4.0.0 =
|
118 |
+
* [IMPORTANT] This update contains major changes to premium and custom field type Add-ons. Please read the [Migrating from v3 to v4 guide](http://www.advancedcustomfields.com/resources/getting-started/migrating-from-v3-to-v4/)
|
119 |
* [Optimized] Optimize performance by removing heavy class structure and implementing light weight hooks & filters!
|
120 |
* [Changed] Remove all Add-on code from the core plugin and separate into individual plugins with self hosted updates
|
121 |
* [Added] Add field 'Taxonomy'
|