Example #1
0
 public function get_adbusters_array()
 {
     if (function_exists('wpcom_vip_load_plugin')) {
         wpcom_vip_load_plugin('adbusters');
         if (function_exists('wpcom_vip_get_ad_busters_array')) {
             return wpcom_vip_get_ad_busters_array();
         }
     }
     return array('adcentric/ifr_b.html', 'adinterax/adx-iframe-v2.html', 'atlas/atlas_rm.htm', 'blogads/iframebuster-4.html', 'checkm8/CM8IframeBuster.html', 'comscore/cs-arIframe.htm', 'doubleclick/DARTIframe.html', 'doubleclick/fif.html', 'eyeblaster/addineyeV2.html', 'eyewonder/interim.html', 'flashtalking/ftlocal.html', 'flite/fif.html', 'gumgum/iframe_buster.html', 'interpolls/pub_interpolls.html', 'jivox/jivoxIBuster.html', 'jpd/jpxdm.html', 'mediamind/MMbuster.html', 'mixpo/framebust.html', 'oggifinogi/oggiPlayerLoader.htm', 'pictela/Pictela_iframeproxy.html', 'pointroll/PointRollAds.htm', 'rubicon/rp-smartfile.html', 'saymedia/iframebuster.html', 'smartadserver/iframeout.html', 'undertone/iframe-buster.html', 'undertone/UT_iframe_buster.html', 'xaxis/InfinityIframe.html', '_uac/adpage.html', 'adcom/aceFIF.html');
 }
 /**
  * Includes any active plugin files that are enabled via the UI/option.
  */
 public function include_active_plugins()
 {
     foreach ($this->get_active_plugins_option() as $plugin) {
         wpcom_vip_load_plugin($plugin);
     }
 }
                    $slugs[] = trim(get_category_parents($category->term_id, false, '/', true), '/');
                }
            }
        }
        if (!empty($slugs)) {
            $rules = array();
            foreach ($slugs as $slug) {
                $rules['(' . $slug . ')/feed/(feed|rdf|rss|rss2|atom)?/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
                $rules['(' . $slug . ')/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
                $rules['(' . $slug . ')(/page/(\\d+))?/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[3]';
            }
        }
    }
    return $rules;
}
add_filter('category_rewrite_rules', 'smittenkitchen_filter_category_rewrite_rules');
// Replace 'tag' base in tag URIs with 'recipe-collection'.
wpcom_vip_load_tag_base('recipe-collection');
// Enable a custom permastruct to remove the date from the post URLs.
wpcom_vip_load_permastruct('/%year%/%monthnum%/%postname%/');
// Enable Elasticsearch for better search results.
wpcom_vip_load_plugin('wpcom-elasticsearch');
function smittenkitchen_search_to_es($query)
{
    if ($query->is_search()) {
        $query->set('es', true);
    }
}
add_action('pre_get_posts', 'smittenkitchen_search_to_es');
// Opt out of AMP for now
add_filter('amp_is_enabled', '__return_false', 100);
 /**
  * Includes any active plugin files that are enabled via the UI/option.
  */
 public function include_active_plugins()
 {
     foreach ($this->get_active_plugins_option() as $plugin) {
         if (has_blog_sticker('vip-plugins-ui-rc-plugins')) {
             wpcom_vip_load_plugin($plugin, 'plugins', true);
         } else {
             wpcom_vip_load_plugin($plugin);
         }
     }
 }
<?php

// Sync is disabled so we don't need to run comment queries in the admin
wpcom_vip_load_plugin('disable-comments-query');
/**
 * If the current post hasn't been published, don't load Disqus.
 *
 * @param bool $retval If Disqus thinks it should load itself
 * @return bool True if Disqus can load
 */
function wpcom_vip_dsq_can_replace($retval)
{
    global $post;
    if (!in_array($post->post_status, array('publish', 'private', 'inherit'))) {
        return false;
    }
    return $retval;
}
add_filter('dsq_can_replace', 'wpcom_vip_dsq_can_replace');
Example #6
0
<?php

/**
 * Load and customize plugins
 */
if (function_exists('wpcom_vip_load_plugin')) {
    wpcom_vip_load_plugin('fieldmanager');
    wpcom_vip_load_plugin('co-authors-plus');
    wpcom_vip_load_plugin('chartbeat');
    wpcom_vip_load_plugin('storify');
    wpcom_vip_load_plugin('edit-flow');
    wpcom_vip_load_plugin('wpcom-thumbnail-editor');
}