%s', __( 'Email Reporting', 'post-smtp' ) ); return $tabs; } /** * Sanitize the Settings | Filter Callback * * @since 2.9.0 * @version 1.0.0 */ public function sanitize( $input, $option, $section ) { $data = array(); if ( isset( $_POST['_EmailReportingNounce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_EmailReportingNounce'] ) ), '_Reporting' ) ) { // Do not save the settings if it's not saving from settings page. if ( isset( $_POST['action'] ) && $_POST['action'] !== 'ps-save-wizard' ) { $data['enable_email_reporting'] = isset( $_POST['enable_email_reporting'] ) ? 1 : 0; $data['reporting_interval'] = isset( $_POST['reporting_interval'] ) ? sanitize_text_field( wp_unslash( $_POST['reporting_interval'] ) ) : 'w'; update_option( 'postman_rat', $data ); } } return $input; } /** * Section to Display Fields | Actoin Callback * * @since 2.9.0 * @version 1.0.0 */ public function section() { $data = get_option( 'postman_rat' ); $checked = ( isset( $data['enable_email_reporting'] ) && $data['enable_email_reporting'] === 1 ) ? 'checked' : ''; $selected_interval = ( isset( $data['reporting_interval'] ) ) ? $data['reporting_interval'] : 'w'; $selection = array( 'd' => __( 'Daily', 'post-smtp' ), 'w' => __( 'Weekly', 'post-smtp' ), 'm' => __( 'Monthly', 'post-smtp' ), ); ?>