Questions tagged [carbon-fields]

Carbon Fields can be installed through composer (composer require htmlburger/carbon-fields).

The library supports PHP 5.3+ and uses PHP namespaces.

The main components of the library are:

  • Container – represents and controls a group of fields.
  • Field – represents a single field.
  • Data Storage – controls the underlying data storage for field values.
24 questions
3
votes
2 answers

Carbon-fields does't show maked fields

I create container for theme options and add fields array to it. Then open this options page, see the title and empty block where the fields should be add. How to display fields? Carbon Fields 2.1.0 use Carbon_Fields\Container; use…
Roman
  • 51
  • 1
  • 5
3
votes
1 answer

How to retrieve field values from "Carbon Fields 2.1.0" WP-plugin? At which phase are they accessible?

First I downloaded https://carbonfields.net/zip/latest/ and installed the plugin at WP backend. I also activated it as well. For this test case I use the "Twenty Sixteen" template with a fresh WordPress installation without any other plugins…
Axel
  • 3,331
  • 11
  • 35
  • 58
2
votes
2 answers

use Carbon Fields in custom plugin class

I have a plugin which has no functionality so far. This is the current structure:
Mykyta Dudariev
  • 462
  • 5
  • 17
1
vote
1 answer

How to remove crb_carbon_fields_container_ from theme options permalink in Carbon fields

When I register theme options via Carbon fields plugin, then I see crb_carbon_fields_container include in the permalink. I want to remove it. function setting_page(){ Container::make( 'theme_options', __( 'Theme Options' ) ) ->add_fields(…
Monzur Alam
  • 512
  • 4
  • 11
1
vote
1 answer

How to add fields to Blog Page/index.php by Carbon Fields

I am trying to add fields to Blog Page/index.php file by Carbon Fields but fields doesn't give output/echo in index.php carbon.php Container::make( 'post_meta', __( 'Blog Page Settings','carbon' ) ) ->where( 'post_template', '=', 'index.php'…
1
vote
1 answer

Groups in Carbon Fields Plugin

is there any possibility to make group in Carbon Fields, which will be saved as Serialized data in Database (whole group in one database row)? Something like Group field in Advanced Custom Fields plugin. Thanks.
1
vote
2 answers

Use Carbon Fields in an included plugin file

I am using the Carbon Fields plugin (not composer). I am building a large site and will have many functions to add fields to lots of different pages. I don't like to have extremely long files that make it harder to find the code for each page. If…
RiotAct
  • 743
  • 9
  • 33
1
vote
1 answer

PHP Class of composer package not found

I am writing a Wordpress plugin to create custom Gutenberg blocks. I am using a composer package called Carbon Fields. But when I try to use the package I am getting an Error: Fatal error: Uncaught Error: Class 'Carbon_Fields\Block' not found in…
1
vote
0 answers

Getting Carbon Fields value inside of namespace

How can you access the carbon_get_post_meta function from within a namespace? namespace SeoThemes\GenesisStarterTheme\Functions; if ( function_exists( 'carbon_get_post_meta' ) ): echo 'true'; else: echo 'false'; endif; This returns false…
Stuart
  • 45
  • 8
1
vote
0 answers

Container based on page name using Carbon Fields

I would like to generate carbon field containers on pages based on their page name rather than ID, in case the ID changes in the future. The problem is, I can't figure out how to do this and have turned to the 'post_term' where clause but am still…
Stuart
  • 55
  • 5
1
vote
1 answer

How to display 'Association' field using Carbon Fields 3

I have followed the documentation for Carbon Fields Association field but when I try to use the values, I get absolutely nothing. I have created the field in the back-end and everything seems to work nicely there, but on the front-end I'm using…
Stuart
  • 55
  • 5
1
vote
0 answers

Fatal error: Class 'Carbon_Fields\Widget' not found

I'm using https://carbonfields.net/ to create custom options for wordpress theme I tried to copy this code into functions.php: use Carbon_Fields\Widget; use Carbon_Fields\Container; class Banner_Widget extends Widget { function…
Ivan
  • 1,221
  • 2
  • 21
  • 43
1
vote
1 answer

wordpress carbon fields get category list and products in plugin fields

I am using carbon fields in my custom plugin to make some fields. There I need couple of different fields with field where user can select category from a list of woocommerce product category. So for that I made my code like this
NewUser
  • 12,713
  • 39
  • 142
  • 236
0
votes
0 answers

Carbon field gutenberg block with media_gallery

I need a gallery block for Gutenberg. but I have an error: Warning: Invalid argument supplied for foreach() This is my code: Block::make( __( 'Galleria homepage' )) ->add_fields( array( Field::make( 'media_gallery',…
Alessio Paoletti
  • 91
  • 1
  • 1
  • 8
0
votes
1 answer

Is it possible to update Carbon Fields using update_post_meta

I have a plugin that uses the Carbon Fields SDK and in another plugin I would like to update that field without requiring the Carbon Library. Is it possible, or are there any pitfalls, to simply doing something like: update_user_meta($id,…
Philip
  • 301
  • 1
  • 2
  • 10
1
2