$text, 'type' => $type); if ($cur_session) { asia_garden_storage_push_array('admin_messages', '', $new_msg); } else { $msg = get_option('asia_garden_admin_messages'); if (!is_array($msg)) $msg = array(); $msg[] = $new_msg; update_option('asia_garden_admin_messages', $msg); } } } } // Show internal admin messages if ( !function_exists( 'asia_garden_show_admin_messages' ) ) { function asia_garden_show_admin_messages() { $msg = asia_garden_storage_get('admin_messages'); if (!is_array($msg) || count($msg) == 0) return; ?>
id=='nav-menus') { asia_garden_show_layout(asia_garden_show_custom_field('asia_garden_icons_popup', array( 'type' => 'icons', 'style' => asia_garden_get_theme_setting('icons_type'), 'button'=> false, 'icons' => true ), null) ); } } } // Load required styles and scripts for admin mode if ( !function_exists( 'asia_garden_admin_scripts' ) ) { //Handler of the add_action("admin_enqueue_scripts", 'asia_garden_admin_scripts'); function asia_garden_admin_scripts() { // Add theme styles wp_enqueue_style( 'asia_garden-admin', asia_garden_get_file_url('css/admin.css') ); // Links to selected fonts $screen = function_exists('get_current_screen') ? get_current_screen() : false; if (is_object($screen)) { if (asia_garden_allow_meta_box(!empty($screen->post_type) ? $screen->post_type : $screen->id)) { // Load font icons // This style NEED theme prefix, because style 'fontello' some plugin contain different set of characters // and can't be used instead this style! wp_enqueue_style( 'asia_garden-icons', asia_garden_get_file_url('css/font-icons/css/fontello-embedded.css') ); wp_enqueue_style( 'asia_garden-icons-animation', asia_garden_get_file_url('css/font-icons/css/animation.css') ); // Load theme fonts $links = asia_garden_theme_fonts_links(); if (count($links) > 0) { foreach ($links as $slug => $link) { wp_enqueue_style( sprintf('asia_garden-font-%s', $slug), $link ); } } } else if (apply_filters('asia_garden_filter_allow_theme_icons', is_customize_preview() || $screen->id=='nav-menus', !empty($screen->post_type) ? $screen->post_type : $screen->id)) { // Load font icons // This style NEED theme prefix, because style 'fontello' some plugin contain different set of characters // and can't be used instead this style! wp_enqueue_style( 'asia_garden-icons', asia_garden_get_file_url('css/font-icons/css/fontello-embedded.css') ); } } // Add theme scripts wp_enqueue_script( 'asia_garden-utils', asia_garden_get_file_url('js/_utils.js'), array('jquery'), null, true ); wp_enqueue_script( 'asia_garden-admin', asia_garden_get_file_url('js/_admin.js'), array('jquery'), null, true ); } } // Add variables in the admin mode if ( !function_exists( 'asia_garden_admin_localize_scripts' ) ) { //Handler of the add_action("admin_footer", 'asia_garden_admin_localize_scripts'); function asia_garden_admin_localize_scripts() { $screen = function_exists('get_current_screen') ? get_current_screen() : false; wp_localize_script( 'asia_garden-admin', 'ASIA_GARDEN_STORAGE', apply_filters( 'asia_garden_filter_localize_script_admin', array( 'admin_mode' => true, 'screen_id' => is_object($screen) ? esc_attr($screen->id) : '', 'ajax_url' => esc_url(admin_url('admin-ajax.php')), 'ajax_nonce' => esc_attr(wp_create_nonce(admin_url('admin-ajax.php'))), 'ajax_error_msg' => esc_html__('Server response error', 'asia-garden'), 'icon_selector_msg' => esc_html__('Select the icon for this menu item', 'asia-garden'), 'user_logged_in' => true )) ); } } //------------------------------------------------------- //-- Third party plugins //------------------------------------------------------- // Register optional plugins if ( !function_exists( 'asia_garden_register_plugins' ) ) { function asia_garden_register_plugins() { tgmpa( apply_filters('asia_garden_filter_tgmpa_required_plugins', array( // Plugins to include in the autoinstall queue. )), array( 'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'parent_slug' => 'themes.php', // Parent menu slug. 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '' // Message to output right before the plugins table. ) ); } } ?>