carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

carbon_get_the_network_option doesn't work

Open freetibet000 opened this issue 6 years ago • 1 comments

  • Carbon Fields: 3.1.11
  • WordPress: 5.4.2
  • PHP: 7.4

I try to use example from docs https://docs.carbonfields.net/#/containers/network?id=accessing-field-values

use Carbon_Fields\Container;
use Carbon_Fields\Field;

Container::make( 'network', 'crb_network_container', 'Network Settings' )
     ->add_fields( array(
        Field::make( 'text', 'crb_title' ) ,
     )
);

The regular wordpress function works fine and returns correct value echo get_network_option(1, '_crb_title' );

But when i try to use carbon function i get nothing I tried this variants and no one works

echo carbon_get_the_network_option(1, 'crb_title', 'crb_network_container'); 
echo carbon_get_the_network_option(0, 'crb_title', 'crb_network_container'); 
echo carbon_get_the_network_option(null, 'crb_title', 'crb_network_container'); 
echo carbon_get_the_network_option('crb_title', 'crb_network_container'); 

Any ideas please

freetibet000 avatar Jul 10 '20 13:07 freetibet000

Not really sure but it's seems docs page has been changed. Right way is echo carbon_get_network_option( 1, 'crb_title', 'carbon_fields_container_crb_network_container' );

freetibet000 avatar Nov 25 '20 13:11 freetibet000