How Restore DELETE Blog to WPMU

Hi Everyone,

I had a programmer remove the ability for users to delete their own blogs.

Now I want to restore that functionality to users, but have no idea what the programmer did to remove it in the first place. :slight_frown:

He was supposed to just remark out that section so I could restore it if necessary, but he never left documentation on where he did it.

Can someone tell me:

1) Which menu / sub-menu a user would click to access the delete blog function

2) Which script(s) would contain the code that my ex-programmer modified?

Thanks,

..Mike

  • Andrew
    • Champion of Loops

    Hiya,

    The code that tosses out the delete blog page is in wp-includes/wpmu-functions.php. Unless you’ve made hacks to that file I’d just upload a fresh copy.

    He may have used a plugin to disable it so check for that as well.

    Thanks,

    Andrew

  • mikee17
    • Site Builder, Child of Zeus

    Andrew,

    I’m going nuts trying to figure this out. It looks like the code is there. The problem is he modified wpmu-functions.php and I don’t just want to replace it.

    Could you tell me what page the delete link appears and that the URL is for it?

    That would help a bunch.

    Thanks,

    ..Mike

  • mikee17
    • Site Builder, Child of Zeus

    Andrew,

    I compared it with the original unedited copy and I can’t see what was changed.

    I really hate being a pest, but…

    Could you tell me what page the delete link appears and that the URL is for it?

    That would help a bunch.

    Thanks,

    ..Mike

  • Andrew
    • Champion of Loops

    Hiya,

    Could you tell me what page the delete link appears and that the URL is for it?

    This bit from wpmu-functions.php adds the menu item:

    function admin_menu() {
    global $current_blog, $current_site;
    if( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path )
    add_submenu_page('options-general.php', __('Delete Blog'), __('Delete Blog'), 'manage_options', 'delete-blog', array(&$this, 'plugin_content'));
    }

    Thanks,

    Andrew

  • Andrew
    • Champion of Loops

    Hi Mike,

    The link is:

    http://domain.tld/wp-admin/options-general.php?page=delete-blog

    I’m not sure this will help you much though. The code I referenced in my last post adds the Delete Blog page. If that code isn’t being executed for some reason then just hardcoding the link won’t do much good.

    Unfortunately I really cant offer further assistance with this. Typically you would either comment out/remove the code in wpmu-functions.php or use a plugin to remove that menu item. Neither of those seem to be the case here so it’s really just a guessing game.

    Thanks,

    Andrew

  • drmike
    • DEV MAN’s Mascot

    You’re not looking at this from your main blog by any chance, are you? You won’t see the link on your main blog. I had a client delete their Blog #1 a few months back and to prevent it from happening again, Donncha put code in there to prevent the link for showing up on root blogs.

    Please try logging in as an end user to see if the link is showing.

  • mikee17
    • Site Builder, Child of Zeus

    drmike,

    I’ve tried multiple blogs in my own account.

    The problem is I’m not sure where I would normally find the delete as the user. Is it a menu/sub-menu pick or does it appear on the page?

    My programmer has done a LOT of customization to the

    /wp-admin/options-general.php page.

    What menu clicks and URL would the user be on to see the Delete button?

    Thanks,

    ..Mike

  • andrea_r
    • The Incredible Code Injector

    The URL is wp-admin/options-general.php?page=delete-blog

    It woudl be a sub-menu item under the Settings menu. If you had a programmer mess with the options, then I’d go ask him where it went, and double-check to see if you’d asked him to remove it at some point.

  • mikee17
    • Site Builder, Child of Zeus

    andrea_r & andrew,

    Okay… Solved the mystery.

    in wp-admin/menu.php I had to add a line.

    I pasted the code below, but here’s the WEIRD part. I can put ANYTHING in array item[41] and then Delete Blog came back up.

    $submenu[41] = array(__(‘BOZO THE CLOWN’:wink:, ‘manage_options’, ‘options-misc.php’:wink:;

    So, it’s working, but I’m still not sure exactly why…

    Thanks for your input.

    ..Mike

    $submenu[10] = array(__(‘General’:wink:, ‘manage_options’, ‘options-general.php’:wink:;

    $submenu[15] = array(__(‘Writing’:wink:, ‘manage_options’, ‘options-writing.php’:wink:;

    $submenu[20] = array(__(‘Reading’:wink:, ‘manage_options’, ‘options-reading.php’:wink:;

    $submenu[25] = array(__(‘Discussion’:wink:, ‘manage_options’, ‘options-discussion.php’:wink:;

    $submenu[30] = array(__(‘Privacy’:wink:, ‘manage_options’, ‘options-privacy.php’:wink:;

    $submenu[35] = array(__(‘Permalinks’:wink:, ‘manage_options’, ‘options-permalink.php’:wink:;

    $submenu[40] = array(__(‘Miscellaneous’:wink:, ‘manage_options’, ‘options-misc.php’:wink:;

    //MJE 20090310 This is VERY weird. I added the line below and then the Delete option came back.

    $submenu[41] = array(__(‘Delete Blog’:wink:, ‘manage_options’, ‘options-misc.php’:wink:;