| 1 |
<?php |
| 2 |
|
| 3 |
namespace StoreEngine\Classes; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
abstract class AbstractPostHandler extends AbstractRequestHandler { |
| 10 |
|
| 11 |
public function dispatch_actions() { |
| 12 |
foreach ( $this->actions as $action => $details ) { |
| 13 |
add_action( 'admin_post_' . $this->namespace . '/' . $action, [ $this, 'handle_request' ] ); |
| 14 |
if ( isset( $details['allow_visitor_action'] ) && true === $details['allow_visitor_action'] ) { |
| 15 |
add_action( 'admin_post_nopriv_' . $this->namespace . '/' . $action, [ $this, 'handle_request' ] ); |
| 16 |
} |
| 17 |
} |
| 18 |
} |
| 19 |
} |
| 20 |
|