<commit_before><?php

define("UPLOAD_PATH", ABSPATH . "wp-content/uploads/");
define("THEME_PATH", get_template_directory_uri());
define("THEME_ABSPATH", ABSPATH . "wp-content/themes/chalmersit/");
define("ASSET_PATH", THEME_PATH . "/assets");

define("EXCERPT_LENGTH", 75);

require_once "lib/constants.php";
require_once "lib/helpers.php";
require_once "lib/class.Comittee_Walker.php";
require_once "lib/class.Metabox.php";
require_once "lib/class.Options.php";
require_once "lib/inc.lunch.php";
require_once "partials/_comment.php";

load_all("initializers");


$host = $_SERVER['HTTP_HOST'];
$allowed_sites = array(
	"chalmers.dev",
	"localhost"
);
$env = (in_array($host, $allowed_sites) || (isset($_GET['dev']) && $_GET['dev'] == 1)) ? DEVELOPMENT : PRODUCTION;
define("ENV", $env);


/* SETUP */

add_action("after_setup_theme", "setup_chalmers");
if(! is_admin()) {
	add_action("wp_enqueue_scripts", "it_custom_scripts", 11);
}

function setup_chalmers() {
	add_theme_support("menus");
	add_theme_support("post-formats");
	add_theme_support("post-thumbnails", array("post", "page", "course"));
	add_theme_support("automatic-feed-links");

	# Buddypress
	# add_theme_support( 'buddypress' );

	add_action("init", "register_chalmers_metaboxes");
	add_action("init", "register_chalmers_menus");
	add_action("init", "register_chalmers_posttypes");
	add_action("init", "register_chalmers_taxonomies");
	add_action("init", "it_register_sidebars");
	add_action('init', 'remove_head_links');

	add_action("wp_footer", "attach_page_variables");

	add_filter( 'excerpt_length', 'jb_excerpt_length' );
	add_filter( 'get_the_excerpt', 'custom_excerpt' );
	add_filter( 'excerpt_more', 'read_more_link' );	
	
	add_filter( 'next_post_link', 'post_link_attributes');
	add_filter( 'previous_post_link', 'post_link_attributes');
	add_filter( 'next_posts_link_attributes', 'posts_link_attributes');
	add_filter( 'previous_posts_link_attributes', 'posts_link_attributes');<commit_msg>Only register metaboxes in admin<commit_after><?php

define("UPLOAD_PATH", ABSPATH . "wp-content/uploads/");
define("THEME_PATH", get_template_directory_uri());
define("THEME_ABSPATH", ABSPATH . "wp-content/themes/chalmersit/");
define("ASSET_PATH", THEME_PATH . "/assets");

define("EXCERPT_LENGTH", 75);

require_once "lib/constants.php";
require_once "lib/helpers.php";
require_once "lib/class.Comittee_Walker.php";
require_once "lib/class.Metabox.php";
require_once "lib/class.Options.php";
require_once "lib/inc.lunch.php";
require_once "partials/_comment.php";

load_all("initializers");


$host = $_SERVER['HTTP_HOST'];
$allowed_sites = array(
	"chalmers.dev",
	"localhost"
);
$env = (in_array($host, $allowed_sites) || (isset($_GET['dev']) && $_GET['dev'] == 1)) ? DEVELOPMENT : PRODUCTION;
define("ENV", $env);


/* SETUP */

add_action("after_setup_theme", "setup_chalmers");
if(! is_admin()) {
	add_action("wp_enqueue_scripts", "it_custom_scripts", 11);
}

function setup_chalmers() {
	add_theme_support("menus");
	add_theme_support("post-formats");
	add_theme_support("post-thumbnails", array("post", "page", "course"));
	add_theme_support("automatic-feed-links");

	# Buddypress
	# add_theme_support( 'buddypress' );

	add_action("init", "register_chalmers_menus");
	add_action("init", "register_chalmers_posttypes");
	add_action("init", "register_chalmers_taxonomies");
	add_action("init", "it_register_sidebars");
	add_action('init', 'remove_head_links');

	# Admin
	if(is_admin()) {
		add_action("init", "register_chalmers_metaboxes");
	}

	add_action("wp_footer", "attach_page_variables");

	add_filter( 'excerpt_length', 'jb_excerpt_length' );
	add_filter( 'get_the_excerpt', 'custom_excerpt' );
	add_filter( 'excerpt_more', 'read_more_link' );	
	
	add_filter( 'next_post_link', 'post_link_attributes');
	add_filter( 'previous_post_link', 'post_link_attributes');
	add_filter( 'next_posts_link_attributes', 'posts_link_attributes');
	add_filter( 'previous_posts_link_attributes', 'posts_link_attributes');
{'fraction_non_alphanumeric': 0.17246558197747183, 'fraction_numerical': 0.0025031289111389237, 'mean_word_length': 8.722627737226277, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '52420', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1440, 'n_words': 205}