<commit_before><?php
function scripts_and_styles_method() {

  $templateuri = get_template_directory_uri() . '/js/';

  // library.js is to bundle plugins. my.js is your scripts. enqueue more files as needed
  $jslib = $templateuri . 'library.js';
  wp_enqueue_script( 'jslib', $jslib,'','',true);

/*   $myscripts = WP_DEBUG ? $templateuri . "main.js" : $templateuri . "main.min.js"; */
  $myscripts = $templateuri . "main.js";
  wp_register_script( 'myscripts', $myscripts );

  $is_admin = current_user_can('administrator') ? 1 : 0;
  $jsVars = array(
  	'themeUrl' => get_template_directory_uri(),
  	'isAdmin' => $is_admin,
  );

  wp_localize_script( 'myscripts', 'WP', $jsVars );
  wp_enqueue_script( 'myscripts', $myscripts,'','',true);

  // enqueue stylesheet here. file does not exist until stylus file is processed
  wp_enqueue_style( 'site', get_stylesheet_directory_uri() . '/css/site.css' );

  // dashicons for admin
  if (is_admin()){
    wp_enqueue_style( 'dashicons' );
  }

}
add_action('wp_enqueue_scripts', 'scripts_and_styles_method');

if ( function_exists( 'add_theme_support' ) ) {
  add_theme_support( 'post-thumbnails' );
}

if ( function_exists( 'add_image_size' ) ) {
  add_image_size( 'admin-thumb', 150, 150, false );
  add_image_size( 'opengraph', 1200, 630, true );

  add_image_size( 'gallery', 984, 560, false );

  add_image_size( 'hover-grid-thumb', 9999, 420, false );
  add_image_size( 'hover-grid-thumb-small', 9999, 320, false );

  add_image_size( 'journal-large-single', 9999, 9999, false );

  add_image_size( 'col-9', 480, 99999, false );
}

// Register Nav Menus
/*
register_nav_menus( array(
	'menu_location' => 'Location Name',
) );
*/

add_action( 'init', 'init_moment_php', 9999 );
function init_moment_php() {
  if ( ! class_exists( 'Moment' ) )
    require_once 'lib/moment-php/src/Moment.php';
    require_once 'lib/moment-php/src/MomentException.php';
    require_once 'lib/moment-php/src/MomentFromVo.php';
    require_once 'lib/moment-php/src/MomentHelper.php';
    require_once 'lib/moment-php/src/MomentLocale.php';
    require_once 'lib/moment-php/src/MomentPeriodVo.php';
    require_once 'lib/moment-php/src/FormatsInterface.php';
}

get_template_part( 'lib/gallery' );
get_template_part( 'lib/post-types' );
get_template_part( 'lib/meta-boxes' );
get_template_part( 'lib/theme-options' );

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
function cmb_initialize_cmb_meta_boxes() {
  // Add CMB2 plugin
  if ( ! class_exists( 'cmb2_bootstrap_202' ) )
    require_once 'lib/CMB2/init.php';
    require_once 'lib/CMB2-Post-Search-field/lib/init.php';
}

// Remove WP Emoji
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');

// Disable that freaking admin bar
add_filter('show_admin_bar', '__return_false');

// Turn off version in meta
function no_generator() { return ''; }
add_filter( 'the_generator', 'no_generator' );

// Show thumbnails in admin lists
add_filter('manage_posts_columns', 'new_add_post_thumbnail_column');
function new_add_post_thumbnail_column($cols){
  $cols['new_post_thumb'] = __('Thumbnail');
  return $cols;
}
add_action('manage_posts_custom_column', 'new_display_post_thumbnail_column', 5, 2);
function new_display_post_thumbnail_column($col, $id){
  switch($col){
    case 'new_post_thumb':
    if ( function_exists('the_post_thumbnail') ) {
      echo the_post_thumbnail( 'admin-thumb' );
      }
    else
    echo 'Not supported in theme';
    break;
  }
}

// remove automatic <a> links from images in blog
function wpb_imagelink_setup() {
	$image_set = get_option( 'image_default_link_type' );
	if ($image_set !== 'none') {
		update_option('image_default_link_type', 'none');
	}
}
add_action('admin_init', 'wpb_imagelink_setup', 10);

// custom login logo
/*
function custom_login_logo() {
  echo '<style type="text/css">h1 a { background-image:url(' . get_bloginfo( 'template_directory' ) . '/images/login-logo.png) !important; background-size:300px auto !important; width:300px !important; }</style>';
}
add_action( 'login_head', 'custom_login_logo' );
*/

// CUSTOM EXCERPT MORE TEXT
function custom_excerpt_more( $more ) {
	return ' <span class="font-small-caps">' . __('[:es]Leer más[:en]Read more') . '</span>';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );

// UTILITY FUNCTIONS

// Return an array of exhibition terms from these $posts.
function get_filter_terms($posts, $type = false) {
  if ( empty( $posts ) ) {
    return '';
  }

  $terms = array();

  foreach($posts->posts as $post) {

    $post_type = get_post_type_object( $post->post_type );
    if ($post->post_type === 'exposiciones' && $type === 'exposiciones') {
      $post_terms = wp_get_post_terms( $post->ID, 'tipo_de_exposicion' );
      foreach($post_terms as $post_term) {
        if ( in_array($post_term->slug, array_column($terms, 'slug')) == false ) {
          $terms[] = array(
            'slug'  =>  $post_term->slug,
            'name'  =>  $post_term->name,
          );
        }
      }
    } else if( $post->post_type !== 'exposiciones' && !$type ) {
      $post_type = get_post_type_object( $post->post_type );
      if ( in_array($post_type->name, array_column($terms, 'slug')) == false ) {
        $terms[] = array(
          'slug'  =>  $post_type->name,
          'name'  =>  $post_type->label,
        );
      }
    }
  }
  // pr( $terms );
  return $terms;
}

// Return a list of years
function get_all_years($post_types, $order) {
  global $wpdb;

  $where = '';
<commit_msg>fix custom tax name in function<commit_after><?php
function scripts_and_styles_method() {

  $templateuri = get_template_directory_uri() . '/js/';

  // library.js is to bundle plugins. my.js is your scripts. enqueue more files as needed
  $jslib = $templateuri . 'library.js';
  wp_enqueue_script( 'jslib', $jslib,'','',true);

/*   $myscripts = WP_DEBUG ? $templateuri . "main.js" : $templateuri . "main.min.js"; */
  $myscripts = $templateuri . "main.js";
  wp_register_script( 'myscripts', $myscripts );

  $is_admin = current_user_can('administrator') ? 1 : 0;
  $jsVars = array(
  	'themeUrl' => get_template_directory_uri(),
  	'isAdmin' => $is_admin,
  );

  wp_localize_script( 'myscripts', 'WP', $jsVars );
  wp_enqueue_script( 'myscripts', $myscripts,'','',true);

  // enqueue stylesheet here. file does not exist until stylus file is processed
  wp_enqueue_style( 'site', get_stylesheet_directory_uri() . '/css/site.css' );

  // dashicons for admin
  if (is_admin()){
    wp_enqueue_style( 'dashicons' );
  }

}
add_action('wp_enqueue_scripts', 'scripts_and_styles_method');

if ( function_exists( 'add_theme_support' ) ) {
  add_theme_support( 'post-thumbnails' );
}

if ( function_exists( 'add_image_size' ) ) {
  add_image_size( 'admin-thumb', 150, 150, false );
  add_image_size( 'opengraph', 1200, 630, true );

  add_image_size( 'gallery', 984, 560, false );

  add_image_size( 'hover-grid-thumb', 9999, 420, false );
  add_image_size( 'hover-grid-thumb-small', 9999, 320, false );

  add_image_size( 'journal-large-single', 9999, 9999, false );

  add_image_size( 'col-9', 480, 99999, false );
}

// Register Nav Menus
/*
register_nav_menus( array(
	'menu_location' => 'Location Name',
) );
*/

add_action( 'init', 'init_moment_php', 9999 );
function init_moment_php() {
  if ( ! class_exists( 'Moment' ) )
    require_once 'lib/moment-php/src/Moment.php';
    require_once 'lib/moment-php/src/MomentException.php';
    require_once 'lib/moment-php/src/MomentFromVo.php';
    require_once 'lib/moment-php/src/MomentHelper.php';
    require_once 'lib/moment-php/src/MomentLocale.php';
    require_once 'lib/moment-php/src/MomentPeriodVo.php';
    require_once 'lib/moment-php/src/FormatsInterface.php';
}

get_template_part( 'lib/gallery' );
get_template_part( 'lib/post-types' );
get_template_part( 'lib/meta-boxes' );
get_template_part( 'lib/theme-options' );

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
function cmb_initialize_cmb_meta_boxes() {
  // Add CMB2 plugin
  if ( ! class_exists( 'cmb2_bootstrap_202' ) )
    require_once 'lib/CMB2/init.php';
    require_once 'lib/CMB2-Post-Search-field/lib/init.php';
}

// Remove WP Emoji
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');

// Disable that freaking admin bar
add_filter('show_admin_bar', '__return_false');

// Turn off version in meta
function no_generator() { return ''; }
add_filter( 'the_generator', 'no_generator' );

// Show thumbnails in admin lists
add_filter('manage_posts_columns', 'new_add_post_thumbnail_column');
function new_add_post_thumbnail_column($cols){
  $cols['new_post_thumb'] = __('Thumbnail');
  return $cols;
}
add_action('manage_posts_custom_column', 'new_display_post_thumbnail_column', 5, 2);
function new_display_post_thumbnail_column($col, $id){
  switch($col){
    case 'new_post_thumb':
    if ( function_exists('the_post_thumbnail') ) {
      echo the_post_thumbnail( 'admin-thumb' );
      }
    else
    echo 'Not supported in theme';
    break;
  }
}

// remove automatic <a> links from images in blog
function wpb_imagelink_setup() {
	$image_set = get_option( 'image_default_link_type' );
	if ($image_set !== 'none') {
		update_option('image_default_link_type', 'none');
	}
}
add_action('admin_init', 'wpb_imagelink_setup', 10);

// custom login logo
/*
function custom_login_logo() {
  echo '<style type="text/css">h1 a { background-image:url(' . get_bloginfo( 'template_directory' ) . '/images/login-logo.png) !important; background-size:300px auto !important; width:300px !important; }</style>';
}
add_action( 'login_head', 'custom_login_logo' );
*/

// CUSTOM EXCERPT MORE TEXT
function custom_excerpt_more( $more ) {
	return ' <span class="font-small-caps">' . __('[:es]Leer más[:en]Read more') . '</span>';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );

// UTILITY FUNCTIONS

// Return an array of exhibition terms from these $posts.
function get_filter_terms($posts, $type = false) {
  if ( empty( $posts ) ) {
    return '';
  }

  $terms = array();

  foreach($posts->posts as $post) {

    $post_type = get_post_type_object( $post->post_type );
    if ($post->post_type === 'exposiciones' && $type === 'exposiciones') {
      $post_terms = wp_get_post_terms( $post->ID, 'tipo-de-exposicion' );
      foreach($post_terms as $post_term) {
        if ( in_array($post_term->slug, array_column($terms, 'slug')) == false ) {
          $terms[] = array(
            'slug'  =>  $post_term->slug,
            'name'  =>  $post_term->name,
          );
        }
      }
    } else if( $post->post_type !== 'exposiciones' && !$type ) {
      $post_type = get_post_type_object( $post->post_type );
      if ( in_array($post_type->name, array_column($terms, 'slug')) == false ) {
        $terms[] = array(
          'slug'  =>  $post_type->name,
          'name'  =>  $post_type->label,
        );
      }
    }
  }
  // pr( $terms );
  return $terms;
}

// Return a list of years
function get_all_years($post_types, $order) {
  global $wpdb;

  $where = '';

{'fraction_non_alphanumeric': 0.1593604024434064, 'fraction_numerical': 0.014193316564858068, 'mean_word_length': 4.192630597014926, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 51, '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': '599096', 'n_tokens_mistral': 4152, 'n_tokens_neox': 3991, 'n_words': 773}