• wgroenewold

    (@wgroenewold)


    Hi,

    If we add fields by the JSON file or PHP export (and not by the default GUI) the fields still show up in the WP backend, but not in your plugin list. They also don’t get indexed for search.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi,

    Can you send me your example import code to testing?

    Since we’re having the same issue, I’ll post an example of PHP-registered ACF fields that are not indexed.

    Of course is this an example. Other field types should be also indexed (textarea, wysiwyg, etc).

    Following PHP code is placed in a file and that file is included by functions.php.

    <?php
    
    acf_add_local_field_group([
        'key' => 'group_page_settings',
        'title' => 'Pagina instellingen',
        'fields' => [
            [
                'key' => 'field_custom_title',
                'label' => 'Aangepaste titel',
                'instructions' => 'Gebruik <strong><em>...</em></strong> voor ge&auml;ccentueerde tekst.',
                'name' => 'custom_title',
                'type' => 'text',
            ],[
                'key' => 'field_custom_subtitle',
                'label' => 'Subtitel',
                'name' => 'subtitle',
                'type' => 'text',
            ],
        ],
        'location' => [
            [[
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'page',
            ]],[[
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'post',
            ]],
        ],
        'menu_order' => 10,
        'position' => 'acf_after_title',
        'style' => 'default',
        'label_placement' => 'top',
        'instruction_placement' => 'label',
        'hide_on_screen' => '',
        'active' => 1,
        'description' => '',
    ]);
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fields added by PHP or JSON don’t get indexed’ is closed to new replies.