Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi, currently the position of the new clone is hardcoded in
meta-box/js/clone.jsfile as you can see here:The group extension doesn't change this behavior.
For now, the only way to change that is changing the code directly.
I'm thinking about adding a new option to Meta Box to reposition the "Add New" button and the position of the new clone.
Anh Tran
KeymasterOh, sorry. I didn’t notice this is for MB Builder.
To add subfields to a group in the Builder, just drag fields to be a child item of the group item (think like you drag and drop the sub menu in the Appearance > Menus).
Anh Tran
KeymasterJust think "group" is a special field. The only difference is it has
fieldsparameters, which is an array of fields. This is a sample code:$meta_box = array( ’title’ => ’Test’, 'fields' => array( // Group array( 'id' => 'group_id', ’type’= > 'group', // Subfields 'fields' => array( array( 'id' => ’text', ’type’ => ’text’, ’name’ => ’Text’, ), // Other subfields go here ), ), ), );Anh Tran
KeymasterHi Yumikom,
Maybe the theme or the plugin you're using has a call to the function "rwmb_meta()" when the Meta Box plugin is not loaded (or activated). It's better to change the code to:
if ( function_exists( 'rwmb_meta' ) ) echo rwmb_meta( 'field_id' );If your field is a simple field (like text or textarea), you should use
get_post_meta(), like this:echo get_post_meta( get_the_ID(), 'field_id', true );rwmb_meta()is just a wrapper ofget_post_meta. Usingget_post_metamight give you a better performance.Anh Tran
KeymasterTo support Yoast SEO plugin, please install this extension. It works well with the Tabs extension.
Anh Tran
KeymasterThe WYSIWYG field doesn't output the "p" tag by default. It can be done using the "wpautop" function like this:
echo wpautop( rwmb_meta( 'field_id' ) );Anh Tran
KeymasterHi, I see you missed the param
clonefor the group field, so it can't be cloned.Here is the fixed code (I fixed the syntax also):
title: Prazos fields: - name: Group id: grop_name type: group fields: - name: Group id: group_1 type: group clone: true fields: - name: test id: test type: text - name: test1 id: test1 type: text - name: test2 id: test2 type: textAnh Tran
KeymasterHi, I've just added an upgrade message and buttons in the profile page. Please go to "My Account" (link on the top right or click on your avatar) and upgrade.
Please let me know if you need anything else.
Anh Tran
KeymasterHi, can you show me the code to create meta boxes?
Anh Tran
KeymasterIf so, you can set the
timestampparameter for the fieldtrue. This will make the field save the timestamp instead of date string, so you can sort by that, while still display in the correct format to users.You can see the docs here.
Anh Tran
KeymasterYou query is correct. However, the problem here is the value you saved for date has the format "dd/mm/yyyy" which will cause the incorrect order when sorting. I suggest you use "yyyy-mm-dd" format, which is safe when ordering.
Anh Tran
KeymasterHello, please take a look at this sample code:
https://gist.github.com/rilwis/a05896c8c3782d20369743fde68edcf8
December 23, 2016 at 6:10 PM in reply to: First WYSIWYG in group not switching between Visual and Text tabs. #4711Anh Tran
KeymasterCurrently not, but I think and "id" should be:
- unique per fields
- use only lower characters with dash or underscores to separate words (think it like slugs or keys of an array)That's all. Very simple 🙂
Anh Tran
KeymasterThat's correct. The field doesn't apply any filters to make shortcode runs. The filter
the_contentdoes that. But you might want to use justdo_shortcode()function asthe_contentoften triggers some other unexpected functions (like social plugin might hook into it to insert social buttons).$text = rwmb_meta( 'wsmbox_page_two_columns_text' ); echo do_shortcode( wpautop( $text ) ); -
AuthorPosts