Forum Replies Created
-
AuthorPosts
-
February 1, 2018 at 2:56 PM in reply to: Prevent sortable nested group being able to be moved outside of its parent. #8424
Anh Tran
KeymasterHi, I tried that and couldn't replicate the bug. Here is what I have:
Can you try again?
Anh Tran
KeymasterHi, currently it's not possible. You can show/hide the whole field only π
Anh Tran
KeymasterHi,
I think the problem comes from how you get the custom field data for categories. Basically, this loop:
foreach ( $cats as $cat ) { $term_id = $cat->term_id; }makes
$term_idis always the ID of the last category. No matter how many categories, it always get the last category.That's why you always see the same data. Please take a look at that.
February 1, 2018 at 11:57 AM in reply to: after update latest version of metabox plugin facet wp extension seems down.. #8420Anh Tran
KeymasterOops, I've just fixed it in version 1.0.1. Please update.
January 31, 2018 at 2:27 PM in reply to: Prevent sortable nested group being able to be moved outside of its parent. #8411January 31, 2018 at 2:13 PM in reply to: β MB Relationships - Using each_connected multiple times #8410Anh Tran
KeymasterNo problem. Here is the code for registering relationships:
add_action( 'mb_relationships_init', function () { MB_Relationships_API::register( array( 'id' => 'posts_to_pages', 'from' => 'post', 'to' => 'page', ) ); MB_Relationships_API::register( array( 'id' => 'posts_to_posts', 'from' => 'post', 'to' => 'post', ) ); } );And here is the code to fetch connections (in
index.phpfile):global $wp_query; MB_Relationships_API::each_connected( array( 'id' => 'posts_to_pages', 'from' => $wp_query->posts, 'property' => 'connected_pages', ) ); MB_Relationships_API::each_connected( array( 'id' => 'posts_to_posts', 'to' => $wp_query->posts, 'property' => 'connected_posts', ) );Here is the code in the
content.phpfile:foreach ( $post->connected_pages as $post ) : setup_postdata( $post ); the_title(); endforeach; wp_reset_postdata(); echo '<hr>'; foreach ( $post->connected_posts as $post ) : setup_postdata( $post ); the_title(); endforeach; wp_reset_postdata();Anh Tran
KeymasterHi, the problem is your post field ID. On the editing screen, the
#postis used for the post form, so you can't use IDpost. You need to change the ID of the post field.Then, you can hide the group if the field is null with this condition:
'hidden' => array( 'post2', '=', '' ), // post2 is post field ID.PS: Please renew your license to get updates of extensions and support.
Anh Tran
KeymasterWeβve just realized this problem and weβre working this.
PS: It's fixed in the version 1.2.2. Please update.
January 29, 2018 at 11:15 AM in reply to: β How to add a custom id to the "rwmb-meta-box" wrapper #8383Anh Tran
KeymasterHi UG,
1. If that's the case, then you can use the
idautomatically created by WordPress. Each meta box will have a unique ID the same as the ID settings. See this screenshot:https://imgur.elightup.com/yP1KjMq.png
2. I've seen the issues with the code. No need screenshot anymore. I will check and fix it asap.
3. I've checked and seen the fields appear before
.edit-tag-actions. Here is how it appears on my side:https://imgur.elightup.com/M7XcDOv.png
PS: To upload the screenshot, you can use this app: https://getsharex.com/. It auto uploads images to imgur.com after taking screenshots. Then just paste the image URL here.
Anh Tran
KeymasterAnh Tran
KeymasterHi, your code seems to correct. When specify
limitit returns an array of single image. So you might want to do this:$images = rwmb_meta( 'field_id', array( 'object_type' => 'setting', 'size' => 'thumbnail', 'limit' => 1, ), 'options_name' ); $image = reset( $images ); echo $image['url'];Anh Tran
KeymasterPlease send me via email. Thanks.
Anh Tran
KeymasterHi, this is a good idea. I planned to worked with admin columns. I will make a not on that.
January 29, 2018 at 8:46 AM in reply to: β MB Relationships - Using each_connected multiple times #8375Anh Tran
KeymasterHello,
I've just tested again with a similar code and here is my result:
Can you check your code again please?
Anh Tran
KeymasterHi,
The MB Builder hasn't supported the MB Term Meta yet. But you can get over it with "Custom Attributes" for meta box. Switch to "Settings" tab and set a custom attribute "taxonomies" and enter your taxonomy slug into the input, like in this screenshot:
https://imgur.elightup.com/ZwsLeKM.png
We'll update the plugin to make it easier for selecting taxonomies in the next version.
-
AuthorPosts