| Conditions | 4 |
| Paths | 4 |
| Total Lines | 36 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace EmailLog\Core\Request; |
||
| 28 | public function check_nonce() { |
||
| 29 | if ( ! isset( $_POST['el-action'] ) ) { |
||
| 30 | return; |
||
| 31 | } |
||
| 32 | |||
| 33 | $action = sanitize_text_field( $_POST['el-action'] ); |
||
| 34 | |||
| 35 | if ( ! isset( $_POST[ $action . '_nonce' ] ) ) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ( ! wp_verify_nonce( $_POST[ $action . '_nonce' ], $action ) ) { |
||
| 40 | return; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Perform `el` action. |
||
| 45 | * Nonce check has already happened at this point. |
||
| 46 | * |
||
| 47 | * @since 2.0 |
||
| 48 | * |
||
| 49 | * @param string $action Action name. |
||
| 50 | * @param array $_POST Request data. |
||
| 51 | */ |
||
| 52 | do_action( 'el_action', $action, $_POST ); |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Perform `el` action. |
||
| 56 | * Nonce check has already happened at this point. |
||
| 57 | * |
||
| 58 | * @since 2.0 |
||
| 59 | * |
||
| 60 | * @param array $_POST Request data. |
||
| 61 | */ |
||
| 62 | do_action( $action, $_POST ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |