flyntwp / acf-field-group-composer

Configuration builder for advanced custom fields field groups
MIT License
48 stars 11 forks source link

How can I utilize the cloned elements effectively? #29

Open foldesistudio opened 8 months ago

foldesistudio commented 8 months ago

Hey folks,

Unfortunately, the News Feed group does not detect the button fields. What can you recommend to me?

Here is my code:

BUTTON for clone:

ACFComposer::registerFieldGroup( [
    'name'                   => 'group_65c343f377bc4' . '_misi',
    'title'                 => 'Buttons',
    'fields'                => array(
        array(
            'label'             => 'Button',
            'name'              => 'button_is_visible',
            'type'              => 'true_false',
            'instructions'      => '',
            'required'          => 0,
            'wrapper'           => array(
                'width' => '',
                'class' => '',
                'id'    => '',
            ),
            'message'           => '',
            'default_value'     => 0,
            'ui'                => 0,
            'ui_on_text'        => '',
            'ui_off_text'       => '',
        ),
        array(
            'label'             => 'Button Link',
            'name'              => 'button_link',
            'type'              => 'acfe_advanced_link',
            'instructions'      => '',
            'required'          => 1,
            'conditional_logic' => array(
                array(
                    array(
                        'field'    => 'button_is_visible',
                        'operator' => '==',
                        'value'    => '1',
                    ),
                ),
            ),
            'wrapper'           => array(
                'width' => '',
                'class' => '',
                'id'    => '',
            ),
            'post_type'         => '',
            'taxonomy'          => '',
        ),
            ),
    'location'              => array(
        array(
            array(
                'param'    => 'post_type',
                'operator' => '==',
                'value'    => 'post',
            ),
        ),
    ),
    'menu_order'            => 0,
    'position'              => 'normal',
    'style'                 => 'default',
    'label_placement'       => 'left',
    'instruction_placement' => 'label',
    'hide_on_screen'        => '',
    'active'                => true,
    'description'           => '',
    'acfe_display_title'    => '',
    'acfe_autosync'         => '',
    'acfe_form'             => 0,
    'acfe_meta'             => '',
    'acfe_note'             => ''
] );

IMPORT BUTTON TO HERE

ACFComposer::registerFieldGroup( [
    'name' => 'news_feeds',
    'title' => 'News Feeds',
    'fields' => array(
        //  Button field imported as clone field
        array(
            'label' => 'Button',
            'name' => 'button',
            'type' => 'clone',
            'instructions' => '',
            'required' => 0,
            'wrapper' => array(
                'width' => '',
                'class' => '',
                'id' => '',
            ),
            'clone' => array(
                0 => 'group_65c343f377bc4' .'_misi',
            ),
            'display' => 'seamless',
            'layout' => 'block',
            'prefix_label' => 0,
            'prefix_name' => 0,
        ),
    ),
    'location' => array(
        array(
            array(
                'param' => 'block',
                'operator' => '==',
                'value' => 'acf/newscard',
            ),
        ),
    ),
    'menu_order' => 0,
    'position' => 'normal',
    'style' => 'default',
    'label_placement' => 'left',
    'instruction_placement' => 'label',
    'hide_on_screen' => '',
    'active' => true,
    'description' => '',
    'acfe_display_title' => '',
    'acfe_autosync' => '',
    'acfe_form' => 0,
    'acfe_meta' => '',
    'acfe_note' => '',
] );