feat(wpmc S2): FieldGroup::register() attaches acf/init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WPMultiCity;
|
||||
|
||||
final class FieldGroup
|
||||
{
|
||||
public const GROUP_KEY = 'group_wpmc_shortcode_rows';
|
||||
public const REPEATER_KEY = 'field_wpmc_list_shortcode';
|
||||
|
||||
public static function register(): void
|
||||
{
|
||||
add_action('acf/init', [self::class, 'do_register']);
|
||||
}
|
||||
|
||||
public static function do_register(): void
|
||||
{
|
||||
// Implementation filled in Tasks 13 and 14.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WPMultiCity\Tests;
|
||||
|
||||
use WPMultiCity\FieldGroup;
|
||||
|
||||
final class FieldGroupTest extends TestCase
|
||||
{
|
||||
public function test_register_attaches_acf_init_action(): void
|
||||
{
|
||||
FieldGroup::register();
|
||||
|
||||
self::assertNotFalse(
|
||||
has_action('acf/init', [FieldGroup::class, 'do_register']),
|
||||
'FieldGroup::register() must hook acf/init'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user