Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Hazmi,
The "image_size" param is there to make sure the images are not blurry. It's not meant to display images with exact width and height. Actually, the style for images mimics the Media Library, that's why you see it 284x284 square.
Anh Tran
KeymasterAh, I see.
The storage is an abstract layer between the data and custom fields. With the implementation in the Meta Box plugin, we can create a custom storage to decide where to save data. As you can see, we have implemented storages for post/term/user/comment meta, settings pages (option) and custom table.
In that thread, @Jackky wants to create a custom storage for a custom table, which has a different structure than the one provided by the MB Custom Table extension. That's why I instructed him to create a custom storage for his custom table.
Hope that make things clearer ๐
Anh Tran
KeymasterHi,
Because of some limitation in the media modal, only simple fields such as text, select, radio, checkbox work. Other fields, including the color field, that require custom JS don't work, unfortunately.
Anh Tran
KeymasterHi, I'm not really clear about the situation. Can you please take a screenshot, upload it on imgur.com and paste the link here?
April 3, 2018 at 6:12 PM in reply to: post_parent and taxonomy fileds are not set editing in front end after update #9039Anh Tran
KeymasterI did test with creating the post in the frontend, but haven't test for editing an existing post. Let me try again.
April 2, 2018 at 4:52 PM in reply to: post_parent and taxonomy fileds are not set editing in front end after update #9031Anh Tran
KeymasterHi, I've just checked both the
parentparam andtaxonomyfield and they work. Here is my test:Can you check your code?
Anh Tran
KeymasterHello,
The last snippet seems to make the dropdown works, e.g. making the column *filterable*, instead of *sortable*, doesn't it?
If so, can you try this:
add_filter( 'parse_query', 'query_filter_assembly_steps_by_bunkie' ); function query_filter_assembly_steps_by_bunkie( $query ) { global $pagenow; $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ''; if ( is_admin() && $pagenow === 'edit.php' && $post_type === 'assembly_step' && isset( $_GET['bunkie_id'] ) && $_GET['bunkie_id'] !== 'all' ) { $query->set( 'p', intval( $_GET['bunkie_id'] ) ); } }This code filters the list and displays only 1 post (the post that is selected).
If you want to filter the list and display all posts that have connected "from" a bunkie, then you might want to use this:
add_filter( 'parse_query', 'query_filter_assembly_steps_by_bunkie' ); function query_filter_assembly_steps_by_bunkie( $query ) { global $pagenow, $wpdb; $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ''; if ( is_admin() && $pagenow === 'edit.php' && $post_type === 'assembly_step' && isset( $_GET['bunkie_id'] ) && $_GET['bunkie_id'] !== 'all' ) { $bunkie_id = $_GET['bunkie_id']; $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT <code>to</code> FROM $wpdb->mb_relationships WHERE <code>from</code> = %d", $bunkie_id ) ); $query->set( 'post__in', $post_ids ); } }Anh Tran
KeymasterYou're becoming a master of Meta Box's hooks ๐
March 30, 2018 at 2:20 PM in reply to: type="post" / field_type="checkbox_list" returns only single id #9013Anh Tran
KeymasterCan you send me the site info via contact page? It's quite strange and I might need to look at the site's code to debug it.
Anh Tran
KeymasterHello,
The shortcode only output the whole value of the custom field, in this case - the whole fieldset. In order to display only the values, you can create a custom shortcode to get and show the field value, like this:
add_action( 'init', function () { add_shortcode( 'my_meta', function ( $atts ) { $atts = shortcode_atts( [ 'meta_key' => '', 'post_id' => get_the_ID(), ], $atts ); $values = rwmb_meta( $atts['meta_key'], array(), $atts['post_id'] ); $output = ''; foreach ( $values as $value ) { $output .= $value . ', '; } return $output; } ); } );March 26, 2018 at 5:15 PM in reply to: type="post" / field_type="checkbox_list" returns only single id #8961Anh Tran
KeymasterThe strange thing is the code works fine to me. Where do you put the
add_filtercode? Is it under any condition?March 26, 2018 at 5:14 PM in reply to: โ Option Group support for Select/Select Advanced Field Types #8960Anh Tran
KeymasterHello,
Thanks for bringing an interesting question. I was thinking about this, too. However, the problem is changing the syntax, which requires a lot of code to be modified. Not sure how to do it best and clean.
Anh Tran
KeymasterHi,
This is a feature that has been on our list for a long time. The reason we couldn't implement it because it's quite complicated for some fields like
file_advancedortaxonomy. We'll probably take a look at that again and try to implement for simple fields.March 24, 2018 at 10:54 AM in reply to: Using Custom Attributes from rwmb_before_save_post action #8943Anh Tran
KeymasterYes, the documentation is updated ๐
March 24, 2018 at 10:46 AM in reply to: type="post" / field_type="checkbox_list" returns only single id #8942Anh Tran
KeymasterHello,
I've just tried your code and see it works. The helper function returns an array of IDs. Maybe you register meta boxes only for the admin (with a check like
is_admin())? -
AuthorPosts