Hello,
I recently contacted support with a question about creating a pedigree for a dog breeding operation.
The solutions proposed by support are completely unrealistic. They involve duplicating CPTs almost infinitely using a method that is completely unergonomic.
Is there really no other method than the one proposed to create a pedigree without having to multiply the CPTs exponentially or without having to include them in each dog's file (where everything would have to be re-entered manually)? Many thanks if you can find a better solution.
Michel
NB: I tried to submit this via the ‘Need to tell us something about the quality of support’ link, but there seems to be a problem with the captcha.
Hello,
I recently contacted support with a question about creating a pedigree for a dog breeding kennel.
The solutions proposed by support are completely unrealistic. They involve duplicating CPTs almost ad infinitum using a totally unsuitable method.
Is there really no other method than the one proposed to create a pedigree without exponentially multiplying the CPTs or including them in each dog's file (where everything would have to be re-entered manually)? Thank you very much if you can find a better solution.
Michel.
NB: I tried to submit this message via the ‘Need information about support quality’ link, but there seems to be a problem with the captcha.
The ticket in question is this one: https://toolset.com/forums/topic/genealogy/
Hello. Thank you for contacting the Toolset support.
I already shared the best option but if that does not suite your reuqirement.
Pleaes note that there is no self-join relationship possible using Toolset post-relationship. What I suggested is based on the requirement you had keeping in mind the post-relationship but if that is not your choice we can not do much.
However - I've another option but its not using post-relationship. You can add a select custom field to custom field group for father, mother, grandfather and grandmother. But please note that this is select field.
And you can auto-fill the options for this select field using the hook "wpt_field_options" hook.
For example:
add_filter( 'wpt_field_options', 'func_to_dynamically_populate_father_mother', 10, 3);
function func_to_dynamically_populate_father_mother( $options, $title, $type ){
switch( $title ){
case 'Dog Father':
case 'Dog Mother':
$options = array();
// add first empty value
$options[] = array('#value' => '', '#title' => $title );
// get all tmna-location post items
$args = array( 'post_type' => 'dog', 'posts_per_page' => -1, 'post_status' => 'publish','orderby' => 'title' );
$results = get_posts( $args );
if ( $results ) {
foreach ( $results as $post ) {
$options[] = array('#value' => $post->ID, '#title' => $post->post_title);
}
}
break;
}
return $options;
}
Where:
- Repalce the "Dog Father" and "Dog Mother" with your original custom field title for dog father and mother. Please change the "post_type" slug to actual one of you Dogs post type.