if (performance.navigation.type === performance.navigation.TYPE_BACK_FORWARD) { window.location.reload(); } '; global $wpdb; $current_user_id = get_current_user_id(); $current_year = date('Y'); $confidentiality_option = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "sige_confidentiality_user_option WHERE user_id = %d AND year = %d", $current_user_id, $current_year ) ); $output = ""; if (!$confidentiality_option) { $confidentiality_message = $wpdb->get_var($wpdb->prepare(" SELECT message FROM {$wpdb->prefix}sige_confidentiality_message WHERE information_type = %s ", 'Sharing Information')); $output .= ' '; } return $output; } add_shortcode('data_sharing', 'dataSharing'); function retrieve_data_sponsors() { // Disable cache for all users nocache_headers(); // Append nocache query parameter to bust cache if (!isset($_GET['nocache'])) { $new_url = add_query_arg('nocache', time(), get_permalink()); wp_redirect($new_url); exit(); } // Prevent back/forward navigation cache $output = ''; global $wpdb; $current_year = date('Y'); $query = $wpdb->prepare( " SELECT DISTINCT u.user_login, um.meta_value as full_name FROM {$wpdb->prefix}sige_confidentiality_user_option co JOIN {$wpdb->prefix}users u ON co.user_id = u.ID JOIN {$wpdb->prefix}usermeta um ON u.ID = um.user_id AND um.meta_key = 'full_name' WHERE co.sharing_information = %s AND co.year = %d ORDER BY full_name", 'yes ', $current_year ); $results = $wpdb->get_results($query); // Add CSS styles echo ''; // Display the data table echo ''; return ob_get_clean(); } add_shortcode('sponsor_data', 'retrieve_data_sponsors');