Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterIt's not been added to the Builder yet. We'll update the Builder soon.
August 16, 2018 at 2:21 PM in reply to: ✅Submenu title does not work in addon MB Settings Page #11020Anh Tran
KeymasterHello,
The
submenu_titleworks only if the parent menu has at least one child. So if you create only one top-level settings page, it won't show the submenu. You need to create another sub-page, then thesubmenu_titlewill show in the menu.Anh Tran
KeymasterHi Bezzo,
Interesting question! Thanks for asking this.
Using
wpml-config.xmlis the standard way and is recommended by WPML. However, if you need to have different settings per language, you can use theICL_LANGUAGE_CODEconstant to detect current language and set the field IDs based on that.This is the sample code:
$prefix = ICL_LANGUAGE_CODE . '_'; $meta_boxes[] = [ 'title' => 'Fields', 'fields' => [ [ 'id' => $prefix . 'text', 'name' => 'Text', 'type' => 'text', ], // Other fields. ], ];To get the field value, you can create a helper function like this:
function my_setting( $field_id ) { $option_name = 'my_option'; $field_id = ICL_LANGUAGE_CODE . '_' . $field_id; // Prepend the language code. return rwmb_meta( $field_id, array( 'object_type' => 'setting' ), $option_name ); }Anh Tran
KeymasterHi Nick,
I understand. However, the problem is Beaver Themer auto outputs text using
wpautop, which wraps text in<p>tag.Why don't you use CSS to reduce the spacing? I think it's fast and works.
August 16, 2018 at 12:01 PM in reply to: ✅Frontend edit button not showing up on custom post type single #11017Anh Tran
KeymasterAnh Tran
KeymasterHi Jason,
I found 3 things:
- Your syntax isn't correct. You need to put validation rules as a param of meta box, not under
fields. Here is the correct code: https://ghostbin.com/paste/gnch6 -
In the rules and messages, because the field is a checkbox list, its checkboxes has name
obh_member_membership_tags[], notobh_member_membership_tags. We have to use the input name, not the field ID. See the code in point 1 how I fixed it. I should have mentioned that clearer in the docs. -
There's also a bug with Meta Box, I've fixed it on Github.
Please try it and let me know if there's still any bug.
Anh Tran
KeymasterHi Harrison,
This problem is the same as in MB Frontend Submission. To understand and resolve it, please read this docs.
Anh Tran
KeymasterHi Hazmi,
The statement is correct. However, I missed the code for switch field. The checkbox field works correctly. I've just push the fixes for the switch on Github.
Anh Tran
KeymasterYes, it's safe. In the code above, there's no code to remove the data. So it always there.
You should always backup the database before doing this.
Anh Tran
KeymasterHi Nick,
The fields uses either
<p>or no tags at all. It doesn't use only<br>tag.I've just tested with Themer's text module and it seems to always output
<p>tag, no matter what the data is. I'm wondering why don't you use the<p>tag.Anh Tran
KeymasterHi Thomas, here is the video tutorial:
Please pay attention to the text I wrote in the video :).
Hope you like it.
AnhAnh Tran
KeymasterHi Mauro,
It's great to see you done that. I'd love you to contribute to the osm-frontend.js file. It's used in the frontend. Maybe just make it works with array of locations.
Anh Tran
KeymasterHi Thomas,
I think the problem is where you put the code that gets the image. For the template that doesn't have header background, you should perform a simple check like this:
$images = rwmb_meta(...); if ( $images ) { $image = reset( $images ); echo $image; }Anh Tran
KeymasterHi, Thomas. I hide the logout link, cause it's not really useful. Do you really need it? I can put it in the Quick Links section if you want.
Anh Tran
KeymasterHi Thomas,
I'll create a tutorial and video to demonstrate how those helper functions work and what is the difference between them. Please wait a little.
Thanks,
Anh - Your syntax isn't correct. You need to put validation rules as a param of meta box, not under
-
AuthorPosts