'attendance_check', 'defaults' => array( 'one' => array( 'creds' => 50, 'log' => '%plural% for attendance check only one day' ), 'ten' => array( 'creds' => 100, 'log' => '%plural% for attendance check for ten day' ), 'month' => array( 'creds' => 500, 'log' => '%plural% for attendance check for one month' ) ) ), $hook_prefs, $type); } public function run() { add_action( 'pac_after_attendance_check', array( $this, 'attendance_check' ), 100, 2 ); } public function attendance_check( $user_id, $event_type ) { if ( $this->core->exclude_user( $user_id ) ) return; $this->core->add_creds( 'attendance_check', $user_id, $this->prefs[$event_type]['creds'], $this->prefs[$event_type]['log'], 0, '' ); } public function preferences() { $prefs = $this->prefs; ?>
defaults['one']['creds']; $new_data['one']['log'] = ( !empty($data['one']['log']) ) ? sanitize_text_field( $data['one']['log'] ) : $this->defaults['one']['log']; $new_data['ten']['creds'] = ( !empty( $data['ten']['creds'] ) ) ? $data['ten']['creds'] : $this->defaults['ten']['creds']; $new_data['ten']['log'] = ( !empty($data['ten']['log']) ) ? sanitize_text_field( $data['ten']['log'] ) : $this->defaults['ten']['log']; $new_data['month']['creds'] = ( !empty( $data['month']['creds'] ) ) ? $data['month']['creds'] : $this->defaults['month']['creds']; $new_data['month']['log'] = ( !empty($data['month']['log']) ) ? sanitize_text_field( $data['month']['log'] ) : $this->defaults['month']['log']; return $new_data; } }