-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this framework dead ? #1249
Comments
It looks like you are using Composer to install the plugin, but forgot to require the Composer autoload.php file. Look here: use Carbon_Fields\Container;
use Carbon_Fields\Field;
add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' );
function crb_attach_theme_options() {
error_log('carbon_fields_register_fields hook called');
Container::make( 'theme_options', __( 'Theme Options' ) )
->add_fields( array(
Field::make( 'text', 'crb_text', 'Text Field' ),
Field::make( 'text', 'crb_text2', 'Text Field 2' ),
) );
}
add_action( 'after_setup_theme', 'crb_load' );
function crb_load() {
require_once( 'vendor/autoload.php' ); // required to boot the plugin
\Carbon_Fields\Carbon_Fields::boot();
} |
Hi, |
Oh then the composer version will not work. The only option you have is to use non composer version. Download the latest zip file form https://carbonfields.net/zip/latest/ and extract it into public/plugins/ folder |
Version
Expected Behavior
The plugin/framework has to work
Actual Behavior
The plugin is detected and activated, Carbon classes are correctly loaded, and the options page I have created appears... but without any fields.
Container definition
Comments
Just tried the framework, but if a simple code like this one which comes from the documentation doesn't work, it's because the plugin itself seems to have problems. The only error I have spotted with this plugin active is this very generic one : "[17-Aug-2024 15:58:52 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /var/www/public/wordpress/wp-admin/includes/plugin.php on line 1853"
Is this a problem with the latest Wordpress version ? Is this plugin mainained or not ?
Regards.
The text was updated successfully, but these errors were encountered: