-
Notifications
You must be signed in to change notification settings - Fork 12
/
readme.txt
151 lines (106 loc) · 4.73 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
=== ACF: Fields in Custom Table ===
Contributors: eduardo.marcolino
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TW8LTG6J7XVP2&item_name=Donation+for+Wordpress+Plugin¤cy_code=USD
Tags: acf,advanced custom fields,fields,meta,custom fields
Requires at least: 4.9.0
Tested up to: 5.7
Stable tag: 0.5
Requires PHP: 7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Stores ACF custom fields in a custom table instead of WordPress core meta tables.
== Description ==
This ACF plugin makes it possible to store ACF data in structured database tables instead of WordPress core meta tables.
It uses ACF's `acf/update_field_group` hook to create/update the database and then uses `acf/save_post` hook to store the data.
It was heavily inspired by Austin Ginder's post [https://anchor.host/acf-custom-fields-stored-in-custom-table/](https://anchor.host/acf-custom-fields-stored-in-custom-table/).
You can contribute to this plugin by submit PR/Issue in [https://github.com/eduardo-marcolino/acf-fields-in-custom-table](https://github.com/eduardo-marcolino/acf-fields-in-custom-table).
= Supported Fields =
* Text
* Text Area
* Number
* Range
* Email
* URL
* Password
* Image
* File
* Wysiwyg Editor
* oEmbed
* Select
* Checkbox
* Radio Button
* Button Group
* True / False
* Date Picker
* Date Time Picker
* Time Picker
* Color Picker
* Link
* Post Object
* Page Link
* Relationship
* Taxonomy
* User
= Relational Fields =
This plugin supports the following relational field types: Post Object, Page Link, Relationship, Taxonomy and User.
It can store both single and multiple values based on the `multiple` option.
* If it's a single value field, then the column type will be `bigint(20) unsigned`
* If it's a multiple value field, then the column type will be longtext and the date will be stored in json format.
You can query relational fields with multiple values using using MySQL's function [JSON_CONTAINS](https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#function_json-contains).
Here is an example:
Table:
`
+---------+-------------------+--------+
| post_id | title | stores |
+---------+-------------------+--------+
| 1 | Lord of the Flies | [1,2] |
| 2 | The Island | [2] |
| 3 | 1984 | [3] |
+---------+-------------------+--------+
`
Query:
`SELECT * FROM wp_acf_books WHERE JSON_CONTAINS(stores, 2, '$')`
The query above will return "Lord of the Flies" and "The Island".
= ACF Compatibility =
This plugin was tested with *ACF 5 FREE Version* .
== Frequently Asked Questions ==
= This plugin supports custom post types? =
Yes. It supports custom post types and built in types of post and page
= What happens if I use unsupported field? =
The value will be stored in the core meta tables instead of the custom table
Yes. It supports custom post types and built in types of post and page
= What are the plugin filters and actions ? =
The plugin provides filters to allow developers to customize the plugin behavior.
Please [access the documentation](https://github.com/eduardo-marcolino/acf-fields-in-custom-table#filters) to get the list of it.
== Screenshots ==
1. Enabling ACF: Fields in Custom Table
== Installation ==
Setting up ACF: Fields in Custom Table is very simple. Follow these easy steps
1. Upload the plugin to your `/wp-content/plugins/` directory;
2. Activate the plugin in your WordPress admin;
3. Go to the Custom Fields > Field Groups menu, edit or create a field group and enable ACF: Fields in Custom Table option;
== Changelog ==
= 0.5 =
* Added filter acfict_table_prefix to customize table prefix
* Added setting for allow user to disable table prefix usage
* Testing on Wordpress 5.7
= 0.4 =
* Small performance improvement and testing on Wordpress 5.6
= 0.3 =
* Added support for the following field types: Link, Post Object, Page Link, Relationship, Taxonomy and User
= 0.2 =
* Added support for the following field types: Range, Image, File, oEmbed, Checkbox, Radio Button, Date Time Picker, Time Picker
* Using dbDelta function to modify table
= 0.1 =
* First version of the plugin released
== Upgrade Notice ==
= 0.5 =
Plugin tested on Wordpress 5.7, documentation improvement and more control over table prefix and table name.
= 0.4 =
Plugin tested on Wordpress 5.6 and small performance improvement.
= 0.3 =
Added plugin support for 6 more fields: Link, Post Object, Page Link, Relationship, Taxonomy and User along with major refactory to improve code quality.
= 0.2 =
Added support for the following field types Range, Image, File, oEmbed, Checkbox, Radio Button, Date Time Picker, Time Picker. The plugin now delegates all the database modifications to the dbDelta function.
= 0.1 =
* Just released into the wild.