htmlBurger
Forum Replies Created
-
Forum: Plugins
In reply to: [Carbon Fields] problem with my radio fieldsInstead of using
array_push()
you can use the following PHP syntax:
$user_options[$wyde_sy] = $wyde_sy; // assuming $wyde_sy is a string
This way you will end up with an array like this:
array( "value1"=>"value1", "value2"=>"value2", "value3"=>"value3", ... )
Now the values stored will not be numerical indexes but the custom values you pull from _crb_society (as keys and values are equal).
- This reply was modified 7 years, 11 months ago by htmlBurger.
- This reply was modified 7 years, 11 months ago by htmlBurger.
- This reply was modified 7 years, 11 months ago by htmlBurger.
Forum: Plugins
In reply to: [Carbon Fields] Problem with rich_text FieldParagraphs and line breaks are saved in the exact same way as the normal WordPress editor does. The difference being that when outputting, WordPress passes the content through a number of filters which prepare the content for display (
the_content
).The simplest way to have line breaks and paragraphs added when you display content from a rich text field is to use
wpautop()
together withdo_shortcode()
like this:<?php echo wpautop( do_shortcode( carbon_get_the_post_meta( 'your_richtext_field_name_here' ) ) ); ?>
do_shortcode()
parses all shortcodes whilewpautop()
handles linebreaks and paragraphs.You can also do
apply_filters( 'the_content', carbon_get_the_post_meta( 'your_richtext_field_name_here' ) )
to apply the full list of filters over the content, however this is not recommended as it may have undesired effects and plugins may interfere with normal usage.- This reply was modified 7 years, 11 months ago by htmlBurger.
Forum: Plugins
In reply to: [Carbon Fields] Carbon Field Template (working example?)Hi @hendridm,
No need for a custom namespace, just use the Carbon_Fields one.
Here is an example of a really simple plugin using the template: test-field.zip
Hope that helps, cheers!
- This reply was modified 7 years, 11 months ago by htmlBurger.
Forum: Plugins
In reply to: [Carbon Fields] Interested in Contributing? #forkHi @hendridm,
Development on the plugin is definitely not dead — we’re currently working on a major js rewrite (see react-ui branch).
In the past few weeks the things are a little bit slower due to winter holidays. That is the reason for the seemingly dead communication.
As maintainers of the project, we would prefer to avoid forks of Carbon Fields.
Forum: Plugins
In reply to: [Carbon Fields] Urgent help, all back office disappeared with the last updateHi @alexadark, sorry for the trouble.
It’s possible that the problem is related to the initialization. We needed to change the initialization hook to
init
with priority 0. If you use the same hook in your code for initializing CF, please change it toafter_setup_theme
.Here are some related issues on GitHub that might help: #162, #165
Forum: Plugins
In reply to: [Carbon Fields] vertical tabs@alexadark, can you please provide your CF container code? Not sure why this is not working for you. Here is a working example:
Container::make( 'post_meta', __( 'Post Settings', 'crb' ) ) ->add_fields( array( Field::make( 'complex', 'example' ) ->set_layout('tabbed-horizontal') ->add_fields(array( Field::make( 'text', 'example' ) )) ));
Forum: Plugins
In reply to: [Carbon Fields] Using framework in plugin in my pluginHey@meshsmith,
Unfortunately I can’t reproduce this issue. What I did:
1. installed your plugin
2. added the CF plugin headers to carbon-fields-plugin.php
3. activated the pluginThe plugin activation was successful.
Can you please give a step by step guide how it can be reproduced? Thanks.
Forum: Plugins
In reply to: [Carbon Fields] front-end formHey, thanks for the great suggestion.
Unfortunately we don’t plan to include this feature in CF. We may consider making another plugin just for front-end form handling that works with CF, but it’s not on the roadmap at the moment.
Forum: Plugins
In reply to: [Carbon Fields] Field validationYou can do that with Carbon Fields:
Field::make('text', '_crb_phone_number')->set_required(true)
You can also that with CMB2 via “required” attribute:
https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#attributesarray( 'name' => 'Extra Small Textarea', 'id' => $prefix .'xtra_small_textarea', 'type' => 'textarea_small', 'attributes' => array( 'placeholder' => 'A small amount of text', 'rows' => 3, 'required' => 'required', ), ),
Note that Carbon Fields and CMB2 handle the validation in different manner: CF uses javascript and CMB2 uses HTML5
required
attribute.- This reply was modified 8 years ago by htmlBurger. Reason: typo fix
Forum: Plugins
In reply to: [Carbon Fields] Show_on_pages(all exept one)We opened a Github ticket for this feature, you can track the progress here: https://github.com/htmlburger/carbon-fields/issues/122
Forum: Plugins
In reply to: [Carbon Fields] Show_on_pages(all exept one)On the side note, you can try using the
hide_on_template('template-contact.php')
and make your contact page an actual template. Not sure if this makes sense in your theme, but its the only option at the moment…Forum: Plugins
In reply to: [Carbon Fields] Show_on_pages(all exept one)Hi @bankimoon, glad you like the plugin!
Hide on page is not supported at the moment, but its a really good feature suggestion. We will add it to the features list and implement it in a future version, maybe also add more
hide_on_*
methods. So thanks for the suggestion!Forum: Plugins
In reply to: [Carbon Fields] Add Class To DivHi @mvshandor,
You can use the
add_class
field method to add additional classes. Example:Field::make("text", "crb_sidenote", "Sidenote Content") ->add_class('crb_sidenote');
Checkout the documentation for more information: https://carbonfields.net/docs/fields-usage/
- This reply was modified 8 years ago by htmlBurger.
Forum: Plugins
In reply to: [Carbon Fields] Register my fields with the carbon_register_fields hookWe updated the code so
carbon_register_fields
will now work with widgets, just keep in mind that this change will be present in the next version of the plugin (1.5).- This reply was modified 8 years ago by htmlBurger.
Forum: Plugins
In reply to: [Carbon Fields] Register my fields with the carbon_register_fields hookHey @vauvarin
Sorry for the late answer, but this somehow fell off the radar.
Widgets are a bit special and need to be registered in an earlier hook. Try including the
widgets.php
file atafter_setup_theme
, for example:add_action( 'after_setup_theme', 'crb_setup_theme' ); function crb_setup_theme() { include_once( plugin_dir_path( __FILE__ ) . '/includes/widgets.php'); }
Also thanks for pointing this out, we will update the documentation to avoid confusion.
Cheers!