Forum Replies Created
-
AuthorPosts
-
March 30, 2023 at 8:33 PM in reply to: Beaver Builder image gallery connection to Metabox field #41270
Peter
ModeratorHello,
Did you receive my reply in the ticket system? Please check this screenshot https://monosnap.com/file/YOnz6SLLRU2Vc5LMj56yOZxTumUyqI
You can disable the option "Cloneable" in the field image_advanced settings to make it works with the gallery module of Beaver Builder, screenshot https://monosnap.com/file/G9pVUEdO94oG8vmLnvXBAfpNx4VNeC
Peter
ModeratorHello,
Yes, I understand that. Did you try to create an
ifstatement to check the current post ID and run the code inside?For example:
{% if mb.get_queried_object_id() == 123 %} {% set relationship = attribute( relationships, 'speaker-topic' ) %} ... {% endif %}Peter
ModeratorHello,
Correct, the default email field in the user profile has the same ID
email. In my profile, it already has value so I do not see the issue.March 29, 2023 at 7:35 PM in reply to: ✅Changing the Post Title/Slug after front-end submissions based on fields #41260Peter
ModeratorHello,
Did you add the post type attribute to the frontend submission shortcode to create a new post of the
catspost type? If yes and the code above does not work, please share the shortcode that you are using on your site.
Read more on the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#submission-formPeter
ModeratorHello,
Please edit the field group and check the option "Save field value" of each field in the Advanced tab, make sure it is enabled. Screenshot https://imgur.com/3ZTgZK8
Let me know how it goes.
Peter
ModeratorHello,
1. Is it possible to exclude by post id, perhaps for this specific view?
You can use the functionget_queried_object_id()to get the current post/page ID and create anifstatement to run the code or not based on the condition.
https://developer.wordpress.org/reference/functions/get_queried_object_id/2. Is it possible to define how they're ordered? I'd like to do it by date added in desc order.
You can use the functionget_posts()and add the relationship to the arguments to order the post.
Please read more on the documentation https://docs.metabox.io/extensions/mb-views/#custom-query
and refer to this topic
https://support.metabox.io/topic/how-to-order-sort-related-posts-by-title-or-custom-field-value/?swcfpc=1#post-36469Peter
ModeratorHello,
Yes, it is possible. But you need to pass the post ID to the third parameter of the function
rwmb_get_field_settings()to get the field settings. For example:$field = rwmb_get_field_settings( 'my_field_id', '', $post_id );Read more on the documentation https://docs.metabox.io/functions/rwmb-get-field-settings/
Peter
ModeratorHello,
It could be the sanitization of the text field. You can follow the documentation below to bypass the sanitization https://docs.metabox.io/sanitization/
Peter
ModeratorHello,
I run the PHP code on my demo site and do not see that issue, here is the screenshot https://monosnap.com/file/rhqjAvQUExFP6YXFew24az4uNtSKiO
Do you have any user meta field on your site?
March 28, 2023 at 7:38 PM in reply to: ✅Syncing Group Taxonomy Advanced Field with a Taxonomy Field #41246Peter
ModeratorHello,
For example, I have a taxonomy field and a taxonomy_advanced subfield in a group field, like this
$meta_boxes[] = [ ... 'fields' => [ [ 'name' => __( 'Taxonomy', 'your-text-domain' ), 'id' => 'taxonomy_field', 'type' => 'taxonomy', 'taxonomy' => ['drink-recipe'], 'field_type' => 'select_advanced', ], [ 'name' => __( 'Group', 'your-text-domain' ), 'id' => 'group_field', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Taxonomy Advanced', 'your-text-domain' ), 'id' => 'taxonomy_advanced_field', 'type' => 'taxonomy_advanced', 'taxonomy' => ['drink-recipe'], 'field_type' => 'select_advanced', ], ], ], ], ];Then the code to set the post term from the taxonomy_advanced field would be:
add_action( 'rwmb_group_field_after_save_field', function ( $null, $field, $new, $old, $object_id ) { $term_id = (int)$new['taxonomy_advanced_field']; wp_set_object_terms( $object_id, $term_id, 'drink-recipe' ); }, 10, 5 );This is the example code, if it does not work on your site, please contact us with the link below and request a customization service, our development team will help you to check the issue.
https://metabox.io/contact/Peter
ModeratorHello,
I do not see that issue on my end. Can you please export the field group or generate the PHP code and share it here? You can also try to deactivate all plugins and leave only Meta Box, MB extensions activate, switch to a standard theme of WordPress and check this issue again.
Peter
ModeratorHello,
Please refer to this topic https://support.metabox.io/topic/changing-the-post-title-slug-after-front-end-submissions-based-on-fields/?swcfpc=1
to update the post title with a custom field value.March 28, 2023 at 6:49 PM in reply to: ✅Changing the Post Title/Slug after front-end submissions based on fields #41242Peter
ModeratorHello,
Follow the documentation, you can get the post type and post ID from the
$objectvariable. For example:add_action( 'rwmb_frontend_after_save_post', 'update_cats_post_title'); function update_cats_post_title( $object ) { $post_type = $object->post_type; $post_id = $object->post_id; if ( 'cats' == $post_type ) { ... } }https://docs.metabox.io/extensions/mb-frontend-submission/#post-actions
Let me know how it goes.
Peter
ModeratorHello,
Thank you for your details. In general, I think the issue is not on the side of Meta Box. What Meta Box supports here is a custom post type and custom fields to display on the frontend. I'm not sure what option or feature you are using on your local site to filter the post (location) automatically based on moving the map. I suggest you can contact WP Gridbuilder to ask for help with this issue.
You can also update the locations in bulk by going to admin area > Location > Bulk select posts > Edit > Just click on Update, see this screenshot https://monosnap.com/file/dzKzxaT4aOBA4GEDBcbJjH12pP6MNE
March 27, 2023 at 11:03 PM in reply to: ✅CPT, Custom Taxonomy with added image field: how do I get the image? #41233Peter
ModeratorHello,
It's an array of term objects so you need to use a loop to get each term ID. In this case, you can use the sample code to get the author images:
$images = rwmb_meta( 'tax_image', [ 'object_type' => 'term', 'size' => 'thumbnail' ], $terms[0]->term_id ); -
AuthorPosts