(Originally published on Medium.com on May 14th, 2020)

beyond the advanced custom fields ACF plugin in WordPress by amans199

Throughout my experience with WordPress, I have seen ALOT of plugins. some of it is awesome, and many others are not worthy to be used.

Advanced Custom Fields (the Free version):

beyond the advanced custom fields ACF plugin in WordPress by amans199

you probably have heard of it or you may already have been using it, but I will shed the light here on some awesome applications which can be done with the free version of this plugin :

most developers are using this plugin to customize the structure of posts by creating some more different fields to match absolutely any purpose. BUT there is a lot more you can do

  1. you can use this plugin to create any type of front-end forms in your site, with any number of custom post types, with any kind of fields.
beyond the advanced custom fields ACF plugin in WordPress by amans199

you can do this by:

a- creating a new custom post type with no editor.

register_post_type('WPIsAwesome',$args);

b- add all the custom fields you want to show in this exact custom post type

c- make the frontend form and then use wp_insert_post() function to get all the fields you want . when the form submitted it will create a new custom post with the fields you have created.

wp_insert_post($WPIsAwesomeFields);

d- you may also use acf_form() function to get a custom post form which can be submitted from the frontend

acf_form (array(
'field_groups' => array(98)
'form' => true,
'return' => '%post_url%',
'submit_value' => 'Save Changes',
'post_title' => true,
// 'post_content' => true,
));

if you want me to write a tutorial about how to create a front-end form with code in WordPress( the easy way ), please let me know in the comments below

2- The awesomeness starts here: ACF gives you the ability to export all your fields in a folder located inside your theme called ACF-JSON by default and you can add as many loading points as you want, then it gives any website installs your theme the ability to sync those fields.

3- The awesomeness Continues: You can also force the installation of the plugin once the theme installed using the TGM, you can find the full code here.

function register_required_plugins(){
$plugins = array(
array(
'name' => 'Advanced Custom Fields',
'slug' => 'advanced-custom-fields',
'source' => get_stylesheet_directory() . '/theme/plugins/advanced-custom-fields.zip',
'required' => true,
'version' => '',
'force_activation' => true,
'force_deactivation' => false,
'external_url' => ''
)
);

or you may also make it installed from the wordpress.org automatically by just specifying the slug.

            array( 
'name' => 'Advanced Custom Fields',
'slug' => 'advanced-custom-fields',
'required' => true,
)

with the proper config for TGM, you are gonna be able to create a stunning functionality for your website’s ACF fields.

if you want me to talk in-depth about TGM, please let me know

4- The awesomeness Continues: with a little bit of code, you can also force any website installs your theme to sync those fields once the plugin installed, using the advanced-custom-fields-auto-JSON-sync plugin.

So basically, you can deal with ACF just like a part of your theme. whenever the theme installed, ACF will be automatically installed with all the data you have created for it in the ACF-JSON folder.

5- I do like ACF taxonomies… it basically allows you to create a new category-alike which links your specified posts together, to create a new stunning material of units for instance.

6- ACF has a JavaScript library including functions, actions and filters, and models. you may find it here.

7- if you are very sensitive about SEO -just like me-, ACF has an extension called ACF-Content Analysis for Yoast SEO, this plugin analyzes all ACF content including Flexible Content and Repeaters.

beyond the advanced custom fields ACF plugin in WordPress by amans199

8- even when it is so easy to write the code needed to implement ACF in your theme but ACF also has a plugin that definitely will help you with that.

9- ACF is integrated with Admin Columns, which allows you to display ACF custom fields for posts (post meta) and users (user meta) as columns on your list overview. With many different custom field types supported, such as files, images, numbers, and dates you can create a beautiful overview of your custom content!

beyond the advanced custom fields ACF plugin in WordPress by amans199
\

10- when it comes to filters!… ACF also has an Advanced Filtering for WordPress which allows you to filter the posts with the custom Fields you have created, you may find it here.

11- along with all of these awesome plugins, ACF also has many more.. you may find it all here, just like Table Field, Font Awesome Field, Accordion Tab Field, Date and Time Picker Field, Repeater & Flexible Content Fields Collapser, advanced Forms, ACF to REST API

beyond the advanced custom fields ACF plugin in WordPress by amans199

12- still want more! … me too 😀 … here is a collection of addons to extend your ACF awesomeness to a whole new level.

there are a lot more you can do with Advanced custom field in your theme, it simply will make your Development life a lot easier and your themes a lot more powerful… I can keep talking more and more but I just want to make sure of what you really need… so if you are reading this, please let me know in the comments below what you need exactly and I am gonna reply to all and every question you ask.

Write A Comment