/** * Get the next blog post with an ajax call * * @return void * @since 2.0.0 * @author Antonio La Rocca <*****@*****.**> * @author Andrea Grillo <*****@*****.**> */ function yit_blog_big_next_post() { global $post; if (is_null($post) || empty($post)) { return; } if (YIT_Request()->is_ajax && isset($_REQUEST['post_id'])) { $post = get_post(intval($_REQUEST['post_id'])); } if ((is_singular('post') || YIT_Request()->is_ajax && $post->post_type == 'post') && yit_get_option('blog-single-type') == 'big') { $blog_type_options = array('blog_single_type' => yit_get_option('blog-single-type'), 'is_next_post' => true); $image_size = YIT_Registry::get_instance()->image->get_size('blog_single_big'); $next_post = get_previous_post(); if ($next_post == '' || $next_post == null) { $args = array('order' => 'DESC', 'order_by' => 'date'); $posts = get_posts($args); if (!empty($posts)) { $next_post = $posts[0]; } } $post = $next_post; setup_postdata($post); $has_post_thumbnail = has_post_thumbnail(); $placeholder = !$has_post_thumbnail ? 'class="placeholder no-featured" style="height: ' . $image_size['height'] . 'px;"' : 'class="placeholder" style="max-height: ' . $image_size['height'] . 'px;"'; ?> <div id="next" class='slide-tab next-post hidden-content' data-post_id="<?php the_ID(); ?> "> <div class='big-image'> <div <?php echo $placeholder; ?> > <?php if ($has_post_thumbnail) { ?> <?php yit_image(array('post_id' => get_the_ID(), 'size' => 'blog_single_big', 'class' => 'img-responsive')); ?> <?php } ?> <div class="inner"> <div class="info-overlay"> <div class="read-more-label"><?php _e('VIEW NEXT POST', 'yit'); ?> </div> <div class="read-more-title"><?php the_title(); ?> </div> </div> </div> </div> <?php yit_blog_big_post_start('next-post'); ?> </div> <div class='container'> <?php remove_action('yit_primary', 'yit_start_primary', 5); remove_action('yit_primary', 'yit_end_primary', 90); remove_action('yit_content_loop', 'yit_content_loop', 10); add_action('yit_content_loop', 'yit_blog_single_loop'); yit_get_template('primary/loop/single.php', $blog_type_options); if (!YIT_Request()->is_ajax) { comments_template(); } add_action('yit_primary', 'yit_end_primary', 90); ?> </div> </div> <?php if (defined('DOING_AJAX') && DOING_AJAX) { die; } } }
protected function _import_data() { global $wpdb; $error = ''; if (isset($_FILES['import-file']) && empty($file)) { if (!isset($_FILES['import-file'])) { wp_die(__("The file you have insert doesn't valid.", 'yit')); } switch (substr($_FILES['import-file']['name'], -3)) { case 'xml': $error = sprintf(__('The file you have insert is a WordPress eXtended RSS (WXR) file. You need to use this into the %s admin page to import this file. Here only <b>.gz</b> file are allowed.', 'yit'), admin_url('import.php', false)); break; case 'zip': case 'rar': $error = sprintf(__('The file you have insert is a ZIP or RAR file, that it doesn\'t allowed in this case. Here only <b>.gz</b> file are allowed.', 'yit')); break; } if (substr($_FILES['import-file']['name'], -2) != 'gz') { $error = sprintf(__('The file you have insert is not a valid file. Here only <b>.gz</b> file are allowed.', 'yit')); } if ($error != '') { YIT_Registry::get_instance()->message->addMessage($error, 'error'); return false; } } if (YIT_Request()->post('sampledata') == 'true') { $check_file = YIT_Request()->post('file'); $file = !empty($check_file) ? $check_file : 'default.gz'; $wp_remote_get_result = wp_remote_get($file, array('redirection' => 50, 'timeout' => 50)); $content_file = wp_remote_retrieve_body($wp_remote_get_result); } else { $file = empty($file) ? $_FILES['import-file']['tmp_name'] : $file; $content_file = file_get_contents($file); } if ($content_file) { // get db encoded $db = unserialize(base64_decode(gzuncompress($content_file))); array_walk_recursive($db, array($this, 'convert_url'), 'in_import'); if (!is_array($db)) { wp_die(__('An error encoured during during import. Please try again.', 'yit')); } set_time_limit(0); // tables $tables = array_keys($db); $db_tables = $wpdb->get_col("SHOW TABLES"); $theme_name = is_child_theme() ? strtolower(wp_get_theme()->parent()->get('Name')) : strtolower(wp_get_theme()->get('Name')); foreach ($tables as $key => $table) { if ($table != 'options' && in_array($wpdb->prefix . $table, $db_tables)) { // delete all row of each table if (!in_array($table, array('users', 'usermeta'))) { $wpdb->query("TRUNCATE TABLE {$wpdb->prefix}{$table}"); } // insert new data $error_data = array(); $insert = array(); foreach ($db[$table] as $id => $data) { $insert[] = $this->_makeInsertSQL($data); } if (!empty($db[$table])) { $num_rows = count($insert); $step = 5000; $insert_step = intval(ceil($num_rows / $step)); $fields = implode('`, `', array_keys($db[$table][0])); for ($i = 0; $i < $insert_step; $i++) { $insert_row = implode(', ', array_slice($insert, $i * $step, $step)); $wpdb->query("INSERT INTO `{$wpdb->prefix}{$table}` ( `{$fields}` ) VALUES " . $insert_row); } } } elseif ($table == 'options') { $options_iterator = new ArrayIterator($db[$table]); foreach ($options_iterator as $id => $data) { if ($data['option_name'] == 'theme_mods_' . $theme_name) { $data_child = $data; $data_child['option_name'] = $data_child['option_name'] . '-child'; $options_iterator->append($data_child); } $fields = implode("`,`", array_keys($data)); $values = implode("', '", array_values(array_map('esc_sql', $data))); $updates = ''; foreach ($data as $k => $v) { $v = esc_sql($v); $updates .= "{$k} = '{$v}',"; } $updates = substr($updates, 0, -1); $query = "INSERT INTO {$wpdb->prefix}{$table}\r\n (`{$fields}`)\r\n VALUES\r\n ('{$values}')\r\n ON DUPLICATE KEY UPDATE\r\n {$updates};"; $wpdb->query($query); } } elseif (function_exists('YIT_Custom_Style') && $table == YIT_Custom_Style()->slug) { $custom_style_file = locate_template(YIT_Custom_Style()->filename); if ('' != $custom_style_file && is_writeable($custom_style_file)) { $f = fopen($custom_style_file, 'w'); if ($f !== false) { fwrite($f, $db[$table]); fclose($f); } } } } //fire an action after import file do_action('yit_backup_reset_after_file_import', $db); $this->delete_cache_data(); YIT_Registry::get_instance()->message->addMessage(__('Content and Data imported correctly!', 'yit')); if ('install-sampledata' == YIT_Request()->post('action')) { YIT_Registry::get_instance()->message->printGlobalMessages(); } } else { $error = 'Attention: an error occurred. It is impossible to automatically import your sample data in you installation. To use your data, please use the manual installation: '; $error .= '<a href="' . YIT_WPADMIN_URL . '/admin.php?page=yit_panel_backup_and_reset#yit-panel-backup-theme_options_backups">'; $error .= wp_get_theme() . __(' → Backup & Reset → Import and Export Data', 'yit'); $error .= '</a>'; YIT_Registry::get_instance()->message->addMessage(__($error, 'yit'), 'error', 'panel'); YIT_Registry::get_instance()->message->printMessages(); } if (YIT_Request()->is_ajax) { die; } return true; }
/** * Return the post id in admin area * * @return int | the post id * @since 2.0.0 * @author <*****@*****.**> */ function yit_admin_post_id() { if (false != YIT_Request()->get('post')) { $post_id = (int) YIT_Request()->get('post'); } elseif (false != YIT_Request()->post('post')) { $post_id = (int) YIT_Request()->post('post'); } elseif (false != YIT_Request()->get('post_ID')) { $post_id = (int) YIT_Request()->get('post_ID'); } elseif (false != YIT_Request()->post('post_ID')) { $post_id = (int) YIT_Request()->post('post_ID'); } else { $post_id = 0; } return $post_id; }
/** * Update option * * @return void * @author Antonio La Rocca <*****@*****.**> * @since 2.0.0 */ public function update_option() { if (YIT_Request()->post('custom_script_action') == 'update') { if (wp_verify_nonce(YIT_Request()->post('custom_script_nonce'), 'yit_custom_script_nonce') && (!defined('DOING_AUTOSAVE') || DOING_AUTOSAVE) && current_user_can('edit_theme_options') && YIT_Request()->post($this->option_name) !== false) { update_option($this->option_name, YIT_Request()->post($this->option_name)); $update = 'true'; } else { $update = 'false'; } wp_redirect(add_query_arg('updated', $update)); exit; } }
/** * Check a nonce and sets yit error in case it is invalid. * * @param string $action The name of the action to check * @param string $error_message The message to show in error case * * @return string * * @since Version 2.0.0 * @author Antonino Scarfi <*****@*****.**> */ function yit_verify_nonce($action, $error_message = '') { YIT_Request()->nonce_url($action, $error_message); }
<?php /* * This file belongs to the YIT Framework. * * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ /* Template Name: Comments */ if (YIT_Request()->is_ajax && isset($_REQUEST['post_id'])) { global $post, $wp_query, $wp_the_query, $withcomments; $comments = get_comments(array('post_id' => $post->ID, 'orderby' => 'comment_date_gmt', 'status' => 'approve')); $wp_query->comments = $comments; $wp_query->comment_count = count($comments); } if (post_password_required()) { return; } if (pings_open()) { yit_get_template('comments/trackbacks.php'); } ?> <?php if (have_comments()) { ?> <div id="comments" class="comments-area">
$categories_icon_class = $categories_icon_type == 'none' ? 'without-icon' : ($categories_icon_type == 'custom' ? 'with-icon' : 'with-icon awesome'); $tags_icon_options = yit_get_option('blog-single-tags-icon'); $tags_icon_type = $tags_icon_options['select']; $tags_icon = $tags_icon_type == 'none' ? false : ($tags_icon_type == 'icon' ? '<i class="fa fa-' . $tags_icon_options['icon'] . '"></i>' : 'style="background: transparent url(' . yit_ssl_url($tags_icon_options['custom']) . ') top left no-repeat"'); $tags_icon_class = $tags_icon_type == 'none' ? 'without-icon' : ($tags_icon_type == 'custom' ? 'with-icon' : 'with-icon awesome'); $comments_icon_options = yit_get_option('blog-single-comments-icon'); $comments_icon_type = $comments_icon_options['select']; $comments_icon = $comments_icon_type == 'none' ? false : ($comments_icon_type == 'icon' ? '<i class="fa fa-' . $comments_icon_options['icon'] . '"></i>' : 'style="background: transparent url(' . yit_ssl_url($comments_icon_options['custom']) . ') top left no-repeat"'); $comments_icon_class = $comments_icon_type == 'none' ? 'without-icon' : ($comments_icon_type == 'custom' ? 'with-icon' : 'with-icon awesome'); $share_icon_options = yit_get_option('blog-single-share-icon'); $share_icon_type = $share_icon_options['select']; $share_icon = $share_icon_type == 'none' ? false : ($share_icon_type == 'icon' ? '<i class="fa fa-' . $share_icon_options['icon'] . '"></i>' : 'style="background: transparent url(' . yit_ssl_url($share_icon_options['custom']) . ') top left no-repeat"'); $share_icon_class = $share_icon_type == 'none' ? 'without-icon' : ($share_icon_type == 'custom' ? 'with-icon' : 'with-icon awesome'); $share_text = yit_get_option('blog-single-share-text'); $title = get_the_title() != '' ? get_the_title() : __('(this post does not have a title)', 'yit'); $has_tags = !get_the_tags() ? false : true; $post_meta_separator = ' - '; $link = get_permalink(); $has_pagination = $wp_query->max_num_pages > 1 ? true : false; $image_size = YIT_Registry::get_instance()->image->get_size('blog_single_' . $blog_single_type); $args = array('show_thumbnail' => $show_thumbnail, 'show_title' => $show_title, 'show_date' => $show_date, 'show_author' => $show_author, 'show_categories' => $show_categories, 'show_tags' => $show_tags, 'show_comments' => $show_comments, 'show_share' => $show_share, 'show_read_more' => $show_read_more, 'show_meta_box' => $show_meta_box, 'author_icon' => $author_icon, 'author_icon_type' => $author_icon_type, 'author_icon_class' => $author_icon_class, 'categories_icon' => $categories_icon, 'categories_icon_type' => $categories_icon_type, 'categories_icon_class' => $categories_icon_class, 'tags_icon' => $tags_icon, 'tags_icon_type' => $tags_icon_type, 'tags_icon_class' => $tags_icon_class, 'comments_icon' => $comments_icon, 'comments_icon_type' => $comments_icon_type, 'comments_icon_class' => $comments_icon_class, 'share_icon' => $share_icon, 'share_icon_type' => $share_icon_type, 'share_icon_class' => $share_icon_class, 'share_text' => $share_text, 'title' => $title, 'post_meta_separator' => $post_meta_separator, 'blog_type' => $blog_single_type, 'link' => $link, 'has_tags' => $has_tags, 'has_pagination' => $has_pagination, 'post_format' => $post_format, 'image_size' => $image_size, 'is_quote' => $is_quote, 'hide_footer' => $hide_footer); if ($blog_single_type == 'big') { wp_localize_script('page-slider', 'yit_page_slider_options', array('action' => 'blog_next_post')); } yit_get_template('blog/' . $blog_single_type . '/single.php', $args); if (function_exists('yit_pagination') && $has_pagination) { yit_pagination(); } if (YIT_Request()->is_ajax) { yit_get_comments_template(); }
/** * Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) * * @see Walker::start_el() * @since 1.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. (Default = 0) * @param array|object $args An argument array * @param int $current_object_id The id of current object. Default = 0) * * @return void * @author Simone D'Amico <*****@*****.**> */ function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) { global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; $indent = $depth ? str_repeat("\t", $depth) : ''; ob_start(); $item_id = esc_attr($item->ID); $removed_args = array('action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce'); $original_title = ''; if ('taxonomy' == $item->type) { $original_title = get_term_field('name', $item->object_id, $item->object, 'raw'); if (is_wp_error($original_title)) { $original_title = false; } } elseif ('post_type' == $item->type) { $original_object = get_post($item->object_id); $original_title = $original_object->post_title; } $classes = array('menu-item menu-item-depth-' . $depth, 'menu-item-' . esc_attr($item->object), 'menu-item-edit-' . ($item_id == YIT_Request()->get('edit-menu-item') ? 'active' : 'inactive')); $title = $item->title; if (!empty($item->_invalid)) { $classes[] = 'menu-item-invalid'; /* translators: %s: title of menu item which is invalid */ $title = sprintf(__('%s (Invalid)', 'yit'), $item->title); } elseif (isset($item->post_status) && 'draft' == $item->post_status) { $classes[] = 'pending'; /* translators: %s: title of menu item in draft status */ $title = sprintf(__('%s (Pending)', 'yit'), $item->title); } $title = empty($item->label) ? $title : $item->label; // $awesome = YIT_Plugin_Common::get_awesome_icons(); $icon_list = YIT_Plugin_Common::get_icon_list(); ?> <li id="menu-item-<?php echo $item_id; ?> " class="<?php echo implode(' ', $classes); ?> "> <dl class="menu-item-bar"> <dt class="menu-item-handle"> <span class="item-title"><?php echo esc_html($title); ?> </span> <span class="item-controls"> <span class="item-type"><?php echo esc_html($item->type_label); ?> </span> <span class="item-order hide-if-js"> <a href="<?php echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'move-up-menu-item', 'menu-item' => $item_id), remove_query_arg($removed_args, admin_url('nav-menus.php'))), 'move-menu_item')); ?> " class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?> ">↑</abbr></a> | <a href="<?php echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'move-down-menu-item', 'menu-item' => $item_id), remove_query_arg($removed_args, admin_url('nav-menus.php'))), 'move-menu_item')); ?> " class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?> ">↓</abbr></a> </span> <a class="item-edit" id="edit-<?php echo $item_id; ?> " title="<?php esc_attr_e('Edit Menu Item', 'yit'); ?> " href="<?php echo $item_id == YIT_Request()->get('edit-menu-item') ? admin_url('nav-menus.php') : esc_url(add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url('nav-menus.php#menu-item-settings-' . $item_id)))); ?> "><?php _e('Edit Menu Item', 'yit'); ?> </a> </span> </dt> </dl> <div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?> "> <?php if ('custom' == $item->type) { ?> <p class="field-url description description-wide"> <label for="edit-menu-item-url-<?php echo $item_id; ?> "> <?php _e('URL', 'yit'); ?> <br /> <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?> " class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->url); ?> " /> </label> </p> <?php } ?> <p class="description description-thin"> <label for="edit-menu-item-title-<?php echo $item_id; ?> "> <?php _e('Navigation Label', 'yit'); ?> <br /> <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?> " class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->title); ?> " /> </label> </p> <p class="description description-thin"> <label for="edit-menu-item-attr-title-<?php echo $item_id; ?> "> <?php _e('Title Attribute', 'yit'); ?> <br /> <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?> " class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->post_excerpt); ?> " /> </label> </p> <p class="field-link-target description"> <label for="edit-menu-item-target-<?php echo $item_id; ?> "> <input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?> " value="_blank" name="menu-item-target[<?php echo $item_id; ?> ]"<?php checked($item->target, '_blank'); ?> /> <?php _e('Open link in a new window/tab', 'yit'); ?> </label> </p> <p class="field-css-classes description description-thin"> <label for="edit-menu-item-classes-<?php echo $item_id; ?> "> <?php _e('CSS Classes (optional)', 'yit'); ?> <br /> <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?> " class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?> ]" value="<?php echo esc_attr(implode(' ', $item->classes)); ?> " /> </label> </p> <p class="field-xfn description description-thin"> <label for="edit-menu-item-xfn-<?php echo $item_id; ?> "> <?php _e('Link Relationship (XFN)', 'yit'); ?> <br /> <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?> " class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->xfn); ?> " /> </label> </p> <p class="field-description description description-wide"> <label for="edit-menu-item-description-<?php echo $item_id; ?> "> <?php _e('Description', 'yit'); ?> <br /> <textarea id="edit-menu-item-description-<?php echo $item_id; ?> " class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?> ]"><?php echo esc_html($item->description); // textarea_escaped ?> </textarea> <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.', 'yit'); ?> </span> </label> </p> <!-- custom code --> <?php $custom_fields = YIT_Registry::get_instance()->{'navmenu'}->fields; ?> <?php if (!empty($custom_fields)) { ?> <div class="clear"></div> <p style="margin-top: 20px"><strong><?php _e('Customize menu', 'yit'); ?> </strong></p> <?php foreach ($custom_fields as $id => $field) { ?> <p class="description description-<?php echo $field['width']; ?> "> <label for="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> "> <?php _e($field['label'], 'yit'); ?> <?php if ($field['type'] == 'input') { ?> <input type="text" id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " class="widefat code" name="menu-item-<?php echo $id; ?> [<?php echo $item_id; ?> ]" value="<?php if (isset($item->{$id})) { echo esc_attr($item->{$id}); } ?> " /> <?php } elseif ($field['type'] == 'textarea') { ?> <textarea id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " class="widefat" rows="3" cols="20" name="menu-item-<?php echo $id; ?> [<?php echo $item_id; ?> ]"><?php if (isset($item->{$id})) { echo esc_html($item->{$id}); } // textarea_escaped ?> </textarea> <span class="description"><?php _e($field['description'], 'yit'); ?> </span> <?php } elseif ($field['type'] == 'text') { ?> <input type="text" id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " name="menu-item-<?php echo $id; ?> [<?php echo $item_id; ?> ]" class="widefat code" value="<?php if (isset($item->{$id})) { echo esc_html(trim($item->{$id})); } ?> "/> <span class="description"><?php _e($field['description'], 'yit'); ?> </span> <?php } elseif ($field['type'] == 'select-icon') { ?> <div class="icon-manager-wrapper"> <div class="icon-manager-text"> <div class="icon-preview"></div> <input type="text" id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " class="icon-text" data-sfx="icon" name="menu-item-<?php echo $id; ?> [<?php echo $item_id; ?> ]" value="<?php if (isset($item->{$id})) { echo esc_attr($item->{$id}); } ?> " /> </div> <div class="icon-manager"> <ul id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " class="icon-list-wrapper" > <?php foreach ($icon_list as $font => $icons) { foreach ($icons as $key => $icon) { ?> <li data-font="<?php echo esc_attr($font); ?> " data-icon="<?php echo strpos($key, '\\') === 0 ? '&#x' . substr($key, 1) : $key; ?> " data-key="<?php echo esc_attr($key); ?> " data-name="<?php echo esc_attr($icon); ?> " value="<?php echo $font . ':' . $icon; ?> " <?php echo selected($item->{$id}, $font . ':' . $icon); ?> ></li> <?php } } ?> </ul> </div> </div> <?php } elseif ($field['type'] == 'upload') { ?> <input type="text" id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> " class="widefat code menu-custom-field menu-custom-field-upload" data-sfx="background" value="<?php if (isset($item->{$id})) { echo esc_attr($item->{$id}); } ?> " /> <input type="button" value="<?php _e('Upload', 'yit'); ?> " id="edit-menu-item-<?php echo $id; ?> -<?php echo $item_id; ?> -button" class="upload_button button" /> <?php } ?> </label> </p> <?php } ?> <?php } ?> <!-- /custom code --> <div class="menu-item-actions description-wide submitbox"> <?php if ('custom' != $item->type && $original_title !== false) { ?> <p class="link-to-original"> <?php printf(__('Original: %s', 'yit'), '<a href="' . esc_attr($item->url) . '">' . esc_html($original_title) . '</a>'); ?> </p> <?php } ?> <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?> " href="<?php echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'delete-menu-item', 'menu-item' => $item_id), remove_query_arg($removed_args, admin_url('nav-menus.php'))), 'delete-menu_item_' . $item_id)); ?> "><?php _e('Remove', 'yit'); ?> </a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $item_id; ?> " href="<?php echo esc_url(add_query_arg(array('edit-menu-item' => $item_id, 'cancel' => time()), remove_query_arg($removed_args, admin_url('nav-menus.php')))); ?> #menu-item-settings-<?php echo $item_id; ?> "><?php _e('Cancel', 'yit'); ?> </a> </div> <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item_id); ?> " /> <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->object_id); ?> " /> <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->object); ?> " /> <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->menu_item_parent); ?> " /> <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->menu_order); ?> " /> <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?> ]" value="<?php echo esc_attr($item->type); ?> " /> </div><!-- .menu-item-settings--> <ul class="menu-item-transport"></ul> <?php $output .= ob_get_clean(); }
/** * This file belongs to the YIT Framework. * * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ if (YIT_Request()->get('updated') == 'true') { ?> <div id="message" class="updated"><p><?php _e('Scripts edited successfully.', 'yit'); ?> </p></div> <?php } elseif (YIT_Request()->get('updated') == 'false') { ?> <div id="message" class="error"><p><?php _e('An error occurred while saving the scripts.', 'yit'); ?> </p></div> <?php } ?> <div class="wrap"> <h2><?php _e('Custom Script', 'yit'); ?> </h2> <div class="fileedit-sub">
/** * Enqueue scripts and stylesheets * * @param $hook * * @since Version 2.0.0 * @author Simone D'Amico <*****@*****.**> * @return void */ public function enqueue($hook) { wp_enqueue_style('yit-panel', YIT_CORE_ASSETS_URL . '/css/panel.css'); if (strpos(YIT_Request()->get('page'), 'yit_panel') !== false) { wp_enqueue_style('jquery-ui-overcast', YIT_CORE_ASSETS_URL . '/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all'); wp_enqueue_style('yit-font-awesome', YIT_CORE_ASSETS_URL . '/css/font-awesome.min.css', false, '', 'all'); wp_enqueue_style('wp-color-picker'); wp_enqueue_media(); wp_enqueue_script('jquery-ui'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-mouse'); wp_enqueue_script('jquery-ui-button'); wp_enqueue_script('jquery-ui-dialog'); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-sortable'); yit_enqueue_script('yit-panel', YIT_CORE_ASSETS_URL . '/js/admin/panel.js', array('jquery'), YIT_CORE_VERSION, true); yit_enqueue_script('yit-spinner', YIT_CORE_ASSETS_URL . '/js/admin/panel.spinner.js', array('jquery'), '0.0.1', true); yit_enqueue_script('yit-typography', YIT_CORE_ASSETS_URL . '/js/admin/panel.typography.js', array('jquery'), '0.0.1', true); yit_enqueue_script('yit-types', YIT_CORE_ASSETS_URL . '/js/admin/panel.types.js', array('jquery', 'wp-color-picker'), YIT_CORE_VERSION, true); wp_localize_script('yit-panel', 'yit_panel_l10n', array('submit_loading' => __('Loading...', 'yit'), 'yit_panel_refresh_color_nonce' => YIT_Request()->create_nonce('refresh-color'))); } }