Skip to content
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

This just wont load. #41

Open
neotropic2023 opened this issue Jun 22, 2018 · 3 comments
Open

This just wont load. #41

neotropic2023 opened this issue Jun 22, 2018 · 3 comments

Comments

@neotropic2023
Copy link

I installed as a plugin. but then I get, Fatal error: Uncaught Error: Class 'Cmb2Grid\Grid\Cmb2Grid' not found on my metabox page. I do not have CMB2 as a plugin, but within my own plugin. If that matters.

Is there something I am missing? Not sure what else to say, seems pretty straight forward in usage. Install plugin add code: $cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb); ect...

@travisfont
Copy link

This might sound silly, but is it properly added to Composer with the included autoloader? Also including the proper namespaces?

This ticket was made ago, so if you found a solution, please share it here and attempt to close this ticket if possible :]

@Hossein52Hz
Copy link

Hi @neotropic2023 @tfont
I had the same problem and I add below code to the function that attached in the hook(cmb2_admin_init) and now it works fine.

add_action('cmb2_admin_init', 'cmb2_register_demo_metabox');

/**
 * Hook in and add a demo metabox. Can only happen on the 'cmb2_admin_init' or 'cmb2_init' hook.
 */
function cmb2_register_demo_metabox() {
.
.
.
if(!is_admin()){
    return;
}
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb_tabs_demo);
$row = $cmb2Grid->addRow();
$row->addColumns(array($field1, $field2));
}

@StonehengeCreations
Copy link

I cannot get this to work.
Installed installers with composer. Required autoload.php.
All tests with class_exists() for the namspace class \Cmb2Grid\Grid\Cmb2Grid fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants