Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Adding signature with post from form content

@robin-w

Moderator

untested, but possibly

function add_signature_to_post($topic_id=0) {
$content = get_post_field( 'post_content', $topic_id );
$signature = '';

if (isset($_POST) && $_POST['bbp_signature']!='')
$signature = $_POST['bbp_signature'];

$content = $content . $signature;

$topic_data = array(
		'ID'           => $topic_id,
		'post_content'   => $content
		);

	// update topic
	$topic_id = wp_update_post( $topic_data);
}

add_action('bbp_new_topic', 'add_signature_to_post', 10, 1);
add_action('bbp_new_reply', 'add_signature_to_post', 10, 1);
Skip to toolbar