Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterFor better organization, I put each module in separate files which are located in different folder.
This is great and is a recommended way to organizing fields. I also wrote about this.
Problem is value in fields cannot be retrieved, all none whilst html output is OK.
Can you provide more details on how you retrieve values? Code is appreciated.
Anh Tran
KeymasterHi,
The datetime fields doesn't do validation for the format. It's kind of a bug in jQueryUI datepicker. I'd suggest setting the field
readonlyto prevent users entering values in wrong format.October 18, 2018 at 3:03 PM in reply to: ✅MB Revisions in combination with MB Custom Table and Custom Post Type #11654Anh Tran
KeymasterHi Purdue,
I've just pushed an update for both MB Revision and MB Custom Table. Now they work well together and you can use them to track revisions for CPT in custom tables. Please update and let me know if you find any problem.
Anh Tran
KeymasterHave you resolved this? Do you need any further help?
Anh Tran
KeymasterHi,
When I unserialize the value, I see questions and answers are saved correctly:
https://www.unserialize.com/s/54991f6e-ab47-be68-7bdc-00006081513b
FYI, the group extension saves all sub-field values in a serialized array in the database (which is what you just saw). When you get the value, it will be unserialized and returns an array.
Anh Tran
KeymasterHi Cornwall,
The MB Custom Post Type plugin creates only custom post types. No meta boxes or custom fields are created with it. To create meta boxes or custom fields, you'll need MB Builder.
Anh Tran
KeymasterI see, it's much clearer now.
To get the field values from your table CPT, please pass the post ID (value of the field
pricing_table_id) to the 3rd parameter ofrwmb_metafunction. Here is a modified version of your initial code:$table = isset( $pricing['pricing_table_id'] ) ? $pricing['pricing_table_id'] : ''; if ( $table ) { $plans = rwmb_meta( 'plan', '', $table ); // THIS if ( ! empty( $plans ) ) { foreach ($plans as $plan) { $name = isset( $plan['plan_name'] ) ? $plan['plan_name'] : ''; echo $name; } } }Anh Tran
KeymasterHi Huy,
To the the current post object, please use:
$post = get_post();To get fields, just use
rwmb_meta(). But I think you already know that.I'm not sure what your problem is. Can you provide more details and the setup code of meta box, so I can give more useful instruction?
Anh Tran
KeymasterHi Dan,
Unfortunately, creating setting page requires coding. It's just 10 lines of code and you can go to Appearance > Editors to add them into your theme's
functions.phpfile.Then you can use the MB Builder to create fields for settings page using GUI and finally use BB Themer to get the settings and show them on the front end.
Anh Tran
KeymasterHi,
To create a settings page, there are 2 steps:
- Creating a settings page first, using the filter
mb_settings_pages, and - Creating fields for the settings page, using the normal
mb_meta_boxes.
Both steps are described in this documentation. Please take a look and let me know if you see any difficulty.
Anh Tran
KeymasterHi,
I think if you mark a field required, the browser will force you to enter a value. It works per field, which means it doesn't depend on values of other fields. So no matter that field is in a group or not, if it's required, it should have a value.
I'd suggest using custom JavaScript code to check the emptiness of a group (clone) before submitting the post, and not using the required featured. This way, you control when and how the field is "required".
October 13, 2018 at 11:28 AM in reply to: ✅OpenStreetMap is not working properly with Tabs Extension #11617Anh Tran
KeymasterHi Saqib,
Thanks for your feedback. I've just fixed in MB Tabs extension and in Meta Box plugin. Please update MB Tabs and get the dev version of Meta Box on Github. I'll release new version for Meta Box soon.
Thanks
Anh Tran
KeymasterThanks for the info. I'm checking your site and found a problem: the ID of the field contains a space:
https://imgur.elightup.com/sFnaTYm.png
That comes from the
$prefix = strtolower($this->attributes['post']['single']);, which transformCase Studyto justcase study. It should becase_study. Please try this code:$prefix = str_replace(' ', '_', strtolower($this->attributes['post']['single']));The space in field ID (and then in the input name/ID) causes unexpected behavior, and that might be a cause to this problem.
Anh Tran
KeymasterHi Huy,
Do you mean getting the post object or getting the items in the pricing table?
Can you also share the code of the meta box?
October 12, 2018 at 11:12 AM in reply to: ✅MB Revisions in combination with MB Custom Table and Custom Post Type #11603Anh Tran
KeymasterHi Purdue,
There's a bug that MB Revision doesn't work with custom table yet. We're working on that. Please wait for a few days.
- Creating a settings page first, using the filter
-
AuthorPosts