예제 #1
8
 function upload($option)
 {
     // ONLY ALLOW SUPER ADMINS TO UPLOAD NEW ICONS
     if (!current_user_can('update_plugins')) {
         return 'You need super admin capabilities to use this option!';
     }
     // GET/SET DEFAULTS
     $supports = $option['supports'];
     $output = '';
     // CHECK TO SEE IF THE FILE TYPE IS ALLOWED
     // CHECK ON MULTISITE
     if (is_multisite() && strpos(get_site_option('upload_filetypes'), $supports['file_extension']) === false) {
         return 'It seems that the ' . $supports['file_extension'] . ' file type is not allowed on your multisite enable network. Please go to <a title="Network settings page" href="' . network_admin_url('settings.php') . '"">Network settings page</a> and add the ' . $supports['file_extension'] . ' file extension to the list of "Upload file types"';
     }
     // CHECK TO SEE IF ZIPARCHIVE IS INSTALLED ON THE SERVER
     if (!class_exists('ZipArchive')) {
         return 'It seems that the "ZipArchive" class is not installed on your server. Please contact your server administrator and ask them to enable this class in order to use this option.';
     }
     $output .= '<div class="zn_file_upload zn_admin_button" data-file_type="' . $supports['file_type'] . '" data-button="Upload" data-title="Upload File">Select file</div>';
     $output .= '<div class="uploads_container">';
     $fonts = ZN()->icon_manager->get_custom_fonts();
     if (!empty($fonts)) {
         foreach ($fonts as $key => $font) {
             $output .= '<a class="zn_remove_font" href="#">' . $key . '<span data-font_name="' . $key . '" class="zn_remove_font_trigger">&#215;</span></a> ';
         }
     }
     $output .= '</div>';
     return $output;
 }
예제 #2
0
 /**
  * check_version function.
  */
 public function check_version()
 {
     if (get_option($this->theme_old_version) != ZN()->theme_data['version'] || get_option($this->theme_db_version) != ZN()->theme_data['version']) {
         $this->install();
         do_action('zn_theme_installed');
     }
 }
 function add_inline_css()
 {
     $css = get_post_meta(zn_get_the_id(), 'zn_page_custom_css', true);
     if (!empty($css)) {
         ZN()->add_inline_css($css);
     }
 }
예제 #4
0
 function __construct()
 {
     if (ZN()->is_request('admin')) {
         require FW_PATH . '/classes/class-mega-menu-admin.php';
     }
     // ADD THE MEGA MENU WALKER AND CLASSES
     add_filter('wp_nav_menu_args', array(&$this, 'enable_custom_walker'), 100);
 }
예제 #5
0
 function zn_check_updates()
 {
     $option_name = ZN()->theme_data['theme_id'] . '_update_config';
     $saved_config = get_option($option_name);
     if (!empty($saved_config['tf_username']) && !empty($saved_config['tf_api']) && !empty($this->config['author'])) {
         require_once FW_PATH . '/modules/envato_theme_updater/class-pixelentity-theme-update.php';
         PixelentityThemeUpdate::init($saved_config['tf_username'], $saved_config['tf_api'], $this->config['author']);
     }
 }
예제 #6
0
 function zn_print_scripts($hook)
 {
     /* Set default theme pages where the js and css should be loaded */
     $about_pages = array('dashboard_page_zn-update');
     if (!in_array($hook, $about_pages)) {
         return;
     }
     // Load the framework assets
     ZN()->load_html_scripts();
 }
 function add_inline_code()
 {
     $css = get_post_meta(zn_get_the_id(), 'zn_page_custom_css', true);
     $js = get_post_meta(zn_get_the_id(), 'zn_page_custom_js', true);
     if (!empty($css)) {
         ZN()->add_inline_css($css);
     }
     if (!empty($js)) {
         ZN()->add_inline_js(array('zn_page_custom_js' => $js));
     }
 }
예제 #8
0
function zn_update_405()
{
    $uploads = wp_upload_dir();
    $file_path = trailingslashit($uploads['basedir']) . 'zn_custom_css.css';
    // Change the custom css saving from file to DB
    if (file_exists($file_path)) {
        $saved_css = file_get_contents($file_path);
        if (!empty($saved_css)) {
            update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_css', $saved_css, false);
        }
        @unlink($file_path);
    }
}
예제 #9
0
function zn_add_custom_css_saving($saved_options)
{
    if (isset($saved_options['advanced_options']['custom_css'])) {
        $custom_css = $saved_options['advanced_options']['custom_css'];
        update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_css', $custom_css, false);
        // Remove custom css from the main options field
        unset($saved_options['advanced_options']['custom_css']);
    }
    if (isset($saved_options['advanced_options']['custom_js'])) {
        $custom_js = $saved_options['advanced_options']['custom_js'];
        update_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_js', $custom_js, true);
        // Remove custom css from the main options field
        unset($saved_options['advanced_options']['custom_js']);
    }
    return $saved_options;
}
예제 #10
0
    function element()
    {
        // print_z($this);
        $elm_classes = array();
        $elm_classes[] = $uid = $this->data['uid'];
        $elm_classes[] = $this->opt('css_class', '');
        $eq_pad_start = '';
        $eq_pad_end = '';
        $eq_pad_type = $this->opt('pad_type', '');
        if (!empty($eq_pad_type)) {
            $eq_pad_start = '<div class="zn_col_' . $eq_pad_type . '">';
            $eq_pad_end = '</div>';
        }
        ?>

	<div class="zn_custom_container <?php 
        echo implode(' ', $elm_classes);
        ?>
 clearfix">
		<?php 
        echo $eq_pad_start;
        ?>
			<div class="row zn_columns_container zn_content <?php 
        echo $this->opt('gutter_size', '');
        ?>
" data-droplevel="1">
				<?php 
        if (empty($this->data['content'])) {
            $column = ZN()->pagebuilder->add_module_to_layout('ZnColumn', array(), array(), 'col-sm-12');
            $this->data['content'] = array($column);
        }
        if (!empty($this->data['content'])) {
            ZN()->pagebuilder->zn_render_content($this->data['content']);
        }
        ?>
			</div>
		<?php 
        echo $eq_pad_end;
        ?>
	</div><!-- /.zn_custom_container -->


	<?php 
    }
예제 #11
0
    function element()
    {
        $column_offset = $this->opt('column_offset') && !ZN()->pagebuilder->is_active_editor ? ' ' . $this->opt('column_offset') . ' ' : '';
        $width = $this->data['width'] ? $this->data['width'] : 'col-md-12';
        $size_small = $this->opt('size_small', str_replace("md", "sm", $width));
        $size_xsmall = $this->opt('size_xsmall', '');
        $size_large = $this->opt('size_large', '');
        ?>

		<div class="<?php 
        echo $this->data['uid'];
        ?>
 <?php 
        echo $column_offset . ' ' . $width . ' ' . $size_small . ' ' . $size_xsmall . ' ' . $size_large . ' ' . $this->opt('css_class', '');
        ?>
 zn_sortable_content zn_content " data-droplevel="2">
			<?php 
        ZN()->pagebuilder->zn_render_content($this->data['content']);
        ?>
		</div>
	<?php 
    }
예제 #12
0
 function zn_render_meta_box($post, $metabox)
 {
     // Get the current metabox
     $zn_metabox = $metabox['args']['what_box'];
     $output = '';
     //var_dump( get_post_meta($post->ID) );
     $output .= ZN()->html->zn_render_meta_start($zn_metabox['slug']);
     if (!empty($this->metaboxes_options)) {
         foreach ($this->metaboxes_options as $key => $element) {
             if (in_array($metabox['id'], $element['slug'])) {
                 if (method_exists(ZN()->html, $element['type'])) {
                     $saved_value = get_post_meta($post->ID, $element['id'], true);
                     if (!empty($saved_value)) {
                         $element['std'] = $saved_value;
                     }
                     $output .= ZN()->html->zn_render_single_option($element);
                 }
             }
         }
     }
     $output .= ZN()->html->zn_render_meta_end();
     $output .= wp_nonce_field('zn_ajax_nonce', 'zn_ajax_nonce', false, false);
     echo $output;
 }
예제 #13
0
do_action('zn_pb_editor_right');
?>
			</div>

			<input class="zn_pb_search" type="search" placeholder="Search for an element"/>
			<a class="zn_publish" href="#">
				<span class="zn_publish_loading"></span>
				<span class="zn_publish_text">PUBLISH</span>
			</a>
		</div>
	</div>

	<div class="zn_pb_tab_wrapper" class="fixclear">

		<div id="zn_pb_content" class="zn_pb_tab"></div>

		<?php 
/*
 *	HOOK INTO THE TABS
 */
do_action('znpb_editor_tabs_content');
?>


	</div>
	<input type="hidden" id="zn_post_id" value="<?php 
echo ZN()->pagebuilder->get_post_id();
?>
"/>
</div>
<div class="zn_page_loading"></div>
 function do_theme_activation()
 {
     $options_field = ZN()->theme_data['options_prefix'];
     $saved_values = array();
     //delete_option(  $options_field );
     // IF THE OPTIONS FIELD IS NOT PRESENT
     if (false === get_option($options_field)) {
         $file = THEME_BASE . "/template_helpers/dummy_content/theme_options.txt";
         if (!is_file($file)) {
             include THEME_BASE . '/template_helpers/options/theme-options.php';
             foreach ($admin_options as $key => $option) {
                 if (!empty($option['std'])) {
                     $saved_values[$option['parent']][$option['id']] = $option['std'];
                 } else {
                     $saved_values[$option['parent']][$option['id']] = '0';
                 }
             }
         } else {
             $data = file_get_contents($file);
             $saved_values = json_decode($data, true);
         }
         update_option($options_field, $saved_values);
         generate_options_css($saved_values);
         ZN()->pagebuilder->refresh_pb_data();
     }
 }
예제 #15
0
        wp_enqueue_script('jquery-ui-slider');
        // HTML
        wp_enqueue_script('jquery-ui-button');
        // HTML
        wp_enqueue_script('jquery-ui-sortable');
        // HTML + PB
        wp_enqueue_script('jquery-ui-datepicker');
        // HTML
        wp_enqueue_media();
        wp_enqueue_script('zn_timepicker', FW_URL . '/assets/js/jquery.timepicker.min.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_modal', FW_URL . '/assets/js/zn_modal.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_media', FW_URL . '/assets/js/zn_media.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_ace', FW_URL . '/assets/js/src-min-noconflict/ace.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('ZnFormHelper', FW_URL . '/assets/js/ZnFormHelper.js', array('jquery'), ZN_FW_VERSION, true);
        wp_enqueue_script('zn_html_script', FW_URL . '/assets/js/zn_html_script.js', array('jquery'), ZN_FW_VERSION, true);
        wp_localize_script('zn_html_script', 'ZnAjax', array('ajaxurl' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('zn_framework'), 'debug' => $this->theme_data['debug']));
    }
}
/**
 * Returns the main instance of WC to prevent the need to use globals.
 *
 * @since  1.0.0
 * @return Zn_Framework
 */
function ZN()
{
    return Zn_Framework::instance();
}
// Global for backwards compatibility.
$GLOBALS['zn_framework'] = ZN();
예제 #16
0
<div class="wrap zn-about-container zn-u-pleft zn-u-pright">
	<header class="zn-about-header clearfix">
		<h2><?php 
_e('KALLYAS THEME ', 'zn_framework');
//echo '<span>'. ZN()->theme_data['name'].'</span>';
?>
</h2>
		<div class="zn-theme-version-number">Version <?php 
echo ZN()->version;
?>
</div>
	</header>
예제 #17
0
}
// If Custom bg selected, make sure it's not default text scheme
if ($header_text_scheme && $header_style == 'image_color') {
    if ($header_text_scheme != 'default' && $header_text_scheme != '') {
        $headerTextScheme = 'sh--' . $header_text_scheme;
    }
}
$header_class[] = $headerTextScheme;
// Absolute / Relative header (from 4.0.3)
$header_class[] = zget_option('head_position', 'general_options', false, '1') != 1 ? 'site-header--relative' : 'site-header--absolute';
// General dropdown color scheme
$nav_color_theme = 'nav-th--' . (zget_option('nav_color_theme', 'general_options', false, '') == '' ? zget_option('zn_main_style', 'color_options', false, 'light') : zget_option('nav_color_theme', 'general_options', false, ''));
$header_class[] = $nav_color_theme;
// Imploded
$hc = implode(' ', $header_class);
if (ZN()->pagebuilder->is_active_editor) {
    echo '<a href="#" class="toggle-header" title="Hide header to access the first element."><span class="glyphicon glyphicon-chevron-up"></span></a>';
}
do_action('th_display_site_header');
// Used for backwards compatility. It will be removed in a future version
// Add a hook before the header display
do_action('zn_before_siteheader');
?>
<header id="header" class="site-header <?php 
echo $hc;
?>
" <?php 
echo $stickyMenuAttrs;
?>
 <?php 
echo $style;
예제 #18
0
 /**
  * This function will install the theme for the first time
  */
 function do_theme_activation()
 {
     $options_field = ZN()->theme_data['options_prefix'];
     $saved_values = array();
     $file = THEME_BASE . "/template_helpers/dummy_content/theme_options.txt";
     if (!is_file($file)) {
         include THEME_BASE . '/template_helpers/options/theme-options.php';
         foreach ($admin_options as $key => $option) {
             if (!empty($option['std'])) {
                 $saved_values[$option['parent']][$option['id']] = $option['std'];
             }
         }
     } else {
         $data = file_get_contents($file);
         $saved_values = json_decode($data, true);
     }
     update_option($options_field, $saved_values);
     generate_options_css($saved_values);
     ZN()->pagebuilder->refresh_pb_data();
     update_option($this->theme_version_string, $this->theme_version, false);
     do_action('zn_theme_installed');
 }
예제 #19
0
function zn_generate_icon($icon)
{
    return ZN()->icon_manager->generate_icon_data($icon);
}
예제 #20
0
$message = '';
if ('ok' === $connection_status) {
    $icon = 'dashicons-yes';
} elseif ('notok' === $connection_status) {
    $icon = 'dashicons-no';
    $message = '<br />It seems that your server cannot connect to Hogash Servers. Some features like demo data import will not work. In order to resolve this, please contact your server administrator and ask them to allow connections to kallyas.net servers.';
}
?>


								<div class="zn-server-status-column zn-server-status-column-name">Connection to server</div>
								<div class="zn-server-status-column"><span class="zn-server-status-column-icon dashicons-before dashicons-update <?php 
echo $icon;
?>
" title="If a connection can be established between your current server and <?php 
echo ZN()->theme_data['name'];
?>
 servers."></span></div>
								<div class="zn-server-status-column zn-server-status-column-value"><a class="zn-server-status-button zn-about-action zn-action-green" href="<?php 
echo $url;
?>
">Check now</a> <?php 
echo $message;
?>
</div>
							</div>
							<div class="zn-server-status-row">
								<?php 
$message = 'Installed';
$icon = 'dashicons-yes';
$color_class = 'zn-system-status-ok';
예제 #21
0
 /**
  * Render the page builder elements
  *
  * @access public
  * @param $elements array
  * @param $reload bool
  */
 function zn_render_elements($elements, $reload = false)
 {
     if (!is_array($elements)) {
         return;
     }
     global $has_style, $zn_config;
     // CHECK IF THIS IS AN AJAX CALL ( DOING_AJAX )
     $echo = defined('ZN_PB_AJAX') ? true : false;
     foreach ($elements as $element) {
         // CHECK TO SEE IF THE ELEMENT WAS ALREADY INSTANTIATED
         if (!empty($element['uid']) && !empty($this->instantiated_modules[$element['uid']]) && !$reload) {
             $el = $this->instantiated_modules[$element['uid']];
         } else {
             // LOAD THE ELEMENT IN CASE IT IS NOT ALREADY LOADED
             $el = $this->load_element($element);
         }
         // If the element was deleted or changed continue
         if (empty($this->all_available_elements[$element['object']])) {
             continue;
         }
         // Don't run the function multiple times
         $css = $el->css();
         // CHECK IF WE NEED TO RENDER THE EDITOR EXTRA CONTENT OR JUST THE ELEMENT
         if ($this->is_active_editor) {
             // Add the element to the elements array
             $this->current_modules[$element['uid']] = $element;
             // Put the element info - only needed in active editor
             $el->info = $this->all_available_elements[$element['object']];
             $element_render_type = 'element';
             $this->editor->before_element($el);
             if (method_exists($el, 'element_edit')) {
                 $element_render_type = 'element_edit';
             }
             $el->{$element_render_type}();
             $this->editor->after_element($el);
             if ($el->js() && $echo) {
                 if ($el->info['scripts']) {
                     $el->scripts();
                 }
                 ZN()->add_inline_js($el->js(), $echo);
             }
             // Add inline CSS
             if ($css && $echo) {
                 ZN()->add_inline_css($css, $echo);
             }
             echo '</div>';
             // END ELEMENT
         } else {
             $el->element();
             if ($el->js() && $echo) {
                 $el->scripts();
                 ZN()->add_inline_js($el->js(), $echo);
             }
             // Add inline CSS
             if ($css && $echo) {
                 ZN()->add_inline_css($css, $echo);
             }
         }
     }
     // END FOREACH ELEMENT
 }
 function setup_modules_options()
 {
     $element_options = array();
     foreach (ZN()->pagebuilder->instantiated_modules as $key => $value) {
     }
 }
 function load_scripts()
 {
     wp_enqueue_style('zn_pb_style', FW_URL . '/pagebuilder/assets/css/zn_front_pb.css');
     wp_register_style('open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext');
     wp_enqueue_style('open-sans');
     // PB SPECIFIC PLUGINS
     wp_enqueue_script('isotope');
     wp_enqueue_script('jquery-ui-sortable');
     // HTML + PB
     wp_enqueue_script('jquery-ui-draggable');
     // PB
     // IRIS IS NOT AVAILABLE IN FRONTEND SO WE NEED TO MANUALLY LOAD IT
     wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
     wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false, 1);
     $colorpicker_l10n = array('clear' => __('Clear', 'zn_framework'), 'defaultString' => __('Default', 'zn_framework'), 'pick' => __('Select Color', 'zn_framework'));
     wp_localize_script('wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n);
     // PAGE BUILDER CUSTOM SCRIPTS
     wp_enqueue_script('zn_front_pb', FW_URL . '/pagebuilder/assets/js/zn_front_pb.js', array('jquery', 'zn_html_script', 'backbone', 'underscore', 'wp-util'), '', true);
     ZN()->load_html_scripts();
     // Load all JS files that are required by the elements
     foreach (ZN()->pagebuilder->all_available_elements as $class => $element) {
         if ($element['scripts']) {
             include_once $element['file'];
             $element = new $element['class']();
             $element->scripts();
         }
     }
 }
예제 #24
0
	<div class="znfb-col-7">
		<h3 class="zn-lead-title">Register your theme for automatic updates</h3>
		<div class="zn-lead-text">
			<p>We strongly recommmend you to register your theme. By registering it, you will get automatic updates and notifications as well.</p>
			<p><strong>All you have to do is follow these steps :</strong></p>
			<ol>
				<li>Add your ThemeForest username in the form on the right;</li>
				<li>Generate an API key on ThemeForest. Please type the username first, and click onto the link right above the API key field. It'll take you to your ThemeForest account's - API KEY Generator;</li>
				<li>Fill the rest of the form and hit REGISTER.</li>
			</ul>
		</div>
	</div>

	<div class="znfb-col-5">
		<?php 
$option_name = ZN()->theme_data['theme_id'] . '_update_config';
$saved_config = get_option($option_name);
$tf_username = isset($saved_config['tf_username']) ? $saved_config['tf_username'] : '';
$tf_api = isset($saved_config['tf_api']) ? $saved_config['tf_api'] : '';
?>
		<form action="" class="zn-about-register-form">
			<div class="zn-about-form-field">
				<label for="tf_username">Themeforest Username</label>
				<input type="text" id="tf_username" class="zn-about-register-form-username" value="<?php 
echo $tf_username;
?>
" placeholder="Themeforest username">
			</div>
			<div class="zn-about-form-field">
				<label for="tf_api_key">Themeforest API key</label>
				<div class="zn-about-label-desc js-zn-label-tfusername">After you type your ThemeForest username in the field above, <a href="#" class="js-zn-label-tfusername-link tfusername-link--nope" target="_blank">click here to go to your "Generate API Key" page on ThemeForest</a>. </div>
예제 #25
0
/**
 * Returns the sidebar configuration
 * @param type $page_layout
 * @param type $sidebar_select
 * @param type $post_type
 * @return false || array
 */
function zn_sidebar_config($page_layout, $sidebar_select, $post_type)
{
    $return = array();
    // GET SIDEBAR LAYOUT
    $return['page_layout'] = zn_cnv_has_sidebar($page_layout, $post_type);
    // It may be possible that the admin option is set to no_sidebar
    if (empty($return['page_layout'])) {
        return false;
    }
    // GET SIDEBAR TO USE
    if ($sidebar_select == 'default') {
        // We need to get the sidebar setting from admin panel
        switch ($post_type) {
            case 'post':
                $sidebar_select = zget_option('single_sidebar', 'unlimited_sidebars');
                $sidebar_select = !empty($sidebar_select) ? $sidebar_select['sidebar'] : 'defaultsidebar';
                break;
            case 'page':
                $sidebar_select = zget_option('page_sidebar', 'unlimited_sidebars');
                $sidebar_select = !empty($sidebar_select) ? $sidebar_select['sidebar'] : 'defaultsidebar';
                break;
            case 'product':
                $sidebar_select = zget_option('woo_single_sidebar', 'unlimited_sidebars');
                $sidebar_select = !empty($sidebar_select) ? $sidebar_select['sidebar'] : 'defaultsidebar';
                break;
            case 'woo_archive':
                $sidebar_select = zget_option('woo_archive_sidebar', 'unlimited_sidebars');
                $sidebar_select = !empty($sidebar_select) ? $sidebar_select['sidebar'] : 'defaultsidebar';
                break;
            case 'blog_archive':
                $sidebar_select = zget_option('archive_sidebar', 'unlimited_sidebars');
                $sidebar_select = !empty($sidebar_select) ? $sidebar_select['sidebar'] : 'defaultsidebar';
                break;
            default:
                # code...
                break;
        }
    }
    // Finally, get the column containing the sidebar
    $sidebar_el = ZN()->pagebuilder->add_module_to_layout('TH_Sidebar', array('sidebar_select' => $sidebar_select));
    $return['sidebar_element'] = ZN()->pagebuilder->add_module_to_layout('ZnColumn', array(), array($sidebar_el), 'col-sm-3');
    return $return;
}
예제 #26
0
function add_custom_css($css)
{
    $saved_css = get_option('zn_' . ZN()->theme_data['theme_id'] . '_custom_css', '');
    $new_css = $css . $saved_css;
    return $new_css;
}
예제 #27
0
 function zn_render_page()
 {
     // Get the curent slug
     $slug = $_GET['page'];
     $slug = str_replace('zn_tp_', '', $slug);
     $this->data['slug'] = $slug;
     $this->data['theme_options'] = $this->get_theme_options();
     ZN()->html()->zn_set_data($this->data);
     echo ZN()->html()->zn_page_start();
     echo ZN()->html()->zn_render_page_options();
     echo ZN()->html()->zn_page_end();
 }
예제 #28
0
function zn_is_debug()
{
    if (isset(ZN()->theme_data['debug']) && ZN()->theme_data['debug'] === true) {
        return true;
    } else {
        return false;
    }
}
예제 #29
0
 function import_custom_icons()
 {
     $path = $this->file_location . '/custom_icons/';
     if (!file_exists($path)) {
         return;
     }
     $files = array_diff(scandir($path), array('..', '.'));
     foreach ($files as $file) {
         ZN()->icon_manager->do_icon_install($path . $file, 'dummy_title');
     }
 }
 /**
  * Attempt to create a new menu item from import data
  *
  * Fails for draft, orphaned menu items and those without an associated nav_menu
  * or an invalid nav_menu term. If the post type or term object which the menu item
  * represents doesn't exist then the menu item will not be imported (waits until the
  * end of the import to retry again before discarding).
  *
  * @param array $item Menu item details from WXR file
  */
 function process_menu_item($item)
 {
     // skip draft, orphaned menu items
     if ('draft' == $item['status']) {
         return;
     }
     $menu_slug = false;
     if (isset($item['terms'])) {
         // loop through terms, assume first nav_menu term is correct menu
         foreach ($item['terms'] as $term) {
             if ('nav_menu' == $term['domain']) {
                 $menu_slug = $term['slug'];
                 break;
             }
         }
     }
     // no nav_menu term associated with this menu item
     if (!$menu_slug) {
         _e('Menu item skipped due to missing menu slug', 'wordpress-importer');
         echo '<br />';
         return;
     }
     $menu_id = term_exists($menu_slug, 'nav_menu');
     if (!$menu_id) {
         printf(__('Menu item skipped due to invalid menu slug: %s', 'wordpress-importer'), esc_html($menu_slug));
         echo '<br />';
         return;
     } else {
         $menu_id = is_array($menu_id) ? $menu_id['term_id'] : $menu_id;
     }
     foreach ($item['postmeta'] as $meta) {
         ${$meta}['key'] = $meta['value'];
     }
     if ('taxonomy' == $_menu_item_type && isset($this->processed_terms[intval($_menu_item_object_id)])) {
         $_menu_item_object_id = $this->processed_terms[intval($_menu_item_object_id)];
     } else {
         if ('post_type' == $_menu_item_type && isset($this->processed_posts[intval($_menu_item_object_id)])) {
             $_menu_item_object_id = $this->processed_posts[intval($_menu_item_object_id)];
         } else {
             if ('custom' != $_menu_item_type) {
                 // associated object is missing or not imported yet, we'll retry later
                 $this->missing_menu_items[] = $item;
                 return;
             }
         }
     }
     if (isset($this->processed_menu_items[intval($_menu_item_menu_item_parent)])) {
         $_menu_item_menu_item_parent = $this->processed_menu_items[intval($_menu_item_menu_item_parent)];
     } else {
         if ($_menu_item_menu_item_parent) {
             $this->menu_item_orphans[intval($item['post_id'])] = (int) $_menu_item_menu_item_parent;
             $_menu_item_menu_item_parent = 0;
         }
     }
     // wp_update_nav_menu_item expects CSS classes as a space separated string
     $_menu_item_classes = maybe_unserialize($_menu_item_classes);
     if (is_array($_menu_item_classes)) {
         $_menu_item_classes = implode(' ', $_menu_item_classes);
     }
     $args = array('menu-item-object-id' => $_menu_item_object_id, 'menu-item-object' => $_menu_item_object, 'menu-item-parent-id' => $_menu_item_menu_item_parent, 'menu-item-position' => intval($item['menu_order']), 'menu-item-type' => $_menu_item_type, 'menu-item-title' => $item['post_title'], 'menu-item-url' => $_menu_item_url, 'menu-item-description' => $item['post_content'], 'menu-item-attr-title' => $item['post_excerpt'], 'menu-item-target' => $_menu_item_target, 'menu-item-classes' => $_menu_item_classes, 'menu-item-xfn' => $_menu_item_xfn, 'menu-item-status' => $item['status']);
     $id = wp_update_nav_menu_item($menu_id, 0, $args);
     if ($id && !is_wp_error($id)) {
         $this->processed_menu_items[intval($item['post_id'])] = (int) $id;
         // If the theme supports mega - menu
         print_z(ZN()->theme_data['supports']['megamenu']);
         if (!empty(ZN()->theme_data['supports']['megamenu'])) {
             if (!empty($_menu_item_zn_mega_menu_enable)) {
                 update_post_meta($id, '_menu_item_zn_mega_menu_enable', $_menu_item_zn_mega_menu_enable);
             }
             if (!empty($_menu_item_zn_mega_menu_headers)) {
                 update_post_meta($id, '_menu_item_zn_mega_menu_headers', $_menu_item_zn_mega_menu_headers);
             }
             if (!empty($_menu_item_zn_mega_menu_label)) {
                 update_post_meta($id, '_menu_item_zn_mega_menu_label', $_menu_item_zn_mega_menu_label);
             }
         }
     }
 }