| 1 |
<?php |
| 2 |
/** |
| 3 |
* Log Action |
| 4 |
* |
| 5 |
* @package WPbot_Automator |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WPbot_Automator\Actions; |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* Class Log |
| 16 |
*/ |
| 17 |
class Log extends Action { |
| 18 |
|
| 19 |
/** |
| 20 |
* Constructor |
| 21 |
*/ |
| 22 |
public function __construct() { |
| 23 |
$this->id = 'log'; |
| 24 |
$this->group = __( 'Utility', 'wpbot-automator' ); |
| 25 |
$this->title = __( 'Log Message', 'wpbot-automator' ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Execute the action |
| 30 |
*/ |
| 31 |
public function execute( $action_config, $trigger_data ) { |
| 32 |
$message = isset( $action_config['message'] ) ? $action_config['message'] : 'Logged via automation'; |
| 33 |
|
| 34 |
// In a real scenario, this would write to our custom logs table. |
| 35 |
//error_log( 'WPBOT-AUTOMATOR: ' . $message ); |
| 36 |
|
| 37 |
return true; |
| 38 |
} |
| 39 |
} |
| 40 |
|