Support

Account

Home Forums Gutenberg no_fields_assigned_message

Solved

no_fields_assigned_message

  • In the changlog…

    “Developers who wish to modify the default advisory text can do so with the new acf/blocks/no_fields_assigned_message filter which offers 2 parameters: the message to be displayed and the name of the block it will be displayed on.”

    The documentation hasn’t kept up, does anyone have a code snippet for this filter please?

  • For anyone who passes this way;

    add_filter ('acf/blocks/no_fields_assigned_message', 'no_fields_message', 10, 2);
    
    function no_fields_message($message, $block_name) {
    
           if ($block_name === "acf/my-block") {
               $message = "Nothing to see here, please move along";
           }
    
        return $message;
    
    }
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.