martnick
Forum Replies Created
-
Forum: Plugins
In reply to: [Carbon Fields] Complex field with relations, adding extra rows to dbHey guys, sorry for the late response. Everything is great now. Thank you once again!
Forum: Plugins
In reply to: [Carbon Fields] Complex field with relations, adding extra rows to dbThanks for the fast response, I will play around with this, and will contact you as soon as possible on my progress. Cheers.
Forum: Plugins
In reply to: [Carbon Fields] After save theme hook not working@htmlburger No, I was dumb. With exit it works perfectly. Thanks!
Forum: Plugins
In reply to: [Carbon Fields] User Container on custom pagesHello @htmlburger,
First off, thanks you all for the great plugin, it does me wonders, you answer sums it up pretty much, you can resolve the topic.
I have worked on this before you answered, I went with a spin on the first approach. I am using the Carbon Fields plugin, to make it so, the administrator can add roles and “fields” to the roles. For those who are interested, I made a couple of theme_options container. One to add remove roles, and one to add “fields” to the roles.
The first:
Container::make('theme_options','Plugin Options') ->add_fields(array( Field::make('complex', 'roles') ->add_fields(array( Field::make('text','display_name','Display name'), Field::make('text','role_name','Role name'), Field::make('complex','capabilities','Caps') ->add_fields(array( Field::make('text','capabilities_text','Cap. name'))) )) ));The second:
$roles = carbon_get_theme_option('roles','complex'); $dynamic_roles_container = Container::make('theme_options','Plugin Roles Options') ->set_page_parent('Plugin Options'); for($i = 0; $i < count($roles); $i++) { $dynamic_roles_container->add_fields(array( Field::make('separator',$roles[$i]['role_name'] . 'role_separator',$roles[$i]['display_name']))); }Then you just call the fields by user role and ID.
Forum: Plugins
In reply to: [Carbon Fields] After save theme hook not workingHello @htmlburger,
How can I be sure that the hook is firing? It doesn’t print anything. If I am adding the containers after adding the hook, could that be the problem?