Forum Replies Created
-
AuthorPosts
-
September 11, 2018 at 8:44 AM in reply to: ✅Set meta value of custom user field programmatically #11305
Anh Tran
KeymasterHi Mauro,
update_user_metais the way to go. Glad that you found it!September 11, 2018 at 8:39 AM in reply to: ✅Change Destination Of Custom File Upload Field Type #11304Anh Tran
KeymasterHi Lucjan,
Sorry for the delay. This feature was asked before in the forum and we haven't done it yet. We'll let you know when it's ready.
Thanks,
AnhSeptember 10, 2018 at 4:15 PM in reply to: ✅Possible to get isolated address items for frontend display? #11297Anh Tran
KeymasterHi,
You need to create a new text field, and bind it to the
citydata. Please follow the documentation to know how to do that.Anh Tran
KeymasterHi Ale,
To get the values in an array, you have to use
rwmb_metaorrwmb_get_value. Then parse the field options to output the labels:$field_id = 'mb_languages'; $field = rwmb_get_field_settings( $field_id ); $options = $field['options']; $values = rwmb_meta( $field_id ); foreach ( $values as $value ) { echo $options[$value]; // Label }September 8, 2018 at 8:36 AM in reply to: ✅After the Beaver add-on, any chance of an Elementor one? #11280Anh Tran
KeymasterHello guys,
Sorry for the delay. We've completed the integration plugin and it's available on Github. We're submitting it to wordpress.org.
The code is also sent and verified by Elementor's developer Ohad Raz, so I think it's ready to use.
Please try it and let me know if you need anything. Details, docs and video are coming soon.
September 6, 2018 at 9:29 AM in reply to: ✅Select taxonomy field is not working from version 4.15.4 #11269Anh Tran
KeymasterThanks a lot! I have refactored the code and forgot to keep that check. It's now has been fixed.
Anh Tran
KeymasterHi Ale,
This is a great question!
Firstly, I think you should translate the field labels only. Translating the values makes it's very hard to control what is saved in the database. And the data in the database should not be user's concern, it's for developers only.
Secondly, if you use
rwmb_meta, you'll get the field value stored in the database. It's static and can't be changed. That's why you don't see the translated text. I'd suggest usingrwmb_the_valueto get the option labels, which meaningful to users and translatable. See the field documentation for details.Finally, make sure you load the text domain for the code of meta boxes.
Anh Tran
KeymasterCan you send me an temporary admin account to check the bug? Please send via contact form.
September 6, 2018 at 8:26 AM in reply to: ✅Only show meta box on page with template named this-template.php #11265Anh Tran
KeymasterHi Philip,
Please add
showparameter to the meta box settings as follows:function testmeta( $meta_boxes ) { $prefix = 'swed-'; $meta_boxes[] = array( 'id' => 'vendoroptions', 'title' => esc_html__( 'Vendors', 'metabox-online-generator' ), 'post_types' => array( 'page' ), 'context' => 'after_title', 'priority' => 'high', 'autosave' => false, 'show' => array( 'template' => array( 'this-template.php' ), ), 'fields' => array(), ); return $meta_boxes; } );For more details, please see the documentation.
September 6, 2018 at 8:23 AM in reply to: ✅Select taxonomy field is not working from version 4.15.4 #11264Anh Tran
KeymasterHello,
What do you mean "if it has no taxonomy registered"? Does the field not have a registered taxonomy?
Anh Tran
KeymasterI don't see anything wrong with your code. Are the fields not showing up in the backend?
September 5, 2018 at 4:43 PM in reply to: ✅Is it possible to create a Metabox Group type metabox through API? #11254Anh Tran
KeymasterHello,
It's relatively simple. You just need to:
- Send a
POSTrequest to the endpoint to update a post . - In the array of parameter sent to the server, add a field
meta_boxto store all custom fields' values, including groups. - Put array of group's value into the
meta_boxfield. Remember to format the group value properly, e.g. an array of sub-field's value. In short, send the data in the format when you click the Publish button in the frontend.
Then the plugin will handle the rest and update the post with correct value.
Anh Tran
KeymasterHi Dan,
Just answered you on the Meta Box group on Facebook. I'm posting here for reference:
For custom taxonomy, please use the syntax described in the docs. It's more complicated than the category and tags (caused they're built in and we can define a specific syntax for them).
Anh Tran
KeymasterHello,
Unfortunately, it's not possible at the moment. Although the widgets look similar in term of form fields, its API is very different. And there's no solution for Meta Box yet.
Anh Tran
KeymasterHi,
The
stdis what you want. But it's applied (e.g. show) only when the meta box hasn't saved. So, if you have saved the meta box once, the field won't show thestdvalue. You can check that with new post, where the meta box hasn't been saved and you'll see thestdvalue is showing. - Send a
-
AuthorPosts