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

Register/enable/disable bard sets via PHP #1244

Open
godismyjudge95 opened this issue Oct 23, 2024 · 0 comments
Open

Register/enable/disable bard sets via PHP #1244

godismyjudge95 opened this issue Oct 23, 2024 · 0 comments

Comments

@godismyjudge95
Copy link

godismyjudge95 commented Oct 23, 2024

I looked through the docs but did not find anything.
It would be great if you could register/enable/disable bard sets via PHP.

Something like:

Bard::registerSet(name: 'testimonials-v2', group: 'blocks', set: [
	'display' => 'Testimonials',
	'icon' => 'text-formatting-quotation',
	'fields' => ['import' => 'block_testimonials'],
]);

And if you needed to register it based on a specific condition:

Bard::boot(function ($field, $context) {
	if ($context['collection'] === 'posts') {
		return;
	}

	register_custom_sets();
});

Finally to disable a set:

Bard::deregisterSet('testimonials-v1');
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

1 participant