<?php
/**
 * Visual Composer
 */

/**
 * Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page
 */
if(function_exists('vc_set_as_theme')) vc_set_as_theme();

// Remove VC Teaser metabox
if ( is_admin() ) {
  if ( ! function_exists('wpex_remove_vc_boxes') ) {
    function wpex_remove_vc_boxes(){
      $post_types = get_post_types( '', 'names' );
      foreach ( $post_types as $post_type ) {
        remove_meta_box('vc_teaser',  $post_type, 'side');
      }
    } // End function
  } // End if
add_action('do_meta_boxes', 'wpex_remove_vc_boxes');
}

// Disable Front-End Editor
if (function_exists('vc_set_as_theme') ) {
  vc_disable_frontend();
}

?>