Skip to content

Instantly share code, notes, and snippets.

@svenl77
Last active March 23, 2020 12:56
Show Gist options
  • Save svenl77/145756e476b23202646675f6e625e9bc to your computer and use it in GitHub Desktop.
Save svenl77/145756e476b23202646675f6e625e9bc to your computer and use it in GitHub Desktop.
This is an example function on how to add any kind of value to the title. In this case we use the post id
<?php
add_filter( 'buddyforms_update_form_title', 'buddyforms_add_id_to_subject', 9999 , 3 );
function buddyforms_add_id_to_subject( $default_post_title, $form_slug, $post_id ){
if($form_slug != 'simple-post-form'){
return $default_post_title;
}
return $default_post_title . '-' . $post_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment