Forum Replies Created
-
AuthorPosts
-
jrcreativeMemberFWIW, the same behavior happens in front end forms and admin meta boxes. I tried the custom validation to check the existence of a file and got the same result. Is there a way to use a custom validation filter to address this?
jrcreativeMemberYeah, I love piklist, but I have to +1 this, too. I’d be happy to contribute to the docs, too, if there was a way to do so.
jrcreativeMember@steve okay, great. They didn’t act like that was an option, but I’ll ask again.
Thanks!
jrcreativeMember@cully I’m not seeing the files under /workflows
I think that might be your missing piece. I know I overlooked them the first time I created workflows. 🙂
check out the docs: https://piklist.com/learn/doc/building-first-workflow/
jrcreativeMemberIs the end goal to update text from mae_pb_wl_nested as the value of the HTML field?
jrcreativeMember@4michaelcoleman
If I understand correctly, I think the first thing you need to do is set up your custom post type to act like a page by settinghierarchical => trueYou can add sub-pages to your custom post type programmatically with wp_insert_post() https://developer.wordpress.org/reference/functions/wp_insert_post/
You could create the sub-page when the page is created by running wp_insert_post() when the post is published, on hook in to some other event.
You can tie meta boxes to those pages by setting the “Template” variable in the comment block. You’ll need to make sure you add ‘page-attributes’ to the “supports” array when you setup the Custom Post type, and then create page templates to assign to those page types.
If you’re using front end forms for this, you’ll have to get creative about how to get the post ID into the query string so you’re updating the correct post.
One of the websites I maintain is a trade show site that has sponsors, exhibitors, and speakers associated with the shows, so I think I know what you’re going for. Best of Luck!
jrcreativeMemberah, I was using 9.4.x. I upgraded to 9.9.7 and all is well.
jrcreativeMemberTry resaving permalinks settings. Sometimes just clicking save will do it, or sometimes you have to choose another option and save, and then go back to the one you want.
jrcreativeMemberYour slug should be simply ‘events’ and not ‘/events/’. Other then that, it looks like you’re on the right track.
You’ll likely want to have a custom page template for displaying all of your custom post meta. I generally start with duplicating my theme’s
single.phpand renaming it with the post type appended to the end (per WordPress template hierarchy).single-piklist_event.phpwould be yours based on the code above.Once you create your first event, you can
print_r(get_post_meta(get_the_ID())in your new page template and start echoing out your fields as needed.
jrcreativeMemberAwesome! I didn’t realize that ‘attributes’ was open to any html attribute, I thought it was limited to some proprietary Piklist attributes.
jrcreativeMemberIt’ll be a javascript or AJAX solution if you want real time data-binding.
jrcreativeMemberWhat I have learned about Piklist is:
'scope' => 'post'will allow you to store core post fields like post_title, post_status, post_content…'scope' => 'post_meta'save to post meta, and can be whatever you want since they’re custom fieldsSame concept with
useranduser_meta.I’m not as familiar with the post to post relationships, though, so I’ll bow out of this one at this point… @steve?
jrcreativeMember
jrcreativeMemberIf I’m understanding correctly, the user scope can only hold the core user fields within WordPress.
Try
'scope' => 'user_meta'
jrcreativeMemberThat works globally, but it doesn’t allow you to change the price per post.
It seems like you’d want to do something like:
$price = get_post_meta(get_the_ID(), 'price', true) -
AuthorPosts