function Add_GetTextFilter() { global $pagenow; if ($pagenow == 'async-upload.php' || $pagenow == 'media-upload.php') { if (isset($_REQUEST['post_id'])) { $post = Get_Post(IntVal($_REQUEST['post_id'])); } elseif (isset($_REQUEST['attachment_id'])) { $attachment = Get_Post(IntVal($_REQUEST['attachment_id'])); $post = Get_Post($attachment->post_parent); } if ($post->post_type == $this->gallery_post_type) { Add_Filter('gettext', array($this, 'Filter_GetText'), 10, 3); } } }
if ($page_links) { ?> <div class="tablenav"> <div class="tablenav-pages"><?php echo $page_links; ?> </div> </div> <?php } ?> <?php foreach ($images_query->posts as $image) { $attachment_counter++; $image->parent = Get_Post($image->post_parent); if (Is_Object($image->parent)) { $image->parent->title = Get_The_Title($image->parent->ID); $image->parent->link = Get_Permalink($image->parent->ID); $image->parent->type = Get_Post_Type_Object($image->parent->post_type); } else { $image->parent = False; } $image->move_link = Add_Query_Arg(array('move_attachment' => $image->ID, 'move_to' => $current_gallery->ID)); ?> <div class="attachment" id="attachment-<?php echo $image->ID; ?> "> <?php echo wp_get_attachment_image($image->ID);
function Filter_The_Tags($str_tag_list, $before, $separator, $after, $post_id) { $post = Get_Post($post_id); if (!Is_Admin()) { $gallery_taxonomy = 'gallery_tag'; $taxonomy_exists = Taxonomy_Exists($gallery_taxonomy); $is_gallery = $post->post_type == $this->gallery_post_type->name; $uses_post_tags = Is_Object_in_Taxonomy($post->post_type, 'post_tag'); $uses_gallery_tags = Is_Object_in_Taxonomy($post->post_type, $gallery_taxonomy); if ($taxonomy_exists && $is_gallery && !$uses_post_tags && $uses_gallery_tags) { $str_tag_list = Get_The_Term_List($post_id, $gallery_taxonomy, $before, $separator, $after); } } return $str_tag_list; }