<commit_before><?php

  
/*
  // Exclude certain categories from home
  function exclude_category() {
    if (is_home()) {
      $cat = '-' . get_category_id_by_name("Interviste");
      set_query_var('cat', $cat);
    }
  }
  add_filter('pre_get_posts', 'exclude_category');
*/

/*
  // Hide/remove some features from Wordpress backend
  function simplify_backend() {
    echo '<script type="text/javascript" charset="utf-8">';
    echo '  jQuery(document).ready(function() {';
    echo '    jQuery("#menu-links").remove();';
    echo '    jQuery("#pageparentdiv, #media-buttons, #commentstatusdiv, #trackbacksdiv, #postcustom, #authordiv, #revisionsdiv, #tagsdiv-post_tag, *[href=edit-tags.php?taxonomy=post_tag]").hide();';
    echo '  });';
    echo '</script>';
  }
  add_action('admin_head', 'simplify_backend' );
*/

/*
  // Add custom post types to the general feed
  function add_custom_posts_to_feed($qv) {
    if (isset($qv['feed']))
      $qv['post_type'] = array('review', 'journey', 'news', 'magazine_edition', 'event', 'post');
    return $qv;
  }
  add_filter('request', 'add_custom_posts_to_feed');
*/

/*
  // Enable upload of custom MIME types
  function custom_upload_mimes ( $existing_mimes=array() ) {
    $existing_mimes['bib'] = 'text/x-bibtex';
    return $existing_mimes;
  }
  add_filter('upload_mimes', 'custom_upload_mimes');
*/


/* Remove Inline CSS and Line Breaks in WordPress Galleries */
  
add_filter('the_content', 'remove_br_gallery', 11);
function remove_br_gallery($output) {
	return preg_replace('/(<br[^>]*>\s*){2,}/', '<br />', $output);
}

add_filter('use_default_gallery_style', '__return_false');


/* Pulisce html della gallery wordpress*/

function custom_gallery( $output, $attr ){
  global $post, $wp_locale;

  static $instance = 0;
  $instance++;
  
  // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
  if ( isset( $attr['orderby'] ) ) {
      $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
      if ( !$attr['orderby'] )
          unset( $attr['orderby'] );
  }<commit_msg>M - hooks per aggiungere la classe nice al form CF7<commit_after><?php

  
/*
  // Exclude certain categories from home
  function exclude_category() {
    if (is_home()) {
      $cat = '-' . get_category_id_by_name("Interviste");
      set_query_var('cat', $cat);
    }
  }
  add_filter('pre_get_posts', 'exclude_category');
*/

/*
  // Hide/remove some features from Wordpress backend
  function simplify_backend() {
    echo '<script type="text/javascript" charset="utf-8">';
    echo '  jQuery(document).ready(function() {';
    echo '    jQuery("#menu-links").remove();';
    echo '    jQuery("#pageparentdiv, #media-buttons, #commentstatusdiv, #trackbacksdiv, #postcustom, #authordiv, #revisionsdiv, #tagsdiv-post_tag, *[href=edit-tags.php?taxonomy=post_tag]").hide();';
    echo '  });';
    echo '</script>';
  }
  add_action('admin_head', 'simplify_backend' );
*/

/*
  // Add custom post types to the general feed
  function add_custom_posts_to_feed($qv) {
    if (isset($qv['feed']))
      $qv['post_type'] = array('review', 'journey', 'news', 'magazine_edition', 'event', 'post');
    return $qv;
  }
  add_filter('request', 'add_custom_posts_to_feed');
*/

/*
  // Enable upload of custom MIME types
  function custom_upload_mimes ( $existing_mimes=array() ) {
    $existing_mimes['bib'] = 'text/x-bibtex';
    return $existing_mimes;
  }
  add_filter('upload_mimes', 'custom_upload_mimes');
*/

/* Add class nice to contact form 7 */

add_filter( 'wpcf7_form_class_attr', 'your_custom_form_class_attr' );

function your_custom_form_class_attr( $class ) {
	$class .= ' nice';
	return $class;
}



/* Remove Inline CSS and Line Breaks in WordPress Galleries */
  
add_filter('the_content', 'remove_br_gallery', 11);
function remove_br_gallery($output) {
	return preg_replace('/(<br[^>]*>\s*){2,}/', '<br />', $output);
}

add_filter('use_default_gallery_style', '__return_false');


/* Pulisce html della gallery wordpress*/

function custom_gallery( $output, $attr ){
  global $post, $wp_locale;

  static $instance = 0;
  $instance++;
  
  // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
  if ( isset( $attr['orderby'] ) ) {
      $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
      if ( !$attr['orderby'] )
          unset( $attr['orderby'] );
  }
{'fraction_non_alphanumeric': 0.17058823529411765, 'fraction_numerical': 0.0029411764705882353, 'mean_word_length': 4.164719626168225, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4688707', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1498, 'n_words': 322}