Forum Replies Created
-
AuthorPosts
-
August 7, 2018 at 6:07 AM in reply to: looking for action or filter to remove user profile shortcode configs #10905
Dan
ParticipantThanks for the response. The issue seems to have gone away (I'm trying to figure out how).
Dan
ParticipantAnh- I'm having similar issue as the OP in terms of validation. I've tried the validation hook and also the normal jquery validation syntax, but nothing seems to work for a few field types. Notably, for me, is image select, which might be similar to OP's radio button issue.
I already do a lot of stuff at rwmb_frontend_insert_post_data before wp_insert_post, so my workaround is to check then to see if its empty, and if so keep the post in draft and set up a validation-like message on the redirect when the (nearly) completed post appears again on the other side. But I try to avoid what I term "wordpress workarounds" whenever I can ๐
thanks!
July 18, 2018 at 5:19 PM in reply to: Form Hooks/Filters for multisite CPT conditional switching situation? #10618Dan
Participantyeah the switch blog part is the kicker. Simply switching between CPTs in the same subdirectory is easy (as long as it is the initial insert post). I know it can be done (I'm doing it now), just not on the scale I'm describing here. I'll look at your suggestions, but it'll be fine either way. thanks
July 18, 2018 at 2:43 PM in reply to: Form Hooks/Filters for multisite CPT conditional switching situation? #10613Dan
ParticipantSure- so since my website is going to be very data heavy, I made a decision to strategically parse custom posts into multiple custom post SQL tables, which I've done through created a multisite with subdirectories. It works well in testing, using switch_to_blog and so on. Basically a long-term decision based on application.
So:
Step 1 - User enters data in a centralized form which will become a CPT. However which specific CPT is unknown until they say what type of "x" it is.
Step 2- The submitted post is quickly hooked (like I've done before). Which CPT is ends up at is based on the user's selection.Normally I could do my previous code and it would just save to the right CPT. However with what I'm doing here, I have to keep it in whatever blog has the CPT until it is saved, and then "restore_current_blog".
I can manually hook it and save each type with wp_insert_post and then restore_to_blog, but I was trying to avoid that.
So, in summary, Post written --> Hooked before save -->CPT determined and sent to the right blog (subdirectory)-->saved --> restore_to_current_blog
Hope that cleared things up. I know it is a very unique set of requirements, and I don't anticipate something that will work other than me wp_inserting myself. thanks!
July 17, 2018 at 10:29 PM in reply to: Form Hooks/Filters for multisite CPT conditional switching situation? #10602Dan
Participantquick update on the above- it actually doesn't save to the CPTs of the subdirectory, just the basic post type. Interesting. Looks like I'll need to manually wp_insert_post them.
-
AuthorPosts