Forum Replies Created
-
AuthorPosts
-
StephenParticipant@sbruner – thanks, I will check it out when I get a chance. For the problem above, I ended up having to custom code my own backend ajax related post system, the only parts of piklist in use for that are the postmeta “__relate_post” meta key and the query parameter “post_belongs”, but that should allow me (when all of that is working) to hopefully swap it out. I will let you know what I find.
StephenParticipantQuestion for Steve: does the code currently up at github fix these problems? I have been combing through it and see reference in a comment to “Handle relate groups”
StephenParticipantThank you!
StephenParticipantHere is what I have tried/noticed so far. The following code is only a slight change from the demo, but it works/fails in the following ways:
- I can relate posts from my CPT “action”, and they will show with the edit box and meta data field.
- I can update the regular POST fields like Title and content
- I CAN NOT update the associated meta data field (expiration_date). When changed it reverts back to whatever the separate CPT holds.
- Changing expiration_date to have a scope of post_meta links it to the parent instead of the child.
- Changing scope to the name of my CPT (‘action’) results in nothing working, just blank fields not attached to anything.
- I also notice that clicking “save” while in the parent will unfortunately publish instead (I suspect due to the presence on the child post of hidden field with post status of publish, but clearly it should only update the child status, not the parent)
piklist('field', array( 'type' => 'checkbox' ,'field' => '_' . piklist::$prefix . 'relate_post' ,'label' => __('Relate Posts', 'my-domain') ,'choices' => piklist( get_posts(array( 'post_type' => 'action' ,'numberposts' => -1 ,'orderby' => 'title' ,'order' => 'ASC' )) ,array('ID', 'post_title') ) ,'relate' => array( 'scope' => 'post' ) )); $related = get_posts(array( 'post_type' => 'action' ,'posts_per_page' => -1 ,'post_belongs' => $post->ID ,'post_status' => 'publish' ,'suppress_filters' => false )); piklist('field', array( 'type' => 'group' ,'scope' => 'post' ,'label' => 'Related Posts' ,'relate' => array( 'scope' => 'post' ) ,'add_more'=> true ,'fields' => array( array( 'type' => 'datepicker' ,'field' => 'expiration_date' ,'required' => true ,'label' => __('Expiration Date', 'my-domain') ,'help' => __('Choose an expiration date for this item.', 'my-domain') ,'options' => array( 'dateFormat' => 'yy-mm-dd' ) ,'attributes' => array( 'size' => 17 ) ) ,array( 'type' => 'text' ,'field' => 'post_title' ,'label' => 'Post Title' ,'columns' => 12 ) ,array( 'type' => 'textarea' ,'field' => 'post_content' ,'label' => 'Post Content' ,'columns' => 12 ,'attributes' => array( 'rows' => 5 ) ) ,array( 'type' => 'hidden' ,'field' => 'post_status' ,'value' => 'publish' ) ) ));Anyone?
April 6, 2017 at 1:04 am in reply to: latest piklist broke out of order post_content field in CPT #7914
StephenParticipant@sbruner – You are very welcome. Any chance you could give me a little advice on this issue? It is killing me.
Thanks!
StephenParticipantHas anyone done something like this? Does anyone have any example code?
StephenParticipantI found something in the demo that gets at this idea: /parts/meta-boxes/field-relationship.php
BUT, I can’t figure out how to add post-meta data to the related post. It will save the title and content shown in the demo, but every time I try to add another field there (for meta-data of the related post) it fails to save into the related post. Is this even possible?
April 4, 2017 at 1:56 am in reply to: latest piklist broke out of order post_content field in CPT #7900
StephenParticipantI just traced it to this line in class-piklist-form.php:
if (!is_wp_error($object) && is_object($object) && $allowed && is_array($object->$field))Changing it back to the previous:
if (!is_wp_error($object) && is_object($object) && $allowed)Fixes it. Any ideas why this is happening?
April 4, 2017 at 1:52 am in reply to: latest piklist broke out of order post_content field in CPT #7899
StephenParticipantI just verified that although this field is showing blank in the admin, it will save whatever value is typed into it. But then of course no one can edit the content because it won’t display after saving.
StephenParticipantI just realized that this is not caused by the helpers plugin, but rather by the piklist plugin update.
March 27, 2017 at 5:08 pm in reply to: Error in saving taxonomy from front-end form for custom post type #7861
StephenParticipantI finally wrote my own (not super elegant, but it works for me) workaround, which you can read about here:
hope this helps.
StephenParticipantPRETTY PLEASE?
StephenParticipantWell, I found a workaround for this:
add_action( 'init', 'my_custom_rest_support', 25 ); function my_custom_rest_support() { register_rest_field( 'my-cpt','long_description', array( 'get_callback' => 'get_long_desc', 'update_callback' => '', 'schema' => post ) ); function get_long_desc( $post_id ) { global $post; $post_content = get_post(get_the_ID()); $content = $post_content->post_content; return $content; } }So even though this is not showing twice in the admin, I can nevertheless add the field to the json REST response. Hope this helps someone else out…
StephenParticipantHi Again. In the absence of any info about next release, is there at least a source repo we could look at for what has already been changed, and make the comparisons ourselves? It would be very helpful to at least get a sense of changes already made. Or if I am understanding the license for the software, would it make sense to fork it on a public github server so that others could contribute and make changes? I’m sorry to pester about this, but I have built a rather complicated project on top of it, and before deciding whether to continue using Piklist (on this and other projects) I need to get a sense if this product is EOL or in active development. I would be happy to pay a small fee for the product, and maybe you could put a donation button on your site to fund further development, I am sure many people would be happy to pay if it assured the product was moving forward. Anyway, thanks for listening.
StephenParticipantanyone?
-
AuthorPosts