Skip to content

Instantly share code, notes, and snippets.

@svenl77
Created October 21, 2022 08:33
Show Gist options
  • Save svenl77/bce8692903b24149fb5ef04f9f7801b3 to your computer and use it in GitHub Desktop.
Save svenl77/bce8692903b24149fb5ef04f9f7801b3 to your computer and use it in GitHub Desktop.
buddyforms_update_form_title
<?php
add_filter( 'buddyforms_update_form_title', 'buddyforms_update_form_title_user_id',9999, 3 );
function buddyforms_update_form_title_user_id( $post_title, $form_slug, $post_id ) {
$post_title = str_replace('[post_id]', $post_id, $post_title);
// in here
$post = get_post($post_id);
$author_id = $post->post_author;
$post_title = str_replace('[author_id]', $author_id, $post_title);
return $post_title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment