Post relation NOT recorded
-
Hello Steve,
First of all thanks for this great flexible and powerful plugin. I am very happy with it!
I have an issue regarding post relations.
This code (source: https://piklist.com/user-guide/docs/fields/post-post-relationships/) works OK – it DOES record the post relation:
piklist('field', array( 'type' => 'post-relate' ,'scope' => 'post' ,'template' => 'field' ));
However, this code (source: piklist.0.9.9.9\piklist\add-ons\piklist-demos\parts\meta-boxes\field-relate.php) does NOT work OK (for me) – it does NOT record the post relation:
piklist('field', array( 'type' => 'checkbox' ,'field' => '_' . piklist::$prefix . 'relate_post' ,'label' => __('Relate Posts', 'piklist-demo') ,'choices' => piklist( get_posts(array( 'post_type' => 'post' ,'numberposts' => -1 ,'orderby' => 'title' ,'order' => 'ASC' )) ,array('ID', 'post_title') ) ,'relate' => array( 'scope' => 'post' ) ));
I suspect it has someting to do with
,'field' => '_' . piklist::$prefix . 'relate_post'
. And, more specifically withpiklist::$prefix
.My specific code – that does NOT record the post relation:
piklist('field', array( 'type' => 'checkbox' ,'field' => '_' . piklist::$prefix . 'relate_post' ,'label' => __('Relate Posts', 'piklist-demo') ,'choices' => piklist( get_posts(array( 'post_type' => 'ventizo_hypothesis' ,'numberposts' => -1 ,'orderby' => 'title' ,'order' => 'ASC' )) ,array('ID', 'post_title') ) ,'relate' => array( 'scope' => 'ventizo_hypothesis' ) ));
Please your help. Thanks and regards, Henk
- The topic ‘Post relation NOT recorded’ is closed to new replies.