Forum Replies Created
-
AuthorPosts
-
Warren Johnston
ParticipantThanks Long - I will see if I can work something out.
Warren Johnston
ParticipantThank you Long, you are a star as always mate - I will give this a try!
May 22, 2022 at 12:49 AM in reply to: ✅Is there any way to import a csv to populate relationships? #36117Warren Johnston
ParticipantThanks Mate!
May 20, 2022 at 3:52 AM in reply to: ✅Is there any way to import a csv to populate relationships? #36091Warren Johnston
ParticipantAny ideas Long?
May 18, 2022 at 12:19 AM in reply to: ✅Is there any way to import a csv to populate relationships? #36063Warren Johnston
ParticipantI have run into this issue now as well. 🙂
Do you think there is a possible option to set post relationships in bulk using the api and mb_relationships_add?
I don't really know where to start so some pointers would be very much appreciated!
May 8, 2022 at 11:17 PM in reply to: ✅Adding a Post Thumbnail using Metabox Field on the Front End #35957Warren Johnston
ParticipantHere is some code for future reference for anyone struggling with this 🙂
add_action( 'rwmb_XXXFIELDGROUPIDXXX_after_save_post', 'update_post_title' ); function update_post_title( $post_id ) { // Get the field value $my_title = rwmb_meta( 'XXXFIELDIDXXX', '', $post_id ); $my_desc = rwmb_meta( 'XXXFIELDIDXXX', '', $post_id ); $my_feature = rwmb_meta( 'XXXFIELDIDXXX','', $post_id ); // Prepare update post $my_post = array( 'ID' => $post_id, 'post_title' => $my_title, 'post_excerpt' => $my_desc, ); wp_update_post( $my_post ); set_post_thumbnail( $post_id, $my_feature['ID'] ); }May 8, 2022 at 2:55 PM in reply to: ✅Adding a Post Thumbnail using Metabox Field on the Front End #35947Warren Johnston
ParticipantThat makes sense
Would you guys have a recommended piece of code like the above based on _after_save_post that would attach the image to to the post featured image correctly?
Many thanks
Warren
May 7, 2022 at 3:11 PM in reply to: ✅Adding a Post Thumbnail using Metabox Field on the Front End #35935Warren Johnston
ParticipantWhen I browse to the post in the back end I do see the image in the field group, but the featured image box in the side bar is empty. So its saving the image to the table but not adding it as the featured image for the custom post.
May 7, 2022 at 3:09 PM in reply to: ✅Adding a Post Thumbnail using Metabox Field on the Front End #35934Warren Johnston
ParticipantHi Long
That is not working mate, I've tried that multiple times.
The only thing I can think of is my field group is being stored as a custom table - would that make any difference.
Happy to set you guys up with an admin account if you want to take a look?
Warren
Warren Johnston
ParticipantThank you Long! You really are a star mate.
I don't have the programming skills to tackle this myself yet but I think as an option on the Image Select field other customers may find it useful as well so hopefully the devs can consider it 🙂
Thanks again!
Warren Johnston
ParticipantHi Ya Long
Where do I find my Metabox ID to put in this code - i can find field ID's fine but cant seem to find a metabox ID
April 28, 2022 at 7:22 PM in reply to: ✅Connecting Child Posts to a Parent Post Automatically. #35816Warren Johnston
ParticipantHi Ya
Di I put that code into functions.php? Or somewhere else?
April 26, 2022 at 11:55 PM in reply to: ✅Connecting Child Posts to a Parent Post Automatically. #35802Warren Johnston
ParticipantThanks Long
I actually have a slightly different use case.
On the Post Project A - I would like to be able to place a button that when pressed links to the form to create Entry B and either in the query string or perhaps as post data passes the postid of Project A into the form so when its submitted it automatically links Entry B as a child of Project A.
So really its finding a method of generating the button to sit on the Project A post and then finding a way to process the incoming querystring or post data (which ever is the most secure method idealy) in the form so it has the correct relationship parameters in place for when it creates its Entry B.
Does that make sense?
-
AuthorPosts