Forum Replies Created
-
AuthorPosts
-
September 27, 2021 at 10:43 AM in reply to: ✅frontend form shortcode to exclude certain custom fields #30992
dp
Participantthe reason for above - the shortcodes can be placed in templates/scopes where the different customized conditions are already set by builders like oxygen, etc
September 27, 2021 at 10:33 AM in reply to: ✅frontend form shortcode to exclude certain custom fields #30991dp
Participantnice but that would involve creating more forms, which can be hard to manage. Would ur development team consider something like this.. for a better UX management? Just suggesting, hope u dun mind or what're ur thoughts?
eg. form with 10 custom fields - [mb_frontend_form id='advice-form']
- form [mb_frontend_form id='advice-form' fields='-cf1,-cf3'] to dynamically display 8 custom fields,
- another form [mb_frontend_form id='advice-form' fields='-cf8,-cf9,-cf0'] to dynamically display 7.September 26, 2021 at 9:24 PM in reply to: ✅frontend form shortcode to exclude certain custom fields #30982dp
Participantjust tested but i realize that's done in the frontend to hide the fields (which can still be edited). What i actually meant is to exclude the specified custom fields from the backend, rather than hide using jquery and css
eg. ref -> like [mb_frontend_form id="meta-box-id"] has post_title and post_content omitted from the bkend [mb_frontend_form id="meta-box-id" post-fields="title,content"]
dp
Participantthank you for ur patience. it works. i had the ajax on. thank you again Long
dp
ParticipantThe function get_queried_object_id() get the current page ID that show the frontend form as well.
- yes tried it but returns 0. (pls see my reply #30264)
Do you add the frontend shortcode to the events page directly? Or add through a builder template?
- tested frontend shortcode on page directly and in builder template, no difference
Or just add the fixed ID of the events page like this
MB_Relationships_API::add( 1234, $post_id, 'events_to_posts', $order_from = 1, $order_to = 1 );- yes, i understand this will definitely work but this is what im trying to get -> pls see my reply #30176 ps- frontend form will be on every CPT page with different ID
thank you
August 16, 2021 at 11:18 PM in reply to: ✅Prepopulate relationship field with current post id #30295dp
Participantyes but by doing that, im creating a relationship from the submited post_id to the submited post_id; which isnt what im looking for and redundant
dp
Participantso close, hate to give up 🙁
so any idea how to get the current post id for me to insert into the $to
do_action( 'mb_relationships_add', $post_id, $to, $id, $order_from, $order_to );
thanks Long
August 16, 2021 at 12:13 AM in reply to: ✅Prepopulate relationship field with current post id #30274dp
Participantdo_action( 'mb_relationships_add', $from, $to, $id, $order_from, $order_to );so from the documentation -> the submitted post is $post_id, but my question is how do i get the current post id
$towhen get_the_ID() and get_queried_object_id() doesnt workdo_action( 'mb_relationships_add', $post_id, $to, $id, $order_from, $order_to );dp
Participanttrying to get the current post id with
get_queried_object_id()but nothing gets registered into the db. Also triedget_the_ID().https://pasteimg.com/image/screenshot-2021-08-15-103629-am.c3PIn
here's the code
MB_Relationships_API::add( $post_id, get_queried_object_id(), 'events_to_posts', $order_from = 1, $order_to = 1 );dp
Participanthi long,
im confused. 1) where can i find the field_id. i created using the relationship builder.
2) thank you for ref 🙂 but will the set-meta work for the related post also, since post-meta and the relationship values are saved in different db.
dp
ParticipantThe backend will not need to set the relationship as well because the 'current post' (which the form is on), should automatically be the 'related' post to their 'submission'.
eg. frontend form is on ./post-69. User fill up and submit this form. This submitted entry automatically is related to ./post-69.
dp
Participantyes, the user will not need to set the relationship as the post they are on (when they fill the form), should be the related post
August 9, 2021 at 3:13 PM in reply to: ✅Relationship WP_Query for Oxygen Builder [Repeater] component #30049dp
Participantresolved. pls close this
August 9, 2021 at 9:26 AM in reply to: ✅Relationship WP_Query for Oxygen Builder [Repeater] component #30027dp
ParticipantI created a relationship between post to expert (post cpt). Author will create a expert that will link/relate to a post.
I'm trying to display the linked/related posts on the author archive page.
Im using the tutorial from metabox doc but getting a
Invalid argument supplied for foreach()error.<?php $auid = get_the_author_meta( 'ID' ); $args = array( 'author' => '$auid', 'post_type' => 'post' ); $my_query = new WP_Query( $args ); MB_Relationships_API::each_connected( [ 'id' => 'expert-challenge', 'to' => $my_query->posts, // Set to $my_query. ] ); while ( $my_query->have_posts() ) : $my_query->the_post(); // Display connected pages foreach ( $post->connected as $p ) : echo $p->post_title; // More code here. endforeach; echo '<pre>'; var_dump($my_query->posts) ; echo '</pre>'; endwhile; //wp_reset_postdata(); -
AuthorPosts