<commit_before><?php
/**
 * Air functions and definitions.
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package air
 */

/**
 * The current version of the theme.
 */
define( 'AIR_VERSION', '2.0.6' );

/**
 * WooCommerce support
 */
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
  add_theme_support( 'woocommerce' );
}

/**
 * Requires
 */
require get_template_directory() . '/inc/woocommerce.php';

/**
 * Remove archive title prefix
 */
function air_remove_archive_title_prefix($title) {
  return preg_replace('/^\w+: /', '', $title);
}
add_filter( 'get_the_archive_title', 'air_remove_archive_title_prefix' );

/**
 * Disable emojicons introduced with WP 4.2
 *
 * @link http://wordpress.stackexchange.com/questions/185577/disable-emojicons-introduced-with-wp-4-2
 */
function disable_wp_emojicons() {
  // All actions related to emojis
  remove_action( 'admin_print_styles', 'print_emoji_styles' );
  remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  remove_action( 'wp_print_styles', 'print_emoji_styles' );
  remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

  // Remove TinyMCE emojis
  add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
}
add_action( 'init', 'disable_wp_emojicons' );

// Disable TinyMCE emojicons
function disable_emojicons_tinymce( $plugins ) {
  if ( is_array( $plugins ) ) {
    return array_diff( $plugins, array( 'wpemoji' ) );
  } else {
    return array();
  }
}

/**
 * Allow Gravity Forms to hide labels to add placeholders
 */
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );

/**
 *  Set Yoast SEO plugin metabox priority to low
 */
function air_lowpriority_yoastseo() {
  return 'low';
}
add_filter( 'wpseo_metabox_prio', 'air_lowpriority_yoastseo' );

/**
 * Remove SendGrid credentials in development env, so that
 * test emails won't go out to client.
 */
if( getenv( 'WP_ENV' ) === 'development' ) {

  function air_remove_sendgrid_apikey() {
    return '';
  }
  add_filter( 'option_sendgrid_api_key', 'air_remove_sendgrid_apikey' );

  function air_remove_sendgrid_pwd() {
    return '';
  }
  add_filter( 'option_sendgrid_pwd', 'air_remove_sendgrid_pwd' );

}

/**
 * Enable theme support for essential features
 */
load_theme_textdomain( 'air', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
<commit_msg>Lint functions according to WordPress Theme Coding Standards<commit_after><?php
/**
 * Air functions and definitions.
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package air
 */

/**
 * The current version of the theme.
 */
define( 'AIR_VERSION', '2.0.6' );

/**
 * WooCommerce support
 */
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
  add_theme_support( 'woocommerce' );
}

/**
 * Requires
 */
require get_template_directory() . '/inc/woocommerce.php';

/**
 * Remove archive title prefix
 */
function air_remove_archive_title_prefix( $title ) {
  return preg_replace( '/^\w+: /', '', $title );
}
add_filter( 'get_the_archive_title', 'air_remove_archive_title_prefix' );

/**
 * Disable emojicons introduced with WP 4.2
 *
 * @link http://wordpress.stackexchange.com/questions/185577/disable-emojicons-introduced-with-wp-4-2
 */
function disable_wp_emojicons() {
  // All actions related to emojis
  remove_action( 'admin_print_styles', 'print_emoji_styles' );
  remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
  remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  remove_action( 'wp_print_styles', 'print_emoji_styles' );
  remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
  remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

  // Remove TinyMCE emojis
  add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
}
add_action( 'init', 'disable_wp_emojicons' );

// Disable TinyMCE emojicons
function disable_emojicons_tinymce( $plugins ) {
  if ( is_array( $plugins ) ) {
    return array_diff( $plugins, array( 'wpemoji' ) );
  } else {
    return array();
  }
}

/**
 * Allow Gravity Forms to hide labels to add placeholders
 */
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );

/**
 *  Set Yoast SEO plugin metabox priority to low
 */
function air_lowpriority_yoastseo() {
  return 'low';
}
add_filter( 'wpseo_metabox_prio', 'air_lowpriority_yoastseo' );

/**
 * Remove SendGrid credentials in development env, so that
 * test emails won't go out to client.
 */
if ( getenv( 'WP_ENV' ) === 'development' ) {

  function air_remove_sendgrid_apikey() {
    return '';
  }
  add_filter( 'option_sendgrid_api_key', 'air_remove_sendgrid_apikey' );

  function air_remove_sendgrid_pwd() {
    return '';
  }
  add_filter( 'option_sendgrid_pwd', 'air_remove_sendgrid_pwd' );

}

/**
 * Enable theme support for essential features
 */
load_theme_textdomain( 'air', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );

{'fraction_non_alphanumeric': 0.1409985935302391, 'fraction_numerical': 0.005274261603375527, 'mean_word_length': 5.123789020452099, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2429140', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1975, 'n_words': 385}