SimpleHistory::settings_field_clear_log PHP Method

settings_field_clear_log() public method

Settings section to clear database
    function settings_field_clear_log()
    {
        $clear_link = esc_url(add_query_arg("", ""));
        $clear_link = wp_nonce_url($clear_link, "simple_history_clear_log", "simple_history_clear_log_nonce");
        $clear_days = $this->get_clear_history_interval();
        echo "<p>";
        if ($clear_days > 0) {
            echo sprintf(__('Items in the database are automatically removed after %1$s days.', "simple-history"), $clear_days);
        } else {
            _e('Items in the database are kept forever.', 'simple-history');
        }
        echo "</p>";
        printf('<p><a class="button js-SimpleHistory-Settings-ClearLog" href="%2$s">%1$s</a></p>', __('Clear log now', 'simple-history'), $clear_link);
    }
SimpleHistory