создать «предупреждение», когда пользователи «редактируют элементы или элементы» - PullRequest
0 голосов
/ 15 апреля 2019

Я пытаюсь использовать плагин ' WP Security Audit log ', чтобы также разрешать 'оповещения' или 'ведение журнала', когда вошли в систему пользователей edit elements через Elementor .

Шаблон настраиваемого события в журнале аудита безопасности WP выглядит следующим образом.

$custom_alerts = array(
    __('Third Party Support', 'wp-security-audit-log') => array(
        __('Custom Alerts', 'wp-security-audit-log') => array(
            array(2222, E_CRITICAL, __('Custom critical Alert', 'wp-security-audit-log'), __('%CustomAlertText%', 'wp-security-audit-log')),
            array(3333, E_WARNING, __('Custom warning Alert', 'wp-security-audit-log'), __('%CustomAlertText%', 'wp-security-audit-log')),
            array(4444, E_NOTICE, __('Custom notice Alert', 'wp-security-audit-log'), __('%CustomAlertText%', 'wp-security-audit-log'))
        )
    )
);

Я нашел следующий совет в документации Elementor; но похоже, что он может применяться к другому плагину регистрации.

add_action( 'elementor/editor/after_save', function( $post_id, $editor_data ) {
    // Activity Log Plugin
    aal_insert_log(
        [
            'action' => 'saved',
            'object_type' => 'Elementor Data',
            'object_id' => $post_id,
            'object_name' => get_the_title( $post_id ),
        ]
    );
}

думаете, это возможно?

...