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 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?
We're working hard to ensure we provide you with useful and relevant documentation to help you get the most out of KB Support.
Please take a moment to let us know if you found this article helpful.