bbp_update_reply_revision_log( array $args = array() )

Update the revision log of the reply


Description Description


Parameters Parameters

$args

(Optional) Supports these args: - reply_id: reply id - author_id: Author id - reason: Reason for editing - revision_id: Revision id

Default value: array()


Top ↑

Return Return

(mixed) False on failure, true on success


Top ↑

Source Source

File: includes/replies/functions.php

function bbp_update_reply_revision_log( $args = array() ) {

	// Parse arguments against default values
	$r = bbp_parse_args( $args, array(
		'reason'      => '',
		'reply_id'    => 0,
		'author_id'   => 0,
		'revision_id' => 0
	), 'update_reply_revision_log' );

	// Populate the variables
	$r['reason']      = bbp_format_revision_reason( $r['reason'] );
	$r['reply_id']    = bbp_get_reply_id( $r['reply_id'] );
	$r['author_id']   = bbp_get_user_id ( $r['author_id'], false, true );
	$r['revision_id'] = (int) $r['revision_id'];

	// Get the logs and append the new one to those
	$revision_log                      = bbp_get_reply_raw_revision_log( $r['reply_id'] );
	$revision_log[ $r['revision_id'] ] = array( 'author' => $r['author_id'], 'reason' => $r['reason'] );

	// Finally, update
	update_post_meta( $r['reply_id'], '_bbp_revision_log', $revision_log );

	// Filter & return
	return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $r['reply_id'] );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.