Forum Replies Created
-
AuthorPosts
-
Long Nguyen
ModeratorHi,
Please use the option "Datepicker options" when creating the field
dateto add custom settings, screenshot https://monosnap.com/file/JcBk7mLE7zRBIVaGNXSXMFxIzJjChvLong Nguyen
ModeratorHi,
The code still works as well on my demo site with a custom post type. Can you please share some screenshots of the issue? And share the code that creates the CPT on your site?
Long Nguyen
ModeratorHi,
If you get the group value above with this code
$group_values = rwmb_meta( 'group_tapgyiu2mz', '', $post_id );please remove itself from the loop
add_action("rwmb_frontend_after_process", function ($config, $post_id) { if ("ticket-addon" === $config["id"]) { $group_values = rwmb_meta( 'group_tapgyiu2mz', '', $post_id ); if ( ! empty( $group_values ) ) { foreach ( $group_values as $key => $group_value ) { $rank = isset( $group_value[ 'ticket_rank' ] ) ? $group_value[ 'ticket_rank' ] : ''; echo $rank; // Display sub-field value //$post_id = 123; <-- getting post ID from the add_action //$value = rwmb_meta( 'group_tapgyiu2mz', '', $post_id ); <--remove the duplicate code to get group value here if( $key == 0 ) $group_values[$key]['ticket_row_id'] = '1234'; //update field ticket_row_id for the first clone group only, for example } } rwmb_set_meta( $post_id, 'group_tapgyiu2mz', $value ); //move this code outside the loop because we need to update the group field with ID die(); } }, 10, 2 );Long Nguyen
ModeratorHi,
To update the value in the multidimensional array, you need to point to all indices. For example
$value[0]['ticket_extra'] = '2025';then the field ID that needs to update is the group ID, not the subfield ID
rwmb_set_meta( $post_id, 'group_tapgyiu2mz', $value );Basic knowledge of PHP coding is needed to control the group value in this case, you can read more here https://www.phptutorial.net/php-tutorial/php-multidimensional-array/
Long Nguyen
ModeratorHi Marius,
You can use the setting
query_argsto limit posts by some arguments (like tax_query), please read more on this documentation https://docs.metabox.io/fields/post/But the field does not support changing the argument value based on another field value immediately like using JS code, just on loaded.
Long Nguyen
ModeratorHi,
Because the post type
shop_orderis not publicly to query, you can see here https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/class-wc-post-types.php#L387-L426
You can try to use the filterwoocommerce_register_post_type_shop_orderto override this default setting of WooCommerce.July 9, 2022 at 3:40 PM in reply to: ✅file_upload reordering interfering with touch scrolling #36891Long Nguyen
ModeratorHi Glen,
I also see that issue happens with the Media popup when selecting an image from Featured Image of WordPress. I'm not sure why this happens but I will inform the development team to see if there is something we can do from our side.
Long Nguyen
ModeratorHi,
It looks like the subfield URL value is not added to the
linkfield of Elementor. I will inform the development team to consider supporting this case in future updates.Meantime, please use the URL as a top field to get the link dynamically.
Long Nguyen
ModeratorHi Garth,
I'm going to inform the developer team to consider adding it to the to-do list for future development.
Thank you.
Long Nguyen
ModeratorHi Amy,
To update the field value in a custom table (created by Meta Box), you can follow this documentation to use the public API https://docs.metabox.io/extensions/mb-custom-table/#update
If it does not work, please share the code that create the custom fields on your site, I can help you to check the issue.
Long Nguyen
ModeratorHi,
Simply, you can create an
ifstate to check if there is a related post and display the heading. For example{% if (condition here) %} heading here {% for post in relationship.to %} {% endfor %} {% endif %}July 8, 2022 at 11:14 PM in reply to: ✅How To Display Associated Custom Taxonomy Terms in Related Posts Query Loop #36882Long Nguyen
ModeratorHi Brent,
You can use the WordPress function
wp_get_post_terms()to get terms associated with a post based on the post ID. Please read more on the documentation https://developer.wordpress.org/reference/functions/wp_get_post_terms/For example:
... <h3> {{ post.title }} </h3> <p> I WANT THE ASSOCIATED TERMS FROM THE PRESENTER-TYPE TAXONOMY DISPLAYED HERE, SEPERATED BY | {% set presenter_types = mb.wp_get_post_terms ( post.ID, 'presenter-type' ) %} {% for presenter_type in presenter_types %} {{ presenter_type.name }} {% endfor %} </p> ...Long Nguyen
ModeratorHi Marius,
Here is the guide for this case
- Get terms associated with current Agent CPT
- Use the loop to iterate through the term array
- Get post typereviewbased on the term ID (tax_query)
- Use the loop (nested) to iterate through the post arraySomething like
{% set profile_terms = mb.wp_get_post_terms ( post.ID, 'profile' ) %} {% for profile_term in profile_terms %} {% set args = { post_type: 'review', tax_query: [{ taxonomy: 'profile', field: 'id', terms: profile_term.term_id }] } %} {% set reviews = mb.get_posts( args ) %} {% for review in reviews %} {{ review.post_title }} {% endfor %} {% endfor %}Long Nguyen
ModeratorHi John,
It can be done with a simple button click to save/change the post status but you will need more custom code to do that, not with just the helper function and form hooks.
If you are not familiar with coding, you can create a service request here https://metabox.io/contact/, our development team will help you with an extra fee.Long Nguyen
ModeratorHi Garth,
Thank you for your suggestion.
I'm not able to view your images, they might be broken. Can you please share it again?
-
AuthorPosts