Fatal error: Call to a member function add_tab () on null in W: \ domains \ zone-work.loc \ wp-content \ themes \ zone-theme \ inc \ carbon-custom-field-sets \ metabox.php on line eight

I will explain. The site is located on the open server locale. It seems that the rules worked, but at one point I went into the WP admin area and got this error.

here is the code from the metabox.php file

<?php use Carbon_Fields\Container; use Carbon_Fields\Field; add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' ); function crb_attach_theme_options() { Container::make( 'theme_options', __( 'Theme Options' ) ) ->add_tab( 'Шапка',array( Field::make( 'image','zl_logo','Логотип')->set_width(33), Field::make( 'text', 'zl_phone', 'Телефон')->set_width(33), )); } 

here I connect the file in functions.php (maybe I connect incorrectly?)

 /** * including after_theme_setup_theme **/ require get_template_directory() . '/inc/add-theme-support-sets.php'; add_action( 'after_setup_theme', 'crb_load' ); function crb_load() { require_once __DIR__ . '/inc/carbon-fields/vendor/autoload.php'; \Carbon_Fields\Carbon_Fields::boot(); } /** * Implements CCF methods for metaboxes and post-metaboxes **/ require __DIR__ . '/inc/carbon-custom-field-sets/metabox.php'; 

All of these classes and methods are from the Carbon Custom Fields plugin. What could be the problem ? Or maybe the problem is in autoload.php here

  require_once __DIR__ . '/inc/carbon-fields/vendor/autoload.php'; ? 

? SOS

  • Fatal error: Call to a member function add_tab () on null Problem in method -> add_tab. Apparently, Container :: make ('theme_options', __ ('Theme Options')) does not, because there is null - Alexey Kapustsin

0