/home/vianto5/heredit.mx/wp-content/plugins/elementor/modules/components
NameSizeModeActions
documents/-0755rm
overridable-props/-0755rm
prop-types/-0755rm
styles/-0755rm
transformers/-0755rm
utils/-0755rm
widgets/-0755rm
circular-dependency-validator.php46240644editdlrm
component-lock-manager.php36960644editdlrm
components-access-controller.php14230644editdlrm
components-repository.php59000644editdlrm
components-rest-api.php218810644editdlrm
document-lock-manager.php46050644editdlrm
module.php69830644editdlrm
non-atomic-widget-validator.php26520644editdlrm
overridable-schema-extender.php9270644editdlrm
save-components-validator.php24060644editdlrm
Edit: /home/vianto5/heredit.mx/wp-content/plugins/elementor/modules/components/component-lock-manager.php (3696B)
is_component_post( $post_id ) ) { return $response; } $lock_data = $this->get_lock_data( $post_id ); $user_id = get_current_user_id(); if ( $user_id === (int) $lock_data['locked_by'] ) { $this->extend_lock( $post_id ); } return $response; } /** * Unlock a component. * * @param int $post_id The component ID to unlock * @return bool True if unlock was successful, false otherwise * @throws \Exception If post is not a component type. */ public function unlock( $post_id ) { if ( ! $this->is_component_post( $post_id ) ) { throw new \Exception( 'Post is not a component type' ); } $lock_data = $this->get_lock_data( $post_id ); $current_user_id = get_current_user_id(); if ( $lock_data['locked_by'] && (int) $lock_data['locked_by'] !== (int) $current_user_id ) { return false; } return parent::unlock( $post_id ); } /** * Lock a component. * * @param int $post_id The component ID to lock * @return bool|null True if lock was successful, null if locked by another user, false otherwise * @throws \Exception If post is not a component type. */ public function lock( $post_id ) { if ( ! $this->is_component_post( $post_id ) ) { throw new \Exception( 'Post is not a component type' ); } $lock_data = $this->get_lock_data( $post_id ); $is_expired = $this->is_lock_expired( $post_id ); if ( $is_expired ) { parent::unlock( $post_id ); } elseif ( $lock_data['locked_by'] ) { return null; } return parent::lock( $post_id ); } /** * Get lock data for a component. * * @param int $post_id The component ID * @return array Lock data with 'locked_by' (int|null), 'locked_at' (int|null) * @throws \Exception If post is not a component type. */ public function get_lock_data( $post_id ) { if ( ! $this->is_component_post( $post_id ) ) { throw new \Exception( 'Post is not a component type' ); } return parent::get_lock_data( $post_id ); } /** * Extend the lock for a component. * * @param int $post_id The component ID * @return bool|null True if extended successfully, null if not locked or locked by another user * @throws \Exception If post is not a component type. */ public function extend_lock( $post_id ) { if ( ! $this->is_component_post( $post_id ) ) { throw new \Exception( 'Post is not a component type' ); } $lock_data = $this->get_lock_data( $post_id ); if ( ! $lock_data['locked_by'] ) { return null; } $current_user_id = get_current_user_id(); if ( (int) $lock_data['locked_by'] !== (int) $current_user_id ) { return null; } return parent::extend_lock( $post_id ); } private function is_component_post( $post_id ) { return get_post_type( $post_id ) === Component_Document::TYPE; } }