: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @package WP_Bulk_Delete
* @subpackage Admin/Pages
* @copyright Copyright (c) 2016, Dharmesh Patel
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
* Render the delete posts page contents.
function wpbd_delete_posts_page(){
<h2><?php esc_html_e('Delete Posts','wp-bulk-delete'); ?></h2>
// Set Default Tab to Cleanup
$active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'cleanup';
<div id="post-body" class="metabox-holder columns-2">
<div class="notice notice-warning">
<p><strong><?php _e( 'WARNING: Before you delete any post please first take Backup, any delete operation done is irreversible. Please use it with caution!', 'wp-bulk-delete' ); ?></strong></p>
<?php do_action( 'timeout_memory_is_enough'); ?>
<div class="delete_notice"></div>
<div id="postbox-container-1" class="postbox-container">
<?php do_action('wpbd_admin_sidebar'); ?>
<div id="postbox-container-2" class="postbox-container">
<h1 class="nav-tab-wrapper" style="padding-bottom: 0px">
<a href="?page=delete_all_posts&tab=cleanup" class="nav-tab <?php echo $active_tab == 'cleanup' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'Cleanup', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=by_posttype" class="nav-tab <?php echo $active_tab == 'by_posttype' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'By Posttype', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=by_taxonomy" class="nav-tab <?php echo $active_tab == 'by_taxonomy' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'By Taxonomy', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=by_author" class="nav-tab <?php echo $active_tab == 'by_author' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'By Author', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=by_title" class="nav-tab <?php echo $active_tab == 'by_title' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'By Title or Content', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=by_customfield" class="nav-tab <?php echo $active_tab == 'by_customfield' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'By Custom fields', 'wp-bulk-delete' ); ?>
<a href="?page=delete_all_posts&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>">
<?php esc_attr_e( 'General (By All)', 'wp-bulk-delete' ); ?>
if( $active_tab == 'general' || $active_tab == 'by_taxonomy' || $active_tab == 'by_author' || $active_tab == 'by_title' || $active_tab == 'by_posttype' || $active_tab == 'by_customfield' ) {
// load General Post Delete Form
require_once WPBD_PLUGIN_DIR . 'includes/admin/posts/wp-bulk-delete-posts.php';
if( $active_tab == 'cleanup' ){
wpbd_cleanup_form( 'post' );