ID); $these_roles = $user->roles; $tc = new AIO_Time_Clock_Lite_Actions(); if (function_exists('is_plugin_active')) { if (is_plugin_active('aio-timeclock-google-analytics/aio-timeclock-google-analytics.php')) { aio_google_show_code(); } } //load options $widgettitle = get_option('aio_tc_lite_widgettitle'); //widget output echo esc_attr($args['before_widget']); echo esc_attr($args['before_title']); echo esc_attr($widgettitle); echo esc_attr($args['after_title']); echo ''; echo '
'; if (is_user_logged_in()) { if ($tc->checkPermission($these_roles)) { $this->getTimeClockWidget(); } else { echo '

' . esc_attr_x('Your user group does not have permission to view the Time Clock.', 'aio-time-clock', 'aio-time-clock-lite') . '

'; } } else { echo '

' . esc_attr_x('Time Clock is only available for users that are logged in', 'aio-time-clock', 'aio-time-clock-lite') . '

'; echo '' . esc_attr_x('Login', 'aio-time-clock', 'aio-time-clock-lite') . ''; } echo '
'; echo ''; //close div.textwidget echo esc_attr($args['after_widget']); } public function update($new_instance, $old_instance) { // Save widget options // Output admin widget options form if (isset($_POST['aio_widget_submitted'])) { update_option('aio_time_clock_lite_widget_title', santize_text_field($_POST['aio_tc_lite_widgettitle'])); } } public function form($instance) { $widgettitle = sanitize_text_field(get_option('aio_time_clock_lite_widget_title')); ?>
: