ID, 'gallery_post', True); if ($gallery_post > 0) { $gallery_post_content = do_shortcode('[gallery id="'. $gallery_post .'" captiontag="" itemtag="div" icontag="span" ]'); $content .= '
Gallery Category: " . $category->name . "
"; $posts = get_gallery_post_list($category); $upload_dir = wp_upload_dir(); $plugin_url = GALLERY_POST_URL . 'gallery-post-show.php'; ?>Search For Gallery Post:
Select the gallery to attach to the post: '; echo ''; echo ''; ?> 1) { // check if it's changed $gp = get_post_meta($post_id, 'gallery_post', True); if (!$gp) { $p = get_post($post_id); if ($p->post_type != "post") { return ;} } if ($gp != $gallery_post) { // save the post data update_post_meta($post_id, 'gallery_post', $gallery_post); // update the thumbnail id $thumbnail_id = get_post_thumbnail_id($gallery_post); update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); // need to update gallery_post_list $category = get_category(get_option('gallery_post_category')); #update_gallery_post_list($category); } return; } else { // remove post meta data $gp = get_post_meta($post_id, 'gallery_post', True); if ($gp) { delete_post_meta($post_id, 'gallery_post'); delete_post_meta($post_id, '_thumbnail_id'); // need to update gallery_post_list $category = get_category(get_option('gallery_post_category')); #update_gallery_post_list($category); } $cat = get_post($post_id); $gallery_cat = get_category(get_option('gallery_post_category')); } } function gallery_post_publish_post($post_id) { $cat = get_the_category($post_id); $gallery_cat = get_category(get_option('gallery_post_category')); foreach ($cat as $c) { if ($c->term_id == $gallery_cat->term_id) { update_gallery_post_list($gallery_cat); return; } } } function gallery_post_delete_post($post_id) { $cat = get_the_category($post_id); $gallery_cat = get_category(get_option('gallery_post_category')); foreach ($cat as $c) { if ($c->term_id == $gallery_cat->term_id) { update_gallery_post_list($gallery_cat); return; } } } function gallery_post_settings_page() { global $wpdb; ?>This is the category that empty gallery posts are stored in.
| Title | Author | Status | Date |
|---|---|---|---|
| ', ' | ', $result->ID); print '' . $result->display_name . ' | '; print '' . $result->post_status . ' | '; print '' . $result->post_date . ' | '; print '
| None found. | |||
| Title | Author | Status | Date |
|---|---|---|---|
| ', ' | ', $result->object_id); print '' . $result->display_name . ' | '; print '' . $result->post_status . ' | '; print '' . $result->post_date . ' | '; print '
| None found. | |||
| Title | Author | Status | Date |
|---|---|---|---|
| ', ' | ', $result->object_id); print '' . $result->display_name . ' | '; print '' . $result->post_status . ' | '; print '' . $result->post_date . ' | '; print '
| None found. | |||