Any idea why wp_create_category would fail?

I’m having a weird situation where wp_create_category fails inexplicably. I have three lines:

zenpress_debug_log("Before wp_create_category for " . $upload_story["data"]["category"]);
$category_id = wp_create_category($upload_story["data"]["category"]);
zenpress_debug_log("After wp_create_category, category id: " . $category_id);

The first line writes “Before wp_create_category for Lotus Sametime” to my logfile.

But the second log statement is never written, which seems to imply that the program crashes in the wp_create category statement.

The only other unusual aspect if this is I’m calling this function from a wget, not a web page, and I’m using switch_to_blog to tell WP which blog in my MU installation to work with. However, all indications are that all of that work, because all my debugging statements prior to this one work just fine.

So any idea why wp_create_category would fail? Oh, I checked and the only category currently in this blog is the default category. Nothing else has been created yet.

Thanks

  • aecnu
    • WP Unicorn

    Greetings David :slight_smile:

    sir I do not see anything out of order here but I would try adding more then just the default category to parse to see if there is a different reaction then.

    In addition sir, are there any error indicators in your server logs that may point to what thee failure may possibly be?

    Joe :slight_smile:

  • aecnu
    • WP Unicorn

    Greetings David,

    It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn’t resolved, or you have any more questions related to this thread, please feel free to post them below and tick the ‘Mark as Not Resolved (re-open)’ box below the post area (or else we’ll miss it!)

    If you could please post any new symptoms or errors here.

    Thank you for being a WPMU Dev member!

    Cheers, Joe :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.