Advertisement
daymobrew

WordPress MultiSite - Delete Sample Content

Sep 1st, 2015
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: WordPress MultiSite Delete Sample Content
  4. Plugin URI: http://www.damiencarbery.com
  5. Description: Delete the sample post, page and comment that is created for a new site in a WordPress MultiSite installation.
  6. Author: Damien Carbery
  7. Version: 0.1
  8.  
  9. $Id:  $
  10. */
  11.  
  12.  
  13. function wpms_delete_sample_content($blog_id, $user_id, $domain, $path, $site_id, $meta) {
  14.     switch_to_blog($blog_id);
  15.  
  16.     wp_delete_comment( 1, true );
  17.     wp_delete_post(1, true);
  18.     wp_delete_post(2, true);
  19. }
  20.  
  21. add_action( 'wpmu_new_blog', 'wpms_delete_sample_content', 10, 6 );
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement