modX.checkForLocks
Last updated Oct 14th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodX::checkForLocks¶
Checks for locking on a page. A page is “locked” if another user is already viewing it.
Syntax¶
string|false checkForLocks (integer $id, string $action, string $type)
$id(integer) ID of the user checking for the lock; if empty or0, the current logged-in user is used$action(string) The action identifying what is locked$type(string) Message indicating the kind of lock being checked
Returns the translated lock_msg lexicon string (naming the user who holds the lock) if the page is locked, or false if it is not.
Example¶
Check for locks on the edit_chunk action.
$msg = $modx->checkForLocks($modx->getLoginUserID(), 'edit_chunk', 'edit');
if ($msg) {
echo $msg;
}
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










