Noptin_Ajax::save_rule()
Saves rules
Source Source
File: includes/class-noptin-ajax.php
public function save_rule() { if ( ! current_user_can( get_noptin_capability() ) ) { wp_die( -1, 403 ); } // Check nonce. check_ajax_referer( 'noptin_automation_rules' ); /** * Runs before saving rules */ do_action( 'noptin_before_save_automation_rule' ); // Prepare the rule. $trigger_settings = array(); if ( ! empty( $_POST['trigger_settings'] ) ) { $trigger_settings = stripslashes_deep( $_POST['trigger_settings'] ); } $action_settings = array(); if ( ! empty( $_POST['action_settings'] ) ) { $action_settings = stripslashes_deep( $_POST['action_settings'] ); } // Save them. noptin()->automation_rules->update_rule( $_POST['id'], compact( 'action_settings', 'trigger_settings' ) ); wp_send_json_success( 1 ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.3.0 | Introduced. |