<commit_before><?php

function remove_head_links() {
	remove_action('wp_head', 'rsd_link');
	remove_action('wp_head', 'wp_generator');
	remove_action('wp_head', 'index_rel_link');
	remove_action('wp_head', 'wlwmanifest_link');
	remove_action('wp_head', 'start_post_rel_link', 10, 0);
	remove_action('wp_head', 'parent_post_rel_link', 10, 0);
	remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
}

function chalmers_redirect_login() {
	global $pagenow;
	if( 'wp-login.php' == $pagenow ) {
		wp_redirect(link_to("login", false));
		exit();
	}
}

/**
*	Use the actual short URL in shortlinks.
*
*/
function my_shortlink( $link, $shortlink, $text, $title ){
	return $shortlink;
}

/**
*	Highlight the news page in main nav if user is viewing
*	a single post or an archive page.
*/
function add_current_class_to_single($classes, $item) {
	global $post;

	if(is_front_page()) return;

	$nav_object = get_page($item->object_id);

	if($nav_object->post_name == "nyheter" && 
		(get_post_type($post) == "post" || is_post_type_archive("post") ) ) {

		$classes[] = "current_page_item";
	}
	else if($nav_object->post_name == "kurser" && 
		(is_post_type_archive("course") )) {

		$classes[] = "current_page_item";	
	}

	return (array)$classes;
}

/**
*	Add attributes to the HTML generated by next_post_link/previous_post_link
*/
function post_link_attributes($link) {
	return preg_replace('/(<a\b[^><]*)>/i', '$1 class="btn">', $link);
}

function posts_link_attributes($url){
	return 'class="btn"';
}


/**
*	Adds the current browser as a class to the body tag. Handy for styling.
*
*/
function browser_body_class($classes) {
	global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_safari, $is_chrome, $is_iphone, $post;

	$is_win = stripos($_SERVER["HTTP_USER_AGENT"], "windows");
	
	if($is_lynx) $classes[] = 'lynx';
	elseif($is_gecko) $classes[] = 'gecko';
	elseif($is_opera) $classes[] = 'opera';
	elseif($is_safari) $classes[] = 'safari';
	elseif($is_chrome) $classes[] = 'chrome';
	elseif($is_IE) $classes[] = 'ie';
	else $classes[] = 'unknown';<commit_msg>Fix fucking join error<commit_after><?php

function remove_head_links() {
	remove_action('wp_head', 'rsd_link');
	remove_action('wp_head', 'wp_generator');
	remove_action('wp_head', 'index_rel_link');
	remove_action('wp_head', 'wlwmanifest_link');
	remove_action('wp_head', 'start_post_rel_link', 10, 0);
	remove_action('wp_head', 'parent_post_rel_link', 10, 0);
	remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
}

function chalmers_redirect_login() {
	global $pagenow;
	if( 'wp-login.php' == $pagenow ) {
		wp_redirect(link_to("login", false));
		exit();
	}
}

/**
*	Use the actual short URL in shortlinks.
*
*/
function my_shortlink( $link, $shortlink, $text, $title ){
	return $shortlink;
}

/**
*	Highlight the news page in main nav if user is viewing
*	a single post or an archive page.
*/
function add_current_class_to_single($classes, $item) {
	global $post;

	if(!is_front_page()) {
		$nav_object = get_page($item->object_id);

		if($nav_object->post_name == "nyheter" && 
			(get_post_type($post) == "post" || is_post_type_archive("post") ) ) {

			$classes[] = "current_page_item";
		}
		else if($nav_object->post_name == "kurser" && 
			(is_post_type_archive("course") )) {

			$classes[] = "current_page_item";	
		}
	}
	return $classes;
}

/**
*	Add attributes to the HTML generated by next_post_link/previous_post_link
*/
function post_link_attributes($link) {
	return preg_replace('/(<a\b[^><]*)>/i', '$1 class="btn">', $link);
}

function posts_link_attributes($url){
	return 'class="btn"';
}


/**
*	Adds the current browser as a class to the body tag. Handy for styling.
*
*/
function browser_body_class($classes) {
	global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_safari, $is_chrome, $is_iphone, $post;

	$is_win = stripos($_SERVER["HTTP_USER_AGENT"], "windows");
	
	if($is_lynx) $classes[] = 'lynx';
	elseif($is_gecko) $classes[] = 'gecko';
	elseif($is_opera) $classes[] = 'opera';
	elseif($is_safari) $classes[] = 'safari';
	elseif($is_chrome) $classes[] = 'chrome';
	elseif($is_IE) $classes[] = 'ie';
	else $classes[] = 'unknown';
{'fraction_non_alphanumeric': 0.18181818181818182, 'fraction_numerical': 0.0048484848484848485, 'mean_word_length': 5.842454394693201, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7183456', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1573, 'n_words': 317}