WordPress locks posts whenever they are accessed in order to prevent multiple users from accessing and modifying the post at the same time.

This can be a hindrance to a support organisation and therefore, sometimes, it is necessary to enable multiple people to access and work on a ticket at the same time.

Post Lock

Remove the Post Lock from Tickets

With KB Support, by default, we do not adjust the WordPress post lock feature, however, we have built in functionality for you to easily override this configuration with a single line of code.

Place the following into your functions.php file, or into a custom plugin, to allow multiple agents to view and edit a support ticket simultaneously.

/**
 * Disable the WordPress post lock from tickets
 * to enable multiple support workers to view and
 * edit a ticket at the same time.
 */
add_filter( 'kbs_disable_ticket_post_lock', '__return_true' );

Remove the Post Lock for Support Managers Only

Whilst a single line of code can remove the post lock for everyone, with slightly more advanced coding, it is possible to remove the post lock in certain conditions only.

The following example will remove the post lock for users with the Support Manager role only…

/**
 * Disable the WordPress post lock from tickets
 * to enable support managers to view and
 * edit a ticket at the same time as agents.
 *
 * @param	bool	$remove		True to disable, or false
 * @return	bool
 */
function kbs_example_remove_post_lock_for_managers( $remove )	{

	$current_user = wp_get_current_user();
	$user_roles   = $current_user->roles;
 
	if ( in_array( 'support_manager', $user_roles ) )	{
		$remove = true;
	}

	return $remove;
}
add_filter( 'kbs_disable_ticket_post_lock', 'kbs_example_disable_post_lock_for_managers' );

Was this article helpful?

Removing Post Lock from Tickets

WordPress locks posts whenever they are accessed in order to prevent multiple users from accessing and modifying the post at the same time. This can be a hindrance to a support organisation and therefore, sometimes, it is necessary to enable multiple people to access and work on a ticket at the same time. Remove the Post…
KB Article rating: 4.0 based on 1 ratings
KBS is now a LOGON product. For new and existing support requests, please send us an email.
If you have an open support ticket, please email us directly to follow up.
This is default text for notification bar