Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Dave,
Please try this script (put it in your
functions.phpfile and go to this URL:yourdomain.com?action=migrate):The idea of the script is:
- Make sure it runs only when the URL contains
?action=migrateto avoid running the script on every page load. - Query all the posts that need to migrate the data. You should modify the query to get your correct posts.
- For each post, get the old meta value for each field. Note about the value format to see if it's an array or simple string.
- Insert the values into the new table. If the value is an array, it need to be serialized.
The script comes directly from my mind without testing, so please check it first.
May 2, 2019 at 11:02 AM in reply to: Hidden a group of metabox fields wiht a radio value of another metabox group #14377Anh Tran
KeymasterHi Sergio,
There are 2 ways to do that as you already described in your question:
- Set the rule for each field in the meta box B, or
- Set the rule for the whole meta box B.
I think the 2nd solution is better and cleaner. This rule should be put in the settings of the meta box B:
'hidden' => array( 'radio_field_id', '=, 'radio_1' ),The rule should specify the field ID, not the meta box ID (since the meta box is just a wrap of fields).
Anh Tran
KeymasterHi William,
It's necessary to check if a group has sub-values for title and image. Please try this code:
<?php $product_colour = rwmb_meta( 'product-colour' ); // ID of the group if ( ! empty( $product_colour ) ) { if ( ! empty( $product_colour['title'] ) ) { echo '<h3>', $product_colour['title'], '</h3>'; } if ( ! empty( $product_colour['image'] ) ) { $image = RWMB_Image_Field::file_info( $product_colour['image'], ['size' => 'thumbnail'] ); echo '<img src="', $image['url'], '">'; } } ?>Anh Tran
KeymasterHi Neil,
I've just answered you in another topic. The rule here is: you can add only one tab navigation, no nesting tabs. But for groups, you can add as many groups with any nesting level.
To make things cleaner on the edit screen, I'd suggest using collapsible groups.
Anh Tran
KeymasterDue to the nature of group, a private key is the only way I found to store the current state of a collapsible group, especially with nested groups.
I'll make a commit for the REST API extension to strip it from the output.
Update: the fix is available in the version 1.3.4.
May 2, 2019 at 10:45 AM in reply to: Feature request: Advanced Image w/ specific size for forced crop #14373Anh Tran
KeymasterHi Austin,
This is a nice improvement. I've just looked at the solution on SE and I think it's quite complicated. Working with WP's Media Library is not easy! Our code for the media fields are not simple, either.
I'll make a note on this and see if I can improve it. Thanks for your suggestion.
Anh Tran
KeymasterHi Neil,
You can put groups inside groups without problems. Group supports nesting to unlimited levels.
However, tabs are not nesting. So you need to use only one tab style, either on top or left.
Anh Tran
KeymasterHi Calpaq,
I've just tested again and don't see the problem. Can you make a screenshot or video?
Anh Tran
KeymasterHi,
qTranslate X plugin seems to be abandoned from its author for the last 3 years. I personally don't think it's a good option for a multilingual website. Unfortunately, we don't have an option to make Meta Box work with qTranslate X yet.
April 27, 2019 at 11:05 AM in reply to: ✅Can't Get Image Field to Display Image via Shortcode #14326Anh Tran
KeymasterHi Mark,
Glad that the shortcode works! I'll check the integration with BB. When it's fixed, I'll update the AIO.
Should I expect for this fix to be in the next repository update you make?
Yes. I'll probably use version 4.17.4, so that will overwrite your modified 4.17.3.1 version.
April 27, 2019 at 11:03 AM in reply to: ✅Show field in frontend but not allow to edit by the user #14325Anh Tran
KeymasterHi Sergio,
Yes, it can be done with a condition like this:
[ 'type' => 'text', 'id' => 'field_id', 'name' => 'Text field', 'disabled' => ! is_admin(), // This disables editing in the front end. ]April 27, 2019 at 11:02 AM in reply to: ✅Filterin select advanced with custom field in custom table #14324Anh Tran
KeymasterHi Sergio,
The
meta_keyandmeta_valuein thequery_argswill tell the plugin to filter users by WordPress custom fields, e.g. user meta. They don't handle the value in the custom table.April 27, 2019 at 10:59 AM in reply to: Can AIO activate extensions network-wide in multisite? #14323Anh Tran
KeymasterHi Denny,
Yes, the plugin can be network activated, just like other plugins. However, the settings are saved per site. We have a request make it store settings for the whole network. It's still on our plan.
Anh Tran
KeymasterHi Dave,
I'm afraid you have to write a custom script to migrate existing data from custom fields to custom tables. The plugin doesn't auto transfer data for you.
Anh Tran
KeymasterAh, I forgot to tell you that the code above only add or remove
disabledattribute for the button. Thedisabledmakes the button un-clickable. However, it doesn't change the style. You might need to add something like this to the theme's CSS:button[disabled] { background: #999 } - Make sure it runs only when the URL contains
-
AuthorPosts