/** * Render delete by custom post type box. * * @static */ public static function render_delete_posts_by_post_type_box() { if (BD_Util::is_posts_box_hidden(Bulk_Delete::BOX_POST_TYPE)) { printf(__('This section just got enabled. Kindly <a href = "%1$s">refresh</a> the page to fully enable it.', 'bulk-delete'), 'admin.php?page=' . Bulk_Delete::POSTS_PAGE_SLUG); return; } $types_array = array(); $types = get_post_types(array('_builtin' => false), 'names'); if (count($types) > 0) { foreach ($types as $type) { $post_count = wp_count_posts($type); if ($post_count->publish > 0) { $types_array["{$type}-publish"] = $post_count->publish; } if ($post_count->future > 0) { $types_array["{$type}-future"] = $post_count->future; } if ($post_count->pending > 0) { $types_array["{$type}-pending"] = $post_count->pending; } if ($post_count->draft > 0) { $types_array["{$type}-draft"] = $post_count->draft; } if ($post_count->private > 0) { $types_array["{$type}-private"] = $post_count->private; } } } if (count($types_array) > 0) { ?> <!-- Custom post type Start--> <h4><?php _e('Select the custom post type whose post you want to delete', 'bulk-delete'); ?> </h4> <fieldset class="options"> <table class="optiontable"> <?php foreach ($types_array as $type => $count) { ?> <tr> <td scope="row" > <input name="smbd_types[]" value="<?php echo $type; ?> " type="checkbox"> </td> <td> <label for="smbd_types"><?php echo BD_Util::display_post_type_status($type), ' (', $count, ')'; ?> </label> </td> </tr> <?php } bd_render_filtering_table_header(); bd_render_restrict_settings('types'); bd_render_delete_settings('types'); bd_render_limit_settings('types'); bd_render_cron_settings('types', 'http://bulkwp.com/addons/scheduler-for-deleting-posts-by-post-type/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-spt'); ?> </table> </fieldset> <?php bd_render_submit_button('delete_posts_by_post_type'); } else { printf('<h4>%s</h4>', __("You don't have any posts assigned to custom post types in this blog.", 'bulk-delete')); } }
/** * Render restrict settings. * * @since 5.5 */ protected function render_restrict_settings() { bd_render_restrict_settings($this->field_slug, $this->item_type); }
/** * Render delete pages by page status box * * @access public * @static * @since 5.0 */ public static function render_delete_pages_by_status_box() { if (BD_Util::is_pages_box_hidden(Bulk_Delete::BOX_PAGE_STATUS)) { printf(__('This section just got enabled. Kindly <a href = "%1$s">refresh</a> the page to fully enable it.', 'bulk-delete'), 'admin.php?page=' . Bulk_Delete::PAGES_PAGE_SLUG); return; } $pages_count = wp_count_posts('page'); $pages = $pages_count->publish; $page_drafts = $pages_count->draft; $page_future = $pages_count->future; $page_pending = $pages_count->pending; $page_private = $pages_count->private; ?> <!-- Pages start--> <h4><?php _e('Select the pages which you want to delete', 'bulk-delete'); ?> </h4> <fieldset class="options"> <table class="optiontable"> <tr> <td> <input name="smbd_published_pages" value="published_pages" type="checkbox"> <label for="smbd_published_pages"><?php _e('All Published Pages', 'bulk-delete'); ?> (<?php echo $pages . ' '; _e('Pages', 'bulk-delete'); ?> )</label> </td> </tr> <tr> <td> <input name="smbd_draft_pages" value="draft_pages" type="checkbox"> <label for="smbd_draft_pages"><?php _e('All Draft Pages', 'bulk-delete'); ?> (<?php echo $page_drafts . ' '; _e('Pages', 'bulk-delete'); ?> )</label> </td> </tr> <tr> <td> <input name="smbd_future_pages" value="scheduled_pages" type="checkbox"> <label for="smbd_future_pages"><?php _e('All Scheduled Pages', 'bulk-delete'); ?> (<?php echo $page_future . ' '; _e('Pages', 'bulk-delete'); ?> )</label> </td> </tr> <tr> <td> <input name="smbd_pending_pages" value="pending_pages" type="checkbox"> <label for="smbd_pending_pages"><?php _e('All Pending Pages', 'bulk-delete'); ?> (<?php echo $page_pending . ' '; _e('Pages', 'bulk-delete'); ?> )</label> </td> </tr> <tr> <td> <input name="smbd_private_pages" value="private_pages" type="checkbox"> <label for="smbd_private_pages"><?php _e('All Private Pages', 'bulk-delete'); ?> (<?php echo $page_private . ' '; _e('Pages', 'bulk-delete'); ?> )</label> </td> </tr> </table> <table class="optiontable"> <?php bd_render_filtering_table_header(); bd_render_restrict_settings('pages', 'pages'); bd_render_delete_settings('pages'); bd_render_limit_settings('pages'); bd_render_cron_settings('pages', 'http://bulkwp.com/addons/scheduler-for-deleting-pages-by-status/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-sp'); ?> </table> </fieldset> <?php bd_render_submit_button('delete_pages_by_status'); }