Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 601 through 615 (of 4,839 total)
  • Author
    Posts
  • in reply to: Formatting date picker #36901
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please use the option "Datepicker options" when creating the field date to add custom settings, screenshot https://monosnap.com/file/JcBk7mLE7zRBIVaGNXSXMFxIzJjChv

    in reply to: Insert wysiwyg field value to post content #36900
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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?

    in reply to: update_post_meta for cloneable group fields #36899
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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
    );
    in reply to: Setting a cloneable group value for a post #36898
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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/

    in reply to: Frontent Submission CPT logic #36893
    Long NguyenLong Nguyen
    Moderator

    Hi Marius,

    You can use the setting query_args to 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.

    in reply to: Render custom post type custom field - Woocommerce #36892
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Because the post type shop_order is 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 filter woocommerce_register_post_type_shop_order to override this default setting of WooCommerce.

    Long NguyenLong Nguyen
    Moderator

    Hi 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.

    in reply to: Metabox Group Skin - Elementor Template #36889
    Long NguyenLong Nguyen
    Moderator

    Hi,

    It looks like the subfield URL value is not added to the link field 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.

    in reply to: Meta Box Optimizations #36885
    Long NguyenLong Nguyen
    Moderator

    Hi Garth,

    I'm going to inform the developer team to consider adding it to the to-do list for future development.

    Thank you.

    in reply to: How to manipulate data after submission? #36884
    Long NguyenLong Nguyen
    Moderator

    Hi 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.

    in reply to: Hide MB View if No Content #36883
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Simply, you can create an if state 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 %}
    Long NguyenLong Nguyen
    Moderator

    Hi 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>
    ...
    
    in reply to: Display Related Taxonomies #36881
    Long NguyenLong Nguyen
    Moderator

    Hi 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 type review based on the term ID (tax_query)
    - Use the loop (nested) to iterate through the post array

    Something 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 %}
    in reply to: Change Post Status With a Button #36870
    Long NguyenLong Nguyen
    Moderator

    Hi 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.

    in reply to: Meta Box Optimizations #36868
    Long NguyenLong Nguyen
    Moderator

    Hi Garth,

    Thank you for your suggestion.

    I'm not able to view your images, they might be broken. Can you please share it again?

Viewing 15 posts - 601 through 615 (of 4,839 total)