| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Mcp\Abilities; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
abstract class Abstract_Ability { |
| 10 |
|
| 11 |
abstract protected function get_ability_id(): string; |
| 12 |
|
| 13 |
abstract protected function get_definition(): Ability_Definition; |
| 14 |
|
| 15 |
abstract public function execute( $input = [] ); |
| 16 |
|
| 17 |
public function register(): void { |
| 18 |
$definition = $this->get_definition()->to_array(); |
| 19 |
$definition['execute_callback'] = [ $this, 'execute' ]; |
| 20 |
wp_register_ability( $this->get_ability_id(), $definition ); |
| 21 |
} |
| 22 |
} |
| 23 |
|