0 ) $src = wp_get_attachment_image_src( $post_id ); return is_array( $src ) ? array_shift( $src ) : $icon; }, 10, 3 ); // Enable DIVI Builder for Custom Widgets function my_et_builder_post_types( $post_types ) { $post_types[] = 'content_block'; return $post_types; } add_filter( 'et_builder_post_types', 'my_et_builder_post_types' ); // Load styles to editor function my_theme_add_editor_styles() { add_editor_style( 'editor.css' ); } add_action( 'init', 'my_theme_add_editor_styles' ); // Language switcher function language_switcher() { wp_enqueue_script( 'language-switcher', get_stylesheet_directory_uri() . '/js/language-switcher.js', array( 'jquery' ), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'language_switcher' ); // Abamap function abaninja_map() { wp_enqueue_script( 'abaninja-map-list', get_stylesheet_directory_uri() . '/js/list.js', array( 'jquery' ), '1.0.0', true ); wp_enqueue_script( 'abaninja-map', get_stylesheet_directory_uri() . '/js/abamap.js', array( 'jquery' ), '1.0.1', true ); } add_action( 'wp_enqueue_scripts', 'abaninja_map' ); function wpb_adding_styles() { wp_register_style('abaninja-map-css', get_stylesheet_directory_uri() . '/css/abamap.css'); wp_enqueue_style('abaninja-map-css'); } add_action( 'wp_enqueue_scripts', 'wpb_adding_styles' ); // Admin function registerCustomAdminCss(){ $src = get_stylesheet_directory_uri() . '/admin.css'; $handle = "customAdminCss"; wp_register_script($handle, $src); wp_enqueue_style($handle, $src, array(), false, false); } add_action('admin_head', 'registerCustomAdminCss');