<?php

remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action('wp_head', 'rel_canonical');
// Remove shortlink <head> and header.
remove_action('wp_head', 'wp_shortlink_wp_head', 10);
remove_action('template_redirect', 'wp_shortlink_header', 11);
add_action('init', function () {
    global $events;
    $events = array('future' => array(), 'past' => array(), 'year' => array());
    $eventsFile = gw_resources_dir((JQUERY_STAGING ? JQUERY_STAGING_PREFIX : '') . 'events.jquery.org') . '/events.json';
    $allEvents = file_exists($eventsFile) ? json_decode(file_get_contents($eventsFile)) : array();
    $now = time();
    foreach ($allEvents as $event) {
        $event->end = strtotime($event->end);
        $year = Date('Y', $event->end);
        $events['year'][$year][] = $event;
        if ($event->end > $now) {
            $events['future'][] = $event;
        } else {
            $events['past'][$year][] = $event;
        }
    }
    $events['past'] = array_reverse($events['past'], true);
});
<?php

/**
 * Plugin Name: Gilded WordPress XML-RPC extensions
 * Description: Adds custom XML-RPC methods for use with Gilded WordPress.
 */
define('GW_VERSION', '1.0.0');
if (!defined('GW_RESOURCE_DIR')) {
    define('GW_RESOURCE_DIR', gw_resources_dir(home_url()));
}
function gw_resources_dir($url)
{
    return dirname(WP_CONTENT_DIR) . '/gw-resources/' . preg_replace('/^\\w+:\\/\\//', '', $url);
}
function gw_get_version($args)
{
    global $wp_xmlrpc_server;
    $wp_xmlrpc_server->escape($args);
    // Authenticate
    $blog_id = $args[0];
    $username = $args[1];
    $password = $args[2];
    // We require authentication so that we can ensure that the username
    // and password provided will work for other methods.
    if (!($user = $wp_xmlrpc_server->login($username, $password))) {
        return $wp_xmlrpc_server->error;
    }
    return GW_VERSION;
}
function gw_get_post_paths($post_type = "")
{