Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHmm, that's unexpected and weird behaviour. I'm fixing it and will update asap.
July 23, 2015 at 9:59 AM in reply to: Metaboxes started to disappear in admin UI - Only 10 show up #1115Anh Tran
KeymasterI had another customer who had (maybe) similar problem: he registered a lot of meta boxes and fields and couldn't save them. The problem was: PHP limits the number of POST fields, usually 1000, and also POST size. This makes you not save all fields when you build your meta boxes with the Builder.
Here are some links for reference about this:
http://stackoverflow.com/questions/8710185/new-limit-within-php-1000-fields-per-post-does-someone-know-if-the-number-can
http://www.inmotionhosting.com/support/community-support/prestashop-15/increase-the-maxinputvars-in-phpiniThe fix for that is editing the
.htaccess(orphp.ini) like this:php_value max_input_vars 3000 php_value suhosin.get.max_vars 3000 php_value suhosin.post.max_vars 3000 php_value suhosin.request.max_vars 3000See here for more information: http://stackoverflow.com/a/14166562/371240
Please try and let us know if this fixes.
Anh Tran
KeymasterI see, I will check with the group extension also. Please let me know about the JS error in console if you find anything.
Anh Tran
KeymasterHi, I've just sent you the invoice via email.
I will add invoice download link to user profile later.
Have fun.
Anh Tran
KeymasterI think you can do that with custom JS code. The idea is:
- Enqueuing a JS file for Add New/Edit pages
- Call jQueryUI sortable methodThe pseudo-code might look like this:
add_action( 'admin_enqueue_scripts', function() { $screen = get_current_screen(); if ( 'team' == $screen->post_type && 'post' === $screen->base ) { wp_enqueue_script( 'prefix-sort-field', get_theme_directory_uri() . '/js/sort.js', array( 'jquery-ui-sortable' ) ); } } );And in
sort.js:jQuery( function ( $ ) { $( '.rwmb-input' ).sortable(); } );Hope that helps.
Anh Tran
KeymasterIt does have clear floats, of course. But the thing is the plugin needs correct number of columns to output correct opening and closing divs. You can see it in the console like this:

Here is an example to illustrate what I meant in previous reply: assuming we have 2 rows, 1st row has 2 fields (each field has 1/4 width), 2nd row has 4 fields (each field has 1/4 width):
add_filter( 'rwmb_meta_boxes', function () { return [ [ 'title' => 'Demo columns', 'fields' => [ [ 'id' => 'text1', 'type' => 'text', 'name' => 'Text1', 'columns' => 3, ], [ 'id' => 'text2', 'type' => 'text', 'name' => 'Text2', 'columns' => 3, ], [ 'type' => 'custom_html', 'std' => '', 'columns' => 6, ], [ 'id' => 'text5', 'type' => 'text', 'name' => 'Text5', 'columns' => 3, ], [ 'id' => 'text6', 'type' => 'text', 'name' => 'Text6', 'columns' => 3, ], [ 'id' => 'text7', 'type' => 'text', 'name' => 'Text7', 'columns' => 3, ], [ 'id' => 'text8', 'type' => 'text', 'name' => 'Text8', 'columns' => 3, ], ], ] ]; } );Anh Tran
KeymasterHi, I think there must be some JS errors which prevent the editor to be rendered properly. Do you see any errors in browser console?
Anh Tran
KeymasterAn easy way to do that is keep adding 4 fields for columns, but you can use a special field like
custom_htmlwith zero content. That forces the plugin to output empty divs in the column which helps to maintain the layout.Anh Tran
KeymasterHi, currently the
rwmb_metafunction usesget_terms()internally and this function doesn't return terms in hierarchical order. I think the best way for now is going through the returned items, looking forparentparameter to get the correct order.Anh Tran
KeymasterHi catarinacarraro,
I've just tested with your code and I see the
stdvalue works, the radio with value "Em" is checked by default:
Anh Tran
KeymasterI'm really sorry that you have spent much of time searching for the solution. I was on a holiday last week and couldn't answer you sooner. Hope you be generous and still love the plugin.
Anh Tran
KeymasterHi, in order to convert data from 1 format to another format, you need to understand how data is saved in the database. Here is the documentation for this. For group, data is saved as an array, each element of which is the value of sub-fields.
In this case, if you are using simple
textfield, your data is just multi rows in the database, so getting values will not be a big problem. But I'm not clear how you want to put them in a group? Will the text field is a sub-field of the new group? If so, you can use the following code:<?php $text_id = 'TEXT_FIELD_ID'; $group_id = 'GROUP_FIELD_ID'; $posts = get_posts( array( 'posts_per_page' => -1, ) ); foreach ( $posts as $post ) { $text = rwmb_meta( $text_id, 'type=text', $post->ID ); $meta_key = "{$group_id}[{$text_id}]"; update_post_meta( $post->ID, $meta_key, $text ); // delete_post_meta( $post->ID, $text_id ); // Remove old data, use with care }Anh Tran
KeymasterI think I understand now, but it's still better to have screenshots ๐
Anh Tran
KeymasterHi, you can use
postfield with'post_type' => 'page'.Anh Tran
KeymasterHi Flickweert,
I'm not very clear about the bug. Do you mean that when adding
max_clone, it still allows you to add infinite number of clones? And when you remove a clone, the "Add more" button disappear? -
AuthorPosts