Support

Account

Home Forums Gutenberg no_fields_assigned_message Reply To: no_fields_assigned_message

  • Here are two additions in case you a) want to have a unified message for all ACF blocks without ACF fields or b) want the message to disappear completely.

    // ACF Blocks: Alter message for all ACF blocks that contain no ACF fields
    
    function no_fields_message($message) {
    
      $message = __('No fields for this block', 'projectname');
    
    	return $message;
    
    }
    
    add_filter ('acf/blocks/no_fields_assigned_message', 'no_fields_message', 10, 2);
    // ACF Blocks: Remove no-fields message for all ACB blocks without ACF fields
    
    add_filter( 'acf/blocks/no_fields_assigned_message', '__return_empty_string' );