Forum Replies Created
-
AuthorPosts
-
vacdk
Participant
vacdk
ParticipantThanks for your reply, but I can't see how.?
I have a group, and when I see it on the front-end, I can press the "remove" see pic.
Then i Want to do and action when removing the group item.vacdk
ParticipantPlease help as i can't get this to work.
I have this ShortCode[mb_frontend_form id='product-fields, products-to-venue_relationships_to' post_fields='title,content' post_type="Product"]Product-fields is custom fields ID added to post->product
products-to-venue is the relationship IDAll is showing except the relationship field.
I have al so tried:
products_to_venue_relationships_to
products-to-venue_to
products_to_venue_to
all in {}vacdk
ParticipantDidn't go well, nothing works ๐
$terms = get_terms( [ 'taxonomy' => 'venues', 'hide_empty' => false, 'relationship' => [ 'id' => 'venue_to_user', 'to' => 1, // User-ID ], ] ); foreach ( $terms as $term ) { print_r($term); }add_action( 'mb_relationships_init', 'your_prefix_function_name' ); function your_prefix_function_name() { MB_Relationships_API::register( [ 'id' => 'venue_to_user', 'from' => [ 'object_type' => 'term', 'taxonomy' => 'venues', 'meta_box' => [ 'title' => 'From title', ], 'field' => [ 'name' => 'From label2', ], ], 'to' => [ 'object_type' => 'user', 'post_type' => 'post', 'taxonomy' => 'category', 'meta_box' => [ 'title' => 'To title', ], 'field' => [ 'name' => 'To label2', ], ], ] ); }vacdk
Participant+1 for this.
vacdk
Participant+1 for this
It will make forms much easier to buildvacdk
ParticipantIs this the same if it's a cloneable group ? as I can't get it to work. :/
where is it that I target the specified group field row in the foreach ?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 $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 ); $value[0]['ticket_row_id'] = '1234'; rwmb_set_meta( $post_id, $field_id, $value ); } } die(); } }, 10, 2 );vacdk
ParticipantHow do i Update just 1 field in a clonealbe group ?
Right now i use this code ud output data after submission:
$group_values = rwmb_meta( 'group_tapgyiu2mz', '', $post_id ); if ( ! empty( $group_values ) ) { foreach ( $group_values as $group_value ) { $rank = isset( $group_value[ 'ticket_rank' ] ) ? $group_value[ 'ticket_rank' ] : ''; echo $rank; // Display sub-field value } } die();That works fine
but then I want also to update a group field at the same time in the group.
add_action( 'init', function() { $post_id = 123; $field_id = 'group_tapgyiu2mz'; $value = [ [ 'hidden_field' => '1234', ], ]; rwmb_set_meta( $post_id, $field_id, $value ); }, 99 );vacdk
ParticipantSo i figured it out by define the post_id
rwmb_meta( 'my_field_id', '', $post_id );
vacdk
ParticipantHas this been made as a feature request ?
vacdk
ParticipantOkay, thank you,
Wierd that content only can be displayed if they have posted a post, cause I add them as an author but they only become one after first post ?
But then I have another issue. I have created some CPT, but if they post in these, the author count is not working.
So MetaBox own CPT does not count as posts.
vacdk
ParticipantHow can I do it without oxygen, I need a template to address the WordPress author page ??
/author/name
vacdk
ParticipantWell, i don't thing the callback is the issue, as its doing the same with manual value and label.
But here is the callback
function get_certifikat( ) { $data=array(); $certificats = get_terms('certifikat', array('hide_empty' => 0, 'parent' =>0)); foreach($certificats as $certificat) { $data[$certificat->slug]=$certificat->name; } return $data; }vacdk
ParticipantHere is a video showing..
https://1drv.ms/v/s!Avet-jVvMtjmhBD80rGvPzYmWNXu?e=uZO71Q
Code in views
{% for item in author.user_select_certifikat %}
{{ item.label }}
{% endfor %}On page shortcode: [mbv name="certifikater"]
Its displayed on the author page in wordpress.
vacdk
ParticipantHi
Thanks for your reply,
Its not because the value from the term/select box is missing.
The error will come if the author have yet not created a post in a cpt.
-
AuthorPosts