Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi Régis,
Thank you for reaching out.
If you use the function
get_posts(), it will return post objects, we can call it a custom query. A post object does not support to access the field ID as a property of it.You can get the post info via the post ID in a custom query by using the WordPress functions or our helper function rwmb_meta(). For example, featured image, use the function get_the_post_thumbnail().
<div class="markets"> {% set args = {post_type: 'market', posts_per_page: -1} %} {% set posts = mb.get_posts( args ) %} {% for post in posts %} {# Image #} {% set image = mb.rwmb_meta( 'logo_market', '', post.ID ) %} <img src="{{ image['full_url'] }} "> {{ mb.get_the_post_thumbnail( post.ID, 'thumbnail' ) }} {% endfor %} </div>Long Nguyen
ModeratorHi Harry,
Thank you for reaching out.
Please follow this article to move custom post types, custom fields from Pods or ACF to Meta Box https://metabox.io/move-custom-post-type-custom-field-data-from-pods-to-meta-box/.
Long Nguyen
ModeratorHi,
You can create many relationships between objects as you want: post types, users, terms.
Forpostobject, specific bypost_typesetting.
Fortermobject, specific bytaxonomysetting.add_action( 'mb_relationships_init', function() { MB_Relationships_API::register( [ 'id' => 'events_to_venues', 'from' => [ 'object_type' => 'post', 'post_type' => 'event', 'meta_box' => [ 'title' => 'Link to Venues' ] ], 'to' => [ 'object_type' => 'post', 'post_type' => 'venue', 'meta_box' => [ 'title' => 'Assigned Events' ] ], ] ); } );add_action( 'mb_relationships_init', function() { MB_Relationships_API::register( [ 'id' => 'venues_to_workzone', 'from' => [ 'object_type' => 'post', 'post_type' => 'venue', 'meta_box' => [ 'title' => 'Link to Work Zones' ] ], 'to' => [ 'object_type' => 'post', 'post_type' => 'workzone', 'meta_box' => [ 'title' => 'Link to Venues' ] ], ] ); } );add_action( 'mb_relationships_init', function () { MB_Relationships_API::register( [ 'id' => 'categories_to_workzone', 'from' => [ 'object_type' => 'term', 'taxonomy' => 'category', 'meta_box' => [ 'title' => 'Assigned Work Zones' ] ], 'to' => [ 'object_type' => 'post', 'post_type' => 'workzone', 'meta_box' => [ 'title' => 'Link to Categories' ] ], ] ); } );Please read more on the documentation
https://docs.metabox.io/extensions/mb-relationships/#terms-to-posts
https://docs.metabox.io/extensions/mb-relationships/#users-to-postsLong Nguyen
ModeratorHi Igor,
You need to check the support option Page attributes to show the Attribute box. Screenshot https://share.getcloudapp.com/xQub8D7B
May 11, 2021 at 9:32 PM in reply to: ✅Fatal error after updating Meta Box because of extended class #28101Long Nguyen
ModeratorHi,
Simply, you can check if the class exists before doing your stuff.
if( class_exists( '\MBAC\Post' ) ) { // do your stuff }Long Nguyen
ModeratorHi,
Here is the response from the ticket system:
The View needs Rest API enabled to fetch the data, but it does not have the permission to access the Rest API
https://erikworkshop.fr/metabox/wp-json/mbv/meta-boxes?object_type=postScreenshot https://share.getcloudapp.com/RBuYDXwR
Please try to contact the hosting support to ask for help in this case.
Long Nguyen
ModeratorHi,
Sorry, it's from another topic. I've responded to you about the issue with Rest API.
Long Nguyen
ModeratorHi,
I've received your site info in the ticket system. Looking through the codebase of the plugin Social Warfare Pro, I see that it uses Meta Box as a library and modifies our codebase a little bit. Please try to contact the plugin support to check if the Meta Box plugin (class
RWMB_Loader) has been inited before to fix this issue.Long Nguyen
ModeratorHi,
If you use
{% for post in relationship.to %}that means it will retrievepublisherposts which connected to the currentbook. View location Book.If you use
{% for post in relationship.from %}that means it will retrievebookposts which connected to the currentpublisher. View location Publisher.Get more details on the documentation https://docs.metabox.io/extensions/mb-relationships/#getting-connected-items.
Long Nguyen
ModeratorHi,
Yes, it is possible. You can add the setting meta box title to the
fromortoarray. For example:'from' => [ 'object_type' => 'post', 'post_type' => 'post', 'meta_box' => [ 'title' => 'Custom connected' ] ], 'to' => 'page',Read more on the documentation https://docs.metabox.io/extensions/mb-relationships/#syntax
If you use the builder, you can click on the tab Meta Box, screenshot https://share.getcloudapp.com/P8u5qJYl.
Long Nguyen
ModeratorHi,
Thank you for reaching out.
The solution MB Testimonials does not support changing the autoplay speed. I'm going to inform the developer team to consider adding it to the to-do list for the future development of the plugin.
Long Nguyen
ModeratorHi,
Click on the Edit and Preview button of the block, it reloads and fetches the new data as well. Screen record https://share.getcloudapp.com/X6ue60En. Can you please deactivate all plugins except Meta Box and MB extensions to re-check the issue?
Long Nguyen
ModeratorHi,
Can you please share the code that creates the relationships and the code that get the books? I will help you to check the issue.
Long Nguyen
ModeratorHi,
To make the URL clickable, you just need to add it to the attribute
hrefof a<a>tag.<a href="{{ field }}">{{ field }}</a>Long Nguyen
ModeratorHi Greg,
Thank you for your feedback.
I will escalate this issue to the development team to fix it in future updates.
-
AuthorPosts