orbit-compat-acflisted
Install: claude install-skill adityaarsharma/orbit
# 🪐 orbit-compat-acf — ACF integration
ACF is on 2M+ sites and is the de-facto custom-fields plugin. Plugins integrating with ACF (or that ship ACF Blocks) need careful handling.
---
## What this skill checks
### 1. get_field()/the_field() defensive use
**Whitepaper intent:** `get_field()` returns `false` if ACF isn't active. Plugins assuming a value crash. Always check `function_exists`:
```php
// ❌ Crashes if ACF deactivated
$price = get_field( 'price' );
// ✅
$price = function_exists( 'get_field' ) ? get_field( 'price' ) : null;
```
### 2. ACF Blocks (Gutenberg)
ACF can register Gutenberg blocks via PHP. Modern (5.8+) approach uses block.json + a render callback.
```php
register_block_type( __DIR__ . '/blocks/my-block/block.json', [
'render_callback' => 'my_plugin_render_block',
] );
```
**Whitepaper intent:** ACF Blocks bypass the JS edit/save split — render is server-side. Pair perfectly with the WP Block Bindings approach.
### 3. Field Group registration — PHP vs JSON sync
- **PHP-registered groups** ship with the plugin code (recommended for plugin distribution)
- **JSON sync** auto-saves admin UI changes to disk (useful in dev workflows)
```php
acf_add_local_field_group([
'key' => 'group_my_plugin_main',
'title' => 'My Plugin Settings',
'fields' => [
[ 'key' => 'field_x', 'label' => 'X', 'name' => 'x', 'type' => 'text' ],
],
'location' => [[
[ 'param' => 'post_type', 'operator' => '==', 'value' => 'post' ],
]],
]);
```
### 4. REST AP