function ocwscc_edit_taxonomy_field() { if (get_bloginfo('version') >= 3.5) { wp_enqueue_media(); } else { wp_enqueue_style('thickbox'); wp_enqueue_script('thickbox'); } $term_id = ""; if (isset($_GET['tag_ID'])) { $term_id = trim($_GET['tag_ID']); } /* if (ocwscc_creationcache_image_url( $term_id, NULL, TRUE ) == OCWSCC_IMAGE_PLACEHOLDER) $image_url = ""; else */ $image_url = ocws_ctype_id_image_url($term_id); $image_url2 = ""; if (!($image_url == OCWSCC_IMAGE_PLACEHOLDER)) { $image_url2 = $image_url; } // $image_url = ocwscc_creationcache_image_url( $term_id, NULL, TRUE ); echo '<tr class="form-field"> <th scope="row" valign="top"><label for="creationcache_image">Image</label></th> <td><img class="taxonomy-image" src="' . $image_url . '"/><br/><input type="text" name="creationcache_image" id="creationcache_image" value="' . $image_url2 . '" /><br /> <button class="ocwscc_upload_image_button button">Upload/Add image</button> <button class="ocwscc_remove_image_button button">Remove image</button> </td> </tr>' . ocwscc_upload_script(); }
function manage_creationcache_columns($column_name, $post_id) { // global $post; $ocwscc_cachetype = get_the_term_list($post_id, 'cachetype'); switch ($column_name) { case 'cachenum': echo get_post_meta($post_id, '_ocwscc_ccname', true); break; case 'cachetype': echo wp_strip_all_tags(get_the_term_list($post_id, 'cachetype')); break; case 'ctype_img': $ccterm_name = wp_strip_all_tags(get_the_term_list($post_id, 'cachetype')); $ccterm = get_term_by('name', $ccterm_name, 'cachetype'); $ccterm_id = $ccterm->term_id; // echo ocws_ctype_id_image_url($ccterm_id); echo "<img src=\"" . ocws_ctype_id_image_url($ccterm_id) . "\" alt=\"" . wp_strip_all_tags($ocwscc_cachetype) . "\" title=\"" . wp_strip_all_tags($ocwscc_cachetype) . "\" class=\"wp-post-image ocws-typeimg-size-arch\" width=\"40\" height=\"40\" />\n"; break; default: break; } // end switch }