‘group_claude_fields_001’,
‘title’ => “Claude’s Fields”,
‘fields’ => array(
array(
‘key’ => ‘field_claude_tab_001’,
‘label’ => “Claude’s Fields”,
‘name’ => ”,
‘type’ => ‘tab’,
‘placement’=> ‘top’,
‘endpoint’ => 0,
),
array(
‘key’ => ‘field_claude_repeater_001’,
‘label’ => ‘Claude Repeater Test’,
‘name’ => ‘claude_repeater_test’,
‘type’ => ‘repeater’,
‘layout’ => ‘block’,
‘button_label’ => ‘Add Row’,
‘sub_fields’ => array(
array(
‘key’ => ‘field_claude_icon_001’,
‘label’ => ‘Icon’,
‘name’ => ‘icon’,
‘type’ => ‘text’,
),
array(
‘key’ => ‘field_claude_label_001’,
‘label’ => ‘Label’,
‘name’ => ‘label’,
‘type’ => ‘text’,
),
array(
‘key’ => ‘field_claude_content_001’,
‘label’ => ‘Content’,
‘name’ => ‘content’,
‘type’ => ‘textarea’,
‘new_lines’=> ‘wpautop’,
),
array(
‘key’ => ‘field_claude_status_001’,
‘label’ => ‘Status’,
‘name’ => ‘status’,
‘type’ => ‘radio’,
‘choices’ => array(
‘hide’ => ‘Hide’,
‘active’ => ‘Active’,
),
‘default_value’ => ‘hide’,
‘layout’ => ‘vertical’,
),
),
),
),
‘location’ => array(
array(
array(
‘param’ => ‘page_template’,
‘operator’ => ‘==’,
‘value’ => ‘page-home.php’,
),
),
),
‘menu_order’ => 0,
‘position’ => ‘normal’,
‘style’ => ‘default’,
‘label_placement’ => ‘top’,
‘instruction_placement’ => ‘label’,
‘hide_on_screen’ => ”,
));
}
}
// 2. Output the claude-test-sec section after Section 1 on the home page
add_action(‘claude_after_section1’, ‘claude_render_repeater_section’);
function claude_render_repeater_section() {
global $post;
if ( ! $post || $post->ID != 499 ) return;
$rows = get_field(‘claude_repeater_test’, $post->ID);
if ( ! $rows ) return;
echo ‘
echo ‘
foreach ( $rows as $row ) {
if ( isset($row[‘status’]) && $row[‘status’] === ‘hide’ ) continue;
echo ‘
echo ‘
if ( ! empty($row[‘icon’]) ) echo ‘
‘;
if ( ! empty($row[‘label’]) ) echo ‘
‘ . esc_html($row[‘label’]) . ‘
‘;
if ( ! empty($row[‘content’]) ) echo ‘
‘ . esc_html($row[‘content’]) . ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
}
// 3. Inject the CSS for .usp-claude-test and its span
add_action(‘wp_head’, ‘claude_test_styles’);
function claude_test_styles() {
echo ‘
‘;
}