ACF Theme Code for Advanced Custom Fields
The ACF Theme Code plugin automatically generates the code needed to implement Advanced Custom Fields in your themes. Video note: This free version of ACF Theme Code now supports ACF 6. Features Reduce your development time. When you publish, edit or update an ACF Field Group, the code required to implement your fields is displayed in the Theme Code section at the bottom of your Edit Field Group page. Use the clipboard icons in this section quickly copy and paste the code blocks into your theme templates. Quality, flexible, custom code. The code generated by Theme Code Pro is based on the official Advanced Custom Fields documentation and includes escaping for secure output. All code generated has been thoroughly tested and is created with speed and flexibility of implementation in mind. Comprehensive field support This version of ACF Theme Code generates code for all the field types included in the free version of Advanced Custom Fields (see the full list of field types and settings below). The code generated is specific to the field names and field settings you use for each of your fields. ACF Theme Code PRO ACF Theme Code PRO is the premium version of this plugin. It has the following additional features. Support for all the complex field types that are included in Advanced Custom Fields PRO. Repeater Flexible Content Gallery Clone The addition of a Theme Code Location Registration Tool to the ACF Tools page that generates code for registering locations. Blocks Options Pages Support for more complex ACF Field Group Locations. Block Options Page Widget Taxonomy Comment Attachment Current User User Form Support for a range of third party fields. Upgrade or learn more about ACF Theme Code PRO. ACF fields supported This free version of ACF Theme Code generates code for the following ACF field types and settings: Text Text Area Number Range Email URL Password Image (return types Array, URL and ID) File (return types Array, URL and ID) WYSIWYG Editor oEmbed Select (values Single and Multiple, return types Value, Label and Array) Checkbox (return types Value, Label and Array) Radio Button (return types Value, Label and Array) Button Group (return types Value, Label and Array) True / False Link (return types Array and URL) Post Object (values Single and Multiple, return types Post Object and Post ID) Page Link (values Single and Multiple) Relationship (return types Post Object and Post ID) Taxonomy (appearances Checkbox, Multi Select, Radio Buttons and Select, return types Term Object and Term ID) User (values Single and Multiple, return types User Array, User Object and User ID) Google Map Date Picker Date Time Picker Colour Picker Group Requirements Advanced Custom Fields or ACF PRO (version 5.8.9 or higher) Thank you Thanks to all of our beta testers. Including Elliot Condon, Phil Smart, Richard Johnston and James Bundey. Translations Would you like to use the ACF Theme Code plugin in your native language? Then why not contribute a translation via translate.wordpress.org. If you are new to translating plugins, there is a helpful First Steps guide available. View the current state translations for ACF Theme Code. Any and all assistance with translations is greatly appreciated. Please let us know if you need any help with submitting translations.
Top keywords
- code22×4.07%
- acf16×2.96%
- types15×2.77%
- theme13×2.40%
- theme code12×2.22%
- return11×2.03%
- return types11×2.03%
- field10×1.85%
- acf theme9×1.66%
- acf theme code9×1.66%
- fields9×1.66%
- array8×1.48%
Trigger Browsersync
Integrates WordPress with Browsersync to trigger events like reload when you edit pages. The plugin also only triggers a reload for now. If you have requests or ideas for other functionality, get in touch. Since you (should) disable this plugin on production sites, the WordPress stats won’t be reliable – if you find the plugin useful I’d really appreciate it if you’d let me know with a quick email or message! Triggers By default the plugin will trigger a reload on these actions: save_post – Editing posts/pages/custom posts etc added_option – Changing settings attachment_updated – Editing media fields (caption etc) updated_postmeta – Covers many things, particularly regenerating media thumbnails. Some meta_fields are ignored (see trigger_browsersync_irrelevant_meta_keys) activated_plugin deactivated_plugin delete_widget you can customise this as well as other Browsersync settings using filters: add_filter('trigger_browsersync_reload_actions', function($filters) { // Remove a default. Bear in mind that one action you take (e.g. saving a page) // may trigger more than one hook. unset($filters['save_post']); // Add your own. The key name lets other filters remove it (like the line above) $filters['wp_logout'] = 'wp_logout'; return $filters; }); Ignoring Meta Keys Not all meta_key updates (triggered by updated_postmeta) have any impact on the front-end functioning of your site. You can customise which meta_key values are ignored with the trigger_browsersync_irrelevant_meta_keys filter: add_filter('trigger_browsersync_irrelevant_meta_keys', function($filters) { // Remove a default. unset($filters['_edit_lock']); // Add your own. The key name lets other filters remove it (like the line above) $filters['_edit_lock'] = '_edit_lock'; return $filters; }); Configuration with Filters The default Browsersync settings will be used (http://localhost:3000) but you can use filters to change them. The filters are used every time the trigger is activated so you don’t need to set them before instanciating the class. add_filter('trigger_browsersync_protocol', function(){ return 'https'; } ); add_filter('trigger_browsersync_host', function(){ return 'dev.server'; } ); add_filter('trigger_browsersync_port', function(){ return '4321'; } ); Or you can specify the whole URL which will cause the others to be ignored, but don’t include a trailing slash. add_filter('trigger_browsersync_url', function(){ return 'http://localhost:3000'; } ); Environmental Configuration Since you probably only want Browsersync on your development or staging site, the plugin will do nothing once you activate it it in WordPress. To make it work, you’ll want to create a file to activate it. See Installation for instructions. Logging Activity Trigger Browsersync can log events to the WordPress log – this is especially useful for development on the plugin when you want to add or exclude a new event from triggering an action. To enable logging add this filter to your enable-trigger-browsersync.php file (see Installation); add_filter('trigger_browsersync_log_events', '__return_true');