<?php
function register_my_menus() {
  register_nav_menus(
    array(
      'asiapac-sidebar' => __( 'AP Sidebar' ),
      'emea-sidebar' => __( 'EMEA Sidebar' )
     )
   );
 }
 add_action( 'init', 'register_my_menus' );


// Add CSS
function responsive_css()
{
	//register styles for our theme
	wp_register_style( 'custom-app-css', get_template_directory_uri() . '/assets/css/custom-app.css', array(), 'all' );
	wp_enqueue_style( 'custom-app-css' );
}
add_action( 'wp_enqueue_scripts', 'responsive_css' );

// Add JS
function boostrap_js()
{
	wp_register_script('custom-app-js', get_template_directory_uri() . '/assets/js/custom-app.js');
	wp_enqueue_script('custom-app-js','/assets/js/custom-app.js', array('jquery'), null, true);
}
add_action( 'wp_enqueue_scripts', 'boostrap_js');

function gmap_js()
{
wp_register_script('aa_js_googlemaps_script',  'https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDpl8eIX_gf3n5mSjSbi53opfKhecptOYA&callback=Function.prototype'); // with Google Maps API fix
		wp_enqueue_script('aa_js_googlemaps_script');
	}
	add_action( 'wp_enqueue_scripts', 'gmap_js');

function theme_scripts_method(){
wp_enqueue_script( 'jquery');
}
add_action( 'wp_enqueue_scripts', 'theme_scripts_method' );

function my_acf_init() {
	acf_update_setting('google_api_key', 'AIzaSyDpl8eIX_gf3n5mSjSbi53opfKhecptOYA');
}
add_action('acf/init', 'my_acf_init');


function my_function_admin_bar(){ return false; }
add_filter( 'show_admin_bar' , 'my_function_admin_bar');


function my_acf_disable_taxonomy_parent() {

    ?>
    <script type="text/javascript">
    (function($) {

        $(document).ready(function(){
            $(".categorydiv ul.categorychecklist > li > label > input").remove();
						$(".categorychecklist-holder ul.acf-checkbox-list > li > label > input").remove();
        });

    })(jQuery);
    </script>
    <?php

}




function custom_admin_css_for_admin_menu() {
	echo '<style>
        #adminmenu,
	#adminmenu .wp-submenu,
	#adminmenuback,
	#adminmenuwrap {
		width: 250px;
	}
	#wpcontent,
	#wpfooter {
		margin-left: 250px;
	}
	#adminmenu .wp-submenu{
		left: 250px;
	}
	#adminmenu .wp-not-current-submenu .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu {
	    min-width: 250px;
	    width: auto;
	    border-left: 5px solid transparent;
	}
	#adminmenu li.wp-menu-separator {
	    height: 5px;
	    padding: 0;
	    margin: 5px 0 3px;
	    transform: scaleY(0.5);
			border-top:1px dotted #666;

	</style>';
}
add_action( 'admin_head', 'custom_admin_css_for_admin_menu' );
