Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 6.28 |
Changes | 0 |
1 | <?php |
||
15 | 1 | public function saveAssignedToMetabox( $postId ) |
|
16 | { |
||
17 | 1 | if( !wp_verify_nonce( glsr( Helper::class )->filterInput( '_nonce-assigned-to' ), 'assigned_to' ))return; |
|
18 | $assignedTo = strval( glsr( Helper::class )->filterInput( 'assigned_to' )); |
||
19 | if( get_post_meta( $postId, 'assigned_to', true ) != $assignedTo ) { |
||
20 | $review = glsr( ReviewManager::class )->single( get_post( $postId )); |
||
21 | glsr( CountsManager::class )->decreasePostCounts( $review ); |
||
22 | } |
||
23 | update_post_meta( $postId, 'assigned_to', $assignedTo ); |
||
24 | } |
||
41 |