Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterI think it would be better if you have default values for your settings, and then you don't need to check with
if:$default = array(); $settings = get_option( 'setting_id' ); $settings = wp_parse_args( $settings, $default ); // Then echo $settings[$field_id];June 22, 2016 at 8:16 PM in reply to: โ When I create a new item it says 1/1 on my image_advanced field and won't let me upload a new one #3513Anh Tran
KeymasterDo you use the latest version of the Group extension?
Anh Tran
KeymasterGreat that you made it!
Anh Tran
KeymasterOh, I see. The validation rules will use jQuery to find the elements with the selector = field's ID. As you're using the field with
'multiple' => true, then it would adds[]to the selector, which is invalid. Adding the'required' => trueto the field fixes this problem ๐Anh Tran
KeymasterHi,
I think you can use a trick to find the correct meta box for your settings page and add/edit fields/tabs for it.
The trick is using a key for meta boxes, like this:
$meta_boxes['prefix_settings_page_id'] = array();And in your extension:
$meta_boxes['prefix_settings_page_id']['tabs'][] = array(); $meta_boxes['prefix_settings_page_id']['fields'][] = array();Just make sure the extension hooks into the
rwmb_meta_boxesafter the main plugin.This technique is covered partly in this documentation https://metabox.io/docs/edit-remove-meta-boxes/.
Anh Tran
KeymasterHmm, can you try including the extension directly in the child theme? I wrote a docs for this here:
https://metabox.io/docs/include-extensions-themes-plugins/
I couldn't find any clue with child theme. Very weird ๐
Anh Tran
KeymasterUnfortunately no :(. I couldn't make it run on my Windows. I think XAMPP Lite included in DS conflicts with XAMPP somehow.
Anh Tran
KeymasterThanks a lot for your fix, Adam! I've just made an improvement to make it works in all cases.
Anh Tran
KeymasterI see. AFAIK, the select2 library doesn't have options to drag and drop selected items :(. There are some questions about the same issue on Github and StackOverflow. This is the limit of the library we use for select_advanced field.
June 20, 2016 at 9:09 AM in reply to: โ When I create a new item it says 1/1 on my image_advanced field and won't let me upload a new one #3489Anh Tran
KeymasterHi,
Do you have
'max_file_uploads' => 1in your code? The status simply shows that you have uploaded the maximum allowed number of files. In order to upload more files, you need to remove existing files.Anh Tran
KeymasterHi,
We've just fixed that in the latest version of the plugin. Please update.
Anh Tran
KeymasterThat's fine ๐ Glad that you resolved it!
Anh Tran
KeymasterRegarding the taxonomy field: as the values are not saved into post meta, they're used to set post terms and post terms are exported by WP so there should be no problem with it.
Regarding the term meta, unfortunately, WordPress doesn't export/import term meta. There is a work on that which will be included in WordPress 4.6.
In the meantime, you can download the patch and use it.
Anh Tran
KeymasterI understand. I thought I did this in the previous version but looks like not. I will fix it so
emptywork.Thanks for noticing the bug.
Anh Tran
KeymasterDo you mean sorting options of a
select_advancedfield? -
AuthorPosts