AdvancedCustomFields / AdvancedCustomFields/acf

Not seeing Gutenberg "blocks" listed in location rules

Open
#294 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

I copied the example from https://www.advancedcustomfields.com/resources/acf_register_block_type/ verbatim (code and template file) but I don't see the widget when I create a page.

add_action('acf/init', 'my_acf_blocks_init');
function my_acf_blocks_init() {

    // Check function exists.
    if( function_exists('acf_register_block_type') ) {

        // Register a testimonial block.
        acf_register_block_type(array(
            'name'              => 'testimonial',
            'title'             => __('Testimonial'),
            'description'       => __('A custom testimonial block.'),
            'render_template'   => 'template-parts/blocks/testimonial/testimonial.php',
            'category'          => 'formatting',
        ));
    }
} 
Edit_Page_‹_CDM_Website_—_WordPress

Nor do I see "Blocks" listed when I try to create a custom field.

Screen Shot 2020-05-06 at 3 00 27 PM

I'm on Wordpress 5.4.1 and ACF 5.8.9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported registration snippet and compare its behavior on WordPress 5.4.1 with ACF 5.8.9. Check why the Gutenberg block and the Blocks location rule are absent; the issue is resolved when the testimonial block appears in the editor and Blocks is available when creating a custom field.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
content, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.