コード例 #1
0
ファイル: woo.php プロジェクト: baridavid/themes
 function etheme_category_header()
 {
     if (function_exists('et_get_term_meta')) {
         global $wp_query;
         $cat = $wp_query->get_queried_object();
         if (!property_exists($cat, "term_id") && !is_search()) {
             echo '<div class="category-description">';
             echo do_shortcode(etheme_get_option('product_bage_banner'));
             echo '</div>';
         } else {
             $image = etheme_get_option('product_bage_banner');
             $queried_object = get_queried_object();
             if (isset($queried_object->term_id)) {
                 $term_id = $queried_object->term_id;
                 $content = et_get_term_meta($term_id, 'cat_meta');
                 if (isset($content[0]['cat_header'])) {
                     echo '<div class="category-description">';
                     echo do_shortcode($content[0]['cat_header']);
                     echo '</div>';
                 }
             }
         }
     }
 }
コード例 #2
0
 function save_taxonomy_custom_meta($term_id)
 {
     if (isset($_POST['cat_header'])) {
         $term_meta = et_get_term_meta($term_id, 'cat_meta');
         if (isset($_POST['cat_header'])) {
             $term_meta = $_POST['cat_header'];
         }
         // Save the option array.
         et_update_term_meta($term_id, 'cat_meta', $term_meta);
     }
 }
コード例 #3
0
 function save_taxonomy_custom_meta($term_id)
 {
     if (isset($_POST['term_meta'])) {
         $term_meta = et_get_term_meta($term_id, 'cat_meta');
         $cat_keys = array_keys($_POST['term_meta']);
         foreach ($cat_keys as $key) {
             if (isset($_POST['term_meta'][$key])) {
                 $term_meta[$key] = $_POST['term_meta'][$key];
             }
         }
         // Save the option array.
         et_update_term_meta($term_id, 'cat_meta', $term_meta);
     }
 }
コード例 #4
0
ファイル: woo.php プロジェクト: MrMuzik/ar4tupgrade
 function etheme_category_header()
 {
     if (function_exists('et_get_term_meta')) {
         global $wp_query;
         $cat = $wp_query->get_queried_object();
         if (!property_exists($cat, "term_id") && !is_search()) {
             echo do_shortcode(etheme_get_option('product_bage_banner'));
         } else {
             $image = etheme_get_option('product_bage_banner');
             $queried_object = get_queried_object();
             if (isset($queried_object->term_id)) {
                 $term_id = $queried_object->term_id;
                 $content = et_get_term_meta($term_id, 'cat_meta');
                 if (isset($content[0])) {
                     $content = apply_filters('the_content', $content[0]);
                     echo do_shortcode($content);
                 }
             }
         }
     }
 }