Version Description
- Plugin: Less aggressive ACF Pro check on activation. Now displaying a notice (allowing pre-activation of ACF Extended)
- Plugin: Readme text fix
Download this release
Release Info
Developer | hwk-fr |
Plugin | Advanced Custom Fields: Extended |
Version | 0.5.8.1 |
Comparing to | |
See all releases |
Code changes from version 0.5.8 to 0.5.8.1
- acf-extended.php +14 -15
- includes/core/helpers.php +0 -38
- init.php +28 -0
- readme.txt +15 -12
acf-extended.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
-
* Version: 0.5.8
|
6 |
-
* Author: hwk
|
7 |
* Author URI: https://hwk.fr
|
8 |
* Text Domain: acfe
|
9 |
*/
|
@@ -22,22 +22,18 @@ if(!defined('ACFE_THEME_PATH')) define('ACFE_THEME_PATH', get_stylesheet_directo
|
|
22 |
if(!defined('ACFE_THEME_URL')) define('ACFE_THEME_URL', get_stylesheet_directory_uri());
|
23 |
|
24 |
/**
|
25 |
-
* ACFE:
|
26 |
*/
|
27 |
-
|
28 |
-
function acfe_activate(){
|
29 |
-
if(class_exists('ACF') && defined('ACF_PRO') && ACF_PRO === true && version_compare(ACF_VERSION, '5.7.10', '>='))
|
30 |
-
return;
|
31 |
-
|
32 |
-
deactivate_plugins(ACFE_BASENAME);
|
33 |
-
wp_die(__('ACF Extended requires at least ACF Pro version 5.7.10'));
|
34 |
-
}
|
35 |
|
36 |
/**
|
37 |
-
* ACFE:
|
38 |
*/
|
39 |
-
add_action('acf/include_fields', '
|
40 |
-
function
|
|
|
|
|
|
|
41 |
|
42 |
/**
|
43 |
* Settings
|
@@ -92,11 +88,14 @@ function acfe_init(){
|
|
92 |
}
|
93 |
|
94 |
/**
|
95 |
-
* Fields
|
96 |
*/
|
97 |
add_action('acf/include_field_types', 'acfe_fields');
|
98 |
function acfe_fields(){
|
99 |
|
|
|
|
|
|
|
100 |
require_once(ACFE_PATH . 'includes/fields/field-button.php');
|
101 |
require_once(ACFE_PATH . 'includes/fields/field-dynamic-message.php');
|
102 |
require_once(ACFE_PATH . 'includes/fields/field-post-types.php');
|
2 |
/**
|
3 |
* Plugin Name: Advanced Custom Fields: Extended
|
4 |
* Description: Enhancement Suite which improves Advanced Custom Fields administration
|
5 |
+
* Version: 0.5.8.1
|
6 |
+
* Author: hwk
|
7 |
* Author URI: https://hwk.fr
|
8 |
* Text Domain: acfe
|
9 |
*/
|
22 |
if(!defined('ACFE_THEME_URL')) define('ACFE_THEME_URL', get_stylesheet_directory_uri());
|
23 |
|
24 |
/**
|
25 |
+
* ACFE: Init
|
26 |
*/
|
27 |
+
require_once(ACFE_PATH . 'init.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
/**
|
30 |
+
* ACFE: Load
|
31 |
*/
|
32 |
+
add_action('acf/include_fields', 'acfe_load');
|
33 |
+
function acfe_load(){
|
34 |
+
|
35 |
+
if(!acfe_is_acf_pro())
|
36 |
+
return;
|
37 |
|
38 |
/**
|
39 |
* Settings
|
88 |
}
|
89 |
|
90 |
/**
|
91 |
+
* ACFE: Fields
|
92 |
*/
|
93 |
add_action('acf/include_field_types', 'acfe_fields');
|
94 |
function acfe_fields(){
|
95 |
|
96 |
+
if(!acfe_is_acf_pro())
|
97 |
+
return;
|
98 |
+
|
99 |
require_once(ACFE_PATH . 'includes/fields/field-button.php');
|
100 |
require_once(ACFE_PATH . 'includes/fields/field-dynamic-message.php');
|
101 |
require_once(ACFE_PATH . 'includes/fields/field-post-types.php');
|
includes/core/helpers.php
CHANGED
@@ -3,44 +3,6 @@
|
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
6 |
-
/**
|
7 |
-
* ACFE: Print
|
8 |
-
*/
|
9 |
-
if(!function_exists('acfe_print')){
|
10 |
-
function acfe_print($data, $args = false){
|
11 |
-
$args = wp_parse_args($args, array(
|
12 |
-
'title' => false,
|
13 |
-
'return' => false,
|
14 |
-
'dump' => false,
|
15 |
-
'pre' => true,
|
16 |
-
));
|
17 |
-
|
18 |
-
$code = print_r($data, true);
|
19 |
-
if($args['dump']){
|
20 |
-
ob_start();
|
21 |
-
var_dump($data);
|
22 |
-
$code = ob_get_clean();
|
23 |
-
}
|
24 |
-
|
25 |
-
$title = false;
|
26 |
-
if($args['title'])
|
27 |
-
$title = '<h5><strong>' . $args['title'] . '</strong></h5><hr>';
|
28 |
-
|
29 |
-
$pre_start = $pre_end = false;
|
30 |
-
if($args['pre']){
|
31 |
-
$pre_start = "<pre style='position:relative; z-index:1000000;'>";
|
32 |
-
$pre_end = "</pre>";
|
33 |
-
}
|
34 |
-
|
35 |
-
$return = $pre_start . $title . $code . $pre_end;
|
36 |
-
|
37 |
-
if($args['return'])
|
38 |
-
return $return;
|
39 |
-
|
40 |
-
echo $return;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
function acfe_get_field_group_from_field($field){
|
45 |
|
46 |
$field_parent = $field['parent'];
|
3 |
if(!defined('ABSPATH'))
|
4 |
exit;
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
function acfe_get_field_group_from_field($field){
|
7 |
|
8 |
$field_parent = $field['parent'];
|
init.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* ACFE: Is ACF Pro Active
|
8 |
+
*/
|
9 |
+
function acfe_is_acf_pro(){
|
10 |
+
|
11 |
+
return class_exists('ACF') && defined('ACF_PRO') && defined('ACF_VERSION') && version_compare(ACF_VERSION, '5.7.10', '>=');
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ACFE: ACF Pro Check
|
17 |
+
*/
|
18 |
+
add_filter('plugin_row_meta', 'acfe_plugin_meta', 10, 4);
|
19 |
+
function acfe_plugin_meta($plugin_meta, $plugin_file, $plugin_data, $status){
|
20 |
+
|
21 |
+
if($plugin_file != ACFE_BASENAME || acfe_is_acf_pro())
|
22 |
+
return $plugin_meta;
|
23 |
+
|
24 |
+
$plugin_meta[] = '<span style="color:#a00;">Advanced Custom Fields PRO is required</span>';
|
25 |
+
|
26 |
+
return $plugin_meta;
|
27 |
+
|
28 |
+
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: acf, custom fields, meta, admin, fields, form, repeater, content
|
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.1.1
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 0.5.8
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -74,15 +74,7 @@ Quick view of field groups keys
|
|
74 |
* **Bidirectional fields**
|
75 |
An advanced bidirectional setting (also called post-to-post) is available for the following fields: Relationship, Post object, User & Taxonomy terms.
|
76 |
Fields will work bidirectionally and automatically updating each others. Works in groups & clones (prefixed field names must be turned off).
|
77 |
-
|
78 |
-
Usage example:
|
79 |
-
- Create a field group "Page: Relation" displaying on the post type: page
|
80 |
-
- Inside it, create a relationship field, allowing the post type: post
|
81 |
-
- Create an another field group "Post: Relation" displaying on the post type: post
|
82 |
-
- Inside it, create a relationship field, allowing the post type: page
|
83 |
-
- Activate the "Bidirectional" setting and select the "Page: Relation" relationship field
|
84 |
-
- Edit any page, and select any post of the post type post
|
85 |
-
- The page is now also saved in the said post
|
86 |
|
87 |
* **Advanced validation**
|
88 |
A more sophisticated validation conditions (AND/OR) with custom error messages in the post edition screen.
|
@@ -165,13 +157,20 @@ An advanced bidirectional setting (also called post-to-post) is available for th
|
|
165 |
Fields will work bidirectionally and automatically updating each others. Works in groups & clones (prefixed field names must be turned off).
|
166 |
|
167 |
Usage example:
|
|
|
168 |
* Create a field group "Page: Relation" displaying on the post type: page
|
|
|
169 |
* Inside it, create a relationship field, allowing the post type: post
|
|
|
170 |
* Create an another field group "Post: Relation" displaying on the post type: post
|
|
|
171 |
* Inside it, create a relationship field, allowing the post type: page
|
|
|
172 |
* Activate the "Bidirectional" setting and select the "Page: Relation" relationship field
|
173 |
-
|
174 |
-
*
|
|
|
|
|
175 |
|
176 |
== Screenshots ==
|
177 |
|
@@ -186,6 +185,10 @@ Usage example:
|
|
186 |
|
187 |
== Changelog ==
|
188 |
|
|
|
|
|
|
|
|
|
189 |
= 0.5.8 =
|
190 |
* Field: Added Bidirectional setting for the following fields: relationship, post object, user & taxonomy terms
|
191 |
* Module: Added 'Ajax Author' field to replace the native WP Author Meta Box
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 5.1.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 0.5.8.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
74 |
* **Bidirectional fields**
|
75 |
An advanced bidirectional setting (also called post-to-post) is available for the following fields: Relationship, Post object, User & Taxonomy terms.
|
76 |
Fields will work bidirectionally and automatically updating each others. Works in groups & clones (prefixed field names must be turned off).
|
77 |
+
[Usage example is available in the FAQ](#faq)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
* **Advanced validation**
|
80 |
A more sophisticated validation conditions (AND/OR) with custom error messages in the post edition screen.
|
157 |
Fields will work bidirectionally and automatically updating each others. Works in groups & clones (prefixed field names must be turned off).
|
158 |
|
159 |
Usage example:
|
160 |
+
|
161 |
* Create a field group "Page: Relation" displaying on the post type: page
|
162 |
+
|
163 |
* Inside it, create a relationship field, allowing the post type: post
|
164 |
+
|
165 |
* Create an another field group "Post: Relation" displaying on the post type: post
|
166 |
+
|
167 |
* Inside it, create a relationship field, allowing the post type: page
|
168 |
+
|
169 |
* Activate the "Bidirectional" setting and select the "Page: Relation" relationship field
|
170 |
+
|
171 |
+
* Edit any page, and select any post of the post type post in the relationship field
|
172 |
+
|
173 |
+
* The page is now also saved in the said post relationship field
|
174 |
|
175 |
== Screenshots ==
|
176 |
|
185 |
|
186 |
== Changelog ==
|
187 |
|
188 |
+
= 0.5.8.1 =
|
189 |
+
* Plugin: Less aggressive ACF Pro check on activation. Now displaying a notice (allowing pre-activation of ACF Extended)
|
190 |
+
* Plugin: Readme text fix
|
191 |
+
|
192 |
= 0.5.8 =
|
193 |
* Field: Added Bidirectional setting for the following fields: relationship, post object, user & taxonomy terms
|
194 |
* Module: Added 'Ajax Author' field to replace the native WP Author Meta Box
|