function meso_add_all_tax_control() { $allptype = dez_get_all_posttype(); foreach ($allptype as $type) { $customPostTaxonomies = get_object_taxonomies($type); foreach ($customPostTaxonomies as $taxo) { add_action($taxo . '_add_form_fields', 'meso_extra_category_fields', 10, 2); add_action($taxo . '_edit_form_fields', 'meso_extra_category_fields', 10, 2); add_action('edited_' . $taxo, 'meso_save_extra_category_fileds', 10, 2); } } }
</div><!-- FEATURED END --> </div> <!-- GALLERY SLIDER END --> <?php } elseif ($featured_post && !$featured_category) { ?> <!-- GALLERY SLIDER START --> <div id="featuredbox"> <div id="featured"> <div id="Gallerybox"> <div id="myGallery"> <?php $allposttype = dez_get_all_posttype(); query_posts(array('post__in' => explode(',', $featured_post), 'post_type' => $allposttype, 'posts_per_page' => 100, 'ignore_sticky_posts' => 1, 'orderby' => 'post__in')); while (have_posts()) { the_post(); $post_regular_price = get_post_meta($post->ID, '_regular_price', true); if (function_exists('get_woocommerce_currency_symbol')) { $woo_cur_symbol = get_woocommerce_currency_symbol(); } ?> <div class="imageElement post-<?php the_ID(); ?> "> <?php echo dez_get_featured_slider_image("", "", 640, 480, "alignleft full", "featured-slider-img", dez_get_image_alt_text(), the_title_attribute('echo=0'), true);
function dez_get_all_taxonomy() { $ptax = array(); $allptype = dez_get_all_posttype(); foreach ($allptype as $type) { $post_taxo = get_object_taxonomies($type); foreach ($post_taxo as $taxo) { $ptax[] = $taxo; } } return $ptax; }
function form($instance) { // Get the options into variables, escaping html characters on the way $cpt_title = isset($instance['title']) ? $instance['title'] : ""; $cpt_name = isset($instance['cptname']) ? $instance['cptname'] : ""; $cpt_thumb = isset($instance['cptthumb']) ? $instance['cptthumb'] : ""; $cpt_thumb_size = isset($instance['cptthumbsize']) ? $instance['cptthumbsize'] : ""; $cpt_data = isset($instance['cptdata']) ? $instance['cptdata'] : ""; $cpt_total = isset($instance['cpttotal']) ? $instance['cpttotal'] : ""; ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e("Title:", 'mesocolumn'); ?> <em><?php _e("*required", 'mesocolumn'); ?> </em></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo $cpt_title; ?> " /> </p> <p><label for="<?php echo $this->get_field_id('cptname'); ?> "><?php _e("Select Custom Post Type:", 'mesocolumn'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('cptname'); ?> " name="<?php echo $this->get_field_name('cptname'); ?> "> <?php $all_cpt = dez_get_all_posttype(); if ($all_cpt) { foreach ($all_cpt as $cpts) { if ($cpt_name == $cpts) { $is_selected = ' selected="selected" '; } else { $is_selected = ""; } $cptlist = '<option ' . $is_selected . 'name="' . $this->get_field_name('cptname') . '" value="' . $cpts . '">' . $cpts . '</option>'; echo $cptlist; } } ?> </select> </p> <p><label for="<?php echo $this->get_field_id('cptthumb'); ?> "><?php _e('Enable Thumbnails?:<br /><em>*post featured images</em>', 'mesocolumn'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('cptthumb'); ?> " name="<?php echo $this->get_field_name('cptthumb'); ?> "> <option<?php if ($cpt_thumb == 'yes') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptthumb'); ?> " value="yes"><?php _e('yes', 'mesocolumn'); ?> </option> <option<?php if ($cpt_thumb == 'no') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptthumb'); ?> " value="no"><?php _e('no', 'mesocolumn'); ?> </option> </select> </p> <p><label for="<?php echo $this->get_field_id('cptthumbsize'); ?> "><?php _e('Thumbnails Size?:', 'mesocolumn'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('cptthumbsize'); ?> " name="<?php echo $this->get_field_name('cptthumbsize'); ?> "> <option<?php if ($cpt_thumb_size == 'thumbnail') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptthumbsize'); ?> " value="thumbnail"><?php _e('thumbnail', 'mesocolumn'); ?> </option> <option<?php if ($cpt_thumb_size == 'medium') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptthumbsize'); ?> " value="medium"><?php _e('medium', 'mesocolumn'); ?> </option> </select> </p> <p><label for="<?php echo $this->get_field_id('cptdata'); ?> "><?php _e('Enable Post Meta?:<br /><em>*post date and post comments count</em>', 'mesocolumn'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('cptdata'); ?> " name="<?php echo $this->get_field_name('cptdata'); ?> "> <option<?php if ($cpt_data == 'enable') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptdata'); ?> " value="enable"><?php _e('Enable', 'mesocolumn'); ?> </option> <option<?php if ($cpt_data == 'disable') { echo " selected='selected'"; } ?> name="<?php echo $this->get_field_name('cptdata'); ?> " value="disable"><?php _e('Disable', 'mesocolumn'); ?> </option> </select> </p> <p><label for="<?php echo $this->get_field_id('cpttotal'); ?> "><?php _e("Total:", 'mesocolumn'); ?> </label> <br /> <input class="widefat" id="<?php echo $this->get_field_id('cpttotal'); ?> " name="<?php echo $this->get_field_name('cpttotal'); ?> " type="text" value="<?php echo $cpt_total; ?> " /> </p> <?php }