The MU forums have moved to

Turn off Global Categories (2 posts)

  1. deanbag
    Posted 16 years ago #

    When inserting a new category, Wordpress MU diverges from Wordpress 2.2.1 in admin-db.php, by generating a very large id:
    $maxcat = $wpdb->get_var( "SELECT max(cat_ID) FROM {$wpdb->categories}" );
    $cat_ID = mt_rand( $maxcat+100, $maxcat+4000 );

    instead of generating the next highest ID as 2.2.1 does.

    the global categories plugin modifies the cat_ID to match the insert_id in global categories, but what if I don't want to use global categories, by removing the global-categories.php from mu-plugins, or commenting out its hook?

    Then my wp_##_categories table will get a succession of very large ids, since it's calling mt_rand( $maxcat+100, $maxcat+4000 ); each time, probably exhausting the limit of the column quickly.

    Maybe i just don't understand why it doesn't use the next id, like 2.2.1 does, can someone explain?

  2. drmiketemp
    Posted 16 years ago #

    I have to ask. Have you tried searching the forums on this topic? It's been discussed at some length a few months ago.

    It's up to you. The software is open source. If you want to remove global categories and edit the $cat_ID line to do a +1, you're free to do so.

About this Topic

  • Started 16 years ago by deanbag
  • Latest reply from drmiketemp