<commit_before><?php

///////////////////////////////////
// Translations can be filed in the /languages/ directory
///////////////////////////////////

load_theme_textdomain( 'socialbase', TEMPLATEPATH . '/languages' );

$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable($locale_file) )
	require_once($locale_file);

///////////////////////////////////
// Add RSS links to <head> section
///////////////////////////////////

add_theme_support('automatic-feed-links');

//////////////////////////////////
// Add custom nav menu location
//////////////////////////////////

//set nav menus
//add other nav menu locations as needed
function register_my_menus() {
	register_nav_menus(
		array(
			'primary' => __('Primary Nav')
		)
	);
}

//run this on init action
add_action('init','register_my_menus');

///////////////////////////////////
// Remove Attachment link
///////////////////////////////////

function remove_media_link( $form_fields, $post ) {
	unset( $form_fields['url'] );
	return $form_fields;
}

add_filter( 'attachment_fields_to_edit', 'remove_media_link', 10, 2 );

///////////////////////////////////
// Load jQuery (must be /_/js/jquery.min.js)
///////////////////////////////////

if ( !is_admin() ) {
	/*---------------------------------------------------------------------------------------------

		This snippet loads jQuery via Google, but falls back to a locally hosted copy
		if necessary.

		It was modified from:

		http://wpshock.com/wordpress-load-jquery-from-google-libraries-cdn-with-local-jquery-fallback/

		There have been adjustments to make the code better suited for our purposes and also some
		formatting adjustments to make the code follow our style guidelines.

	---------------------------------------------------------------------------------------------*/

	// jQuery via Google CDN With Local Fall Back
	$v = '1.8.1'; //you should update this to the most recent version of jQuery
	// the URL to check against
	$url = 'http://ajax.googleapis.com/ajax/libs/jquery/' . $v . '/jquery.min.js';
	// test parameters
	$test_url = @fopen($url,'r');
	// test if the URL exists
	if($test_url !== false) {
		// deregisters the default WordPress jQuery
		wp_deregister_script( 'jquery' );
		// register the external file
		wp_register_script('jquery', $url, '', $v, true);
		// enqueue the external file
		wp_enqueue_script('jquery');
	} else {
		// enqueue the local file
		wp_deregister_script("jquery");
		// register the external file
		wp_register_script("jquery",get_template_directory() . '/_/js/jquery.min.js', '', $v, true);
		// enqueue the external file
		wp_enqueue_script('jquery');
	}
	// END wpshock.com modified code
}

///////////////////////////////////
// Hide Admin Bar
///////////////////////////////////

/*---------------------------------------------------------------------------------------------

	This snippet hides the admin bar entirely and removes the 28px of space at the top of
	the screen when the admin bar is missing

	It was modified from:

	http://wp.tutsplus.com/tutorials/how-to-disable-the-admin-bar-in-wordpress-3-3/

	There have been adjustments to format the code to follow our style guidelines.

---------------------------------------------------------------------------------------------*/

if(!function_exists('disableAdminBar')) {
	function disableAdminBar() {
		// for the admin page
		remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
		// for the front end
		remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );

		// css override for the admin page
		function remove_admin_bar_style_backend() {
			echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
		}
		add_filter('admin_head', 'remove_admin_bar_style_backend');<commit_msg>updated functions.php<commit_after><?php

///////////////////////////////////
// Translations can be filed in the /languages/ directory
///////////////////////////////////

load_theme_textdomain( 'socialbase', TEMPLATEPATH . '/languages' );

$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable($locale_file) )
	require_once($locale_file);

///////////////////////////////////
// Add RSS links to <head> section
///////////////////////////////////

add_theme_support('automatic-feed-links');

//////////////////////////////////
// Add custom nav menu location
//////////////////////////////////

//set nav menus
//add other nav menu locations as needed
function register_my_menus() {
	register_nav_menus(
		array(
			'primary' => __('Primary Nav')
		)
	);
}

//run this on init action
add_action('init','register_my_menus');

///////////////////////////////////
// Remove Attachment link
///////////////////////////////////

function remove_media_link( $form_fields, $post ) {
	unset( $form_fields['url'] );
	return $form_fields;
}

add_filter( 'attachment_fields_to_edit', 'remove_media_link', 10, 2 );

///////////////////////////////////
// Load jQuery (must be /_/js/jquery.min.js)
///////////////////////////////////

function add_scripts_styles() {
	if ( !is_admin() ) {
		/*---------------------------------------------------------------------------------------------

			This snippet loads jQuery via Google, but falls back to a locally hosted copy
			if necessary.

			It was modified from:

			http://wpshock.com/wordpress-load-jquery-from-google-libraries-cdn-with-local-jquery-fallback/

			There have been adjustments to make the code better suited for our purposes and also some
			formatting adjustments to make the code follow our style guidelines.

		---------------------------------------------------------------------------------------------*/

		// jQuery via Google CDN With Local Fall Back
		$v = '1.8.1'; //you should update this to the most recent version of jQuery
		// the URL to check against
		$url = 'http://ajax.googleapis.com/ajax/libs/jquery/' . $v . '/jquery.min.js';
		// test parameters
		$test_url = @fopen($url,'r');
		// test if the URL exists
		if($test_url !== false) {
			// deregisters the default WordPress jQuery
			wp_deregister_script( 'jquery' );
			// register the external file
			wp_register_script('jquery', $url, '', $v, true);
			// enqueue the external file
			wp_enqueue_script('jquery');
		} else {
			// enqueue the local file
			wp_deregister_script("jquery");
			// register the external file
			wp_register_script("jquery",get_template_directory() . '/_/js/jquery.min.js', '', $v, true);
			// enqueue the external file
			wp_enqueue_script('jquery');
		}
		// END wpshock.com modified code
	}
}

add_action('wp_enqueue_scripts', 'add_scripts_styles');

///////////////////////////////////
// Hide Admin Bar
///////////////////////////////////

/*---------------------------------------------------------------------------------------------

	This snippet hides the admin bar entirely and removes the 28px of space at the top of
	the screen when the admin bar is missing

	It was modified from:

	http://wp.tutsplus.com/tutorials/how-to-disable-the-admin-bar-in-wordpress-3-3/

	There have been adjustments to format the code to follow our style guidelines.

---------------------------------------------------------------------------------------------*/

if(!function_exists('disableAdminBar')) {
	function disableAdminBar() {
		// for the admin page
		remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
		// for the front end
		remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );

		// css override for the admin page
		function remove_admin_bar_style_backend() {
			echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
		}
		add_filter('admin_head', 'remove_admin_bar_style_backend');
{'fraction_non_alphanumeric': 0.30115384615384616, 'fraction_numerical': 0.004871794871794872, 'mean_word_length': 1.7362329007365838, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '709261', 'n_tokens_mistral': 2210, 'n_tokens_neox': 2018, 'n_words': 592}