Yes, the code he provided is still present. If it wasn't then none of the elements would be working to define the Registration Title.
What is specifically wrong is when we had it working Registration titles looked like this:
[Test Ride] Registration – [test name 1] [11/03/2022]
Now it is providing titles like this:
[] Registration – [Kenny] [05/16/2023]
So the Ride page title is no longer passing. The Name field and the date field are working fine.
Here is the edit page for this form:
hidden link
The [wpv-post-id item="$current_page"] code is still present in the Ride Registration field that Luo had us set up (or set up for us).
Here is the ticket where he helped us so you can see everything that was done/discussed:
https://toolset.com/forums/topic/the-registration-title-field-could-be-automatically-generated-by-the-system/
Here is the registration-title custom code he provided:
---------------------------------------------------------------------
<?php
/**
* Snippet to create Registration title using fields to show Ride Name, Name and Date fields as title, ).
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
// Put the code of your snippet below this comment.
add_action('cred_save_data', function($post_id, $form_data) {
if ($form_data['id']==2083) { // speccific post form ID
$name = get_post_meta($post_id, 'wpcf-name', true);
$email = get_post_meta($post_id, 'wpcf-email', true);
$date = get_the_date('m/d/Y', $post_id);
$parent_ride_id = toolset_get_related_post($post_id, 'ride-registration', 'parent');
$parent_ride_title = get_the_title($parent_ride_id);
$post_title = sprintf('[%1$s] Registration - [%2$s] [%3$s]', $parent_ride_title, $name, $date);
$slug = sanitize_title($post_title);
wp_update_post(array(
'ID'=>$post_id,
'post_title'=>$post_title,
'post_name' => $slug
));
}
},10, 3);
---------------------------------------------------------------------
Something I've done between then and now has broken this on the [%1$s] and $parent_ride_title parts of this. But I have no idea what I might have done wrong to cause this. I've worked on so many different elements on this site after this functionality was working and anything could have done this. I didn't notice it was broken until now doing our final pre-launch testing with the full involvement of the club's board. I thought I still had this working because I don't think I messed with this code since it was working, but when they did their tests, I saw this problem.