{"id":132148,"date":"2020-11-26T10:35:32","date_gmt":"2020-11-26T10:35:32","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/acf-fields-in-custom-table\/"},"modified":"2021-05-26T09:18:03","modified_gmt":"2021-05-26T09:18:03","slug":"acf-fields-in-custom-table","status":"publish","type":"plugin","link":"https:\/\/so.wordpress.org\/plugins\/acf-fields-in-custom-table\/","author":14309892,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.5","stable_tag":"0.5","tested":"5.7.15","requires":"4.9.0","requires_php":"7.0","requires_plugins":"","header_name":"ACF: Fields in Custom Table","header_author":"Eduardo Marcolino","header_description":"Stores ACF custom fields in a custom table instead of WordPress' core meta tables.","assets_banners_color":"363c59","last_updated":"2021-05-26 09:18:03","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_donations&business=TW8LTG6J7XVP2&item_name=Donation+for+Wordpress+Plugin&currency_code=USD","header_plugin_uri":"","header_author_uri":"https:\/\/eduardomarcolino.com","rating":5,"author_block_rating":0,"active_installs":90,"downloads":3533,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1":{"tag":"0.1","author":"eduardo.marcolino","date":"2020-11-26 20:31:48"},"0.2":{"tag":"0.2","author":"eduardo.marcolino","date":"2020-11-27 13:29:57"},"0.3":{"tag":"0.3","author":"eduardo.marcolino","date":"2020-12-05 13:50:48"},"0.4":{"tag":"0.4","author":"eduardo.marcolino","date":"2020-12-19 11:41:46"},"0.5":{"tag":"0.5","author":"eduardo.marcolino","date":"2021-05-26 09:18:03"}},"upgrade_notice":{"0.5":"<p>Plugin tested on Wordpress 5.7, documentation improvement and more control over table prefix and table name.<\/p>","0.4":"<p>Plugin tested on Wordpress 5.6 and small performance improvement.<\/p>","0.3":"<p>Added plugin support for 6 more fields: Link, Post Object, Page Link, Relationship, Taxonomy and User along with major refactory to improve code quality.<\/p>","0.2":"<p>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.<\/p>","0.1":"<ul>\n<li>Just released into the wild.<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2426457,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2426457,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2426457,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2426457,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.3","0.4","0.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2426457,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"Enabling ACF: Fields in Custom Table"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2211,2217,2010,2235,683],"plugin_category":[59],"plugin_contributors":[87469],"plugin_business_model":[],"class_list":["post-132148","plugin","type-plugin","status-publish","hentry","plugin_tags-acf","plugin_tags-advanced-custom-fields","plugin_tags-custom-fields","plugin_tags-fields","plugin_tags-meta","plugin_category-utilities-and-tools","plugin_contributors-eduardomarcolino","plugin_committers-eduardomarcolino"],"banners":{"banner":"https:\/\/ps.w.org\/acf-fields-in-custom-table\/assets\/banner-772x250.png?rev=2426457","banner_2x":"https:\/\/ps.w.org\/acf-fields-in-custom-table\/assets\/banner-1544x500.png?rev=2426457","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/acf-fields-in-custom-table\/assets\/icon-128x128.png?rev=2426457","icon_2x":"https:\/\/ps.w.org\/acf-fields-in-custom-table\/assets\/icon-256x256.png?rev=2426457","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/acf-fields-in-custom-table\/assets\/screenshot-1.png?rev=2426457","caption":"Enabling ACF: Fields in Custom Table"}],"raw_content":"<!--section=description-->\n<p>This ACF plugin makes it possible to store ACF data in structured database tables instead of WordPress core meta tables.<\/p>\n\n<p>It uses ACF's <code>acf\/update_field_group<\/code> hook to create\/update the database and then uses <code>acf\/save_post<\/code> hook to store the data.<\/p>\n\n<p>It was heavily inspired by Austin Ginder's post <a href=\"https:\/\/anchor.host\/acf-custom-fields-stored-in-custom-table\/\">https:\/\/anchor.host\/acf-custom-fields-stored-in-custom-table\/<\/a>.<\/p>\n\n<p>You can contribute to this plugin by submit PR\/Issue in <a href=\"https:\/\/github.com\/eduardo-marcolino\/acf-fields-in-custom-table\">https:\/\/github.com\/eduardo-marcolino\/acf-fields-in-custom-table<\/a>.<\/p>\n\n<h4>Supported Fields<\/h4>\n\n<ul>\n<li>Text<\/li>\n<li>Text Area<\/li>\n<li>Number<\/li>\n<li>Range<\/li>\n<li>Email<\/li>\n<li>URL<\/li>\n<li>Password<\/li>\n<li>Image<\/li>\n<li>File<\/li>\n<li>Wysiwyg Editor<\/li>\n<li>oEmbed<\/li>\n<li>Select<\/li>\n<li>Checkbox<\/li>\n<li>Radio Button<\/li>\n<li>Button Group<\/li>\n<li>True \/ False<\/li>\n<li>Date Picker<\/li>\n<li>Date Time Picker<\/li>\n<li>Time Picker<\/li>\n<li>Color Picker<\/li>\n<li>Link<\/li>\n<li>Post Object<\/li>\n<li>Page Link<\/li>\n<li>Relationship<\/li>\n<li>Taxonomy<\/li>\n<li>User<\/li>\n<\/ul>\n\n<h4>Relational Fields<\/h4>\n\n<p>This plugin supports the following relational field types: Post Object, Page Link, Relationship, Taxonomy and User.<\/p>\n\n<p>It can store both single and multiple values based on the <code>multiple<\/code> option.<\/p>\n\n<ul>\n<li>If it's a single value field, then the column type will be <code>bigint(20) unsigned<\/code><\/li>\n<li>If it's a multiple value field, then the column type will be longtext and the date will be stored in json format.<\/li>\n<\/ul>\n\n<p>You can query relational fields with multiple values using using MySQL's function <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/json-search-functions.html#function_json-contains\">JSON_CONTAINS<\/a>.\nHere is an example:<\/p>\n\n<p>Table:<\/p>\n\n<pre><code>+---------+-------------------+--------+\n| post_id |       title       | stores |\n+---------+-------------------+--------+\n|       1 | Lord of the Flies | [1,2]  |\n|       2 | The Island        | [2]    |\n|       3 | 1984              | [3]    |\n+---------+-------------------+--------+\n<\/code><\/pre>\n\n<p>Query:<\/p>\n\n<pre><code>SELECT * FROM wp_acf_books WHERE JSON_CONTAINS(stores, 2, '$')\n<\/code><\/pre>\n\n<p>The query above will return \"Lord of the Flies\" and \"The Island\".<\/p>\n\n<h4>ACF Compatibility<\/h4>\n\n<p>This plugin was tested with <em>ACF 5 FREE Version<\/em> .<\/p>\n\n<!--section=installation-->\n<p>Setting up ACF: Fields in Custom Table is very simple. Follow these easy steps<\/p>\n\n<ol>\n<li>Upload the plugin to your <code>\/wp-content\/plugins\/<\/code> directory;<\/li>\n<li>Activate the plugin in your WordPress admin;<\/li>\n<li>Go to the Custom Fields &gt; Field Groups menu, edit or create a field group and enable ACF: Fields in Custom Table option;<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='this%20plugin%20supports%20custom%20post%20types%3F'><h3>This plugin supports custom post types?<\/h3><\/dt>\n<dd><p>Yes. It supports custom post types and built in types of post and page<\/p><\/dd>\n<dt id='what%20happens%20if%20i%20use%20unsupported%20field%3F'><h3>What happens if I use unsupported field?<\/h3><\/dt>\n<dd><p>The value will be stored in the core meta tables instead of the custom table<\/p>\n\n<p>Yes. It supports custom post types and built in types of post and page<\/p><\/dd>\n<dt id='what%20are%20the%20plugin%20filters%20and%20actions%20%3F'><h3>What are the plugin filters and actions ?<\/h3><\/dt>\n<dd><p>The plugin provides filters to allow developers to customize the plugin behavior.\nPlease <a href=\"https:\/\/github.com\/eduardo-marcolino\/acf-fields-in-custom-table#filters\">access the documentation<\/a> to get the list of it.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.5<\/h4>\n\n<ul>\n<li>Added filter acfict_table_prefix to customize table prefix<\/li>\n<li>Added setting for allow user to disable table prefix usage<\/li>\n<li>Testing on Wordpress 5.7<\/li>\n<\/ul>\n\n<h4>0.4<\/h4>\n\n<ul>\n<li>Small performance improvement and testing on Wordpress 5.6<\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>Added support for the following field types: Link, Post Object, Page Link, Relationship, Taxonomy and User<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Added support for the following field types: Range, Image, File, oEmbed, Checkbox, Radio Button, Date Time Picker, Time Picker<\/li>\n<li>Using dbDelta function to modify table<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>First version of the plugin released<\/li>\n<\/ul>","raw_excerpt":"Stores ACF custom fields in a custom table instead of WordPress core meta tables.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/132148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=132148"}],"author":[{"embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/eduardomarcolino"}],"wp:attachment":[{"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=132148"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=132148"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=132148"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=132148"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=132148"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/so.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=132148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}