[wp-hackers] Fatal error: Call to undefined function wp_insert_category() in ....

Haluk Karamete halukkaramete at gmail.com
Fri Apr 6 00:27:52 UTC 2012


I run the following function in a standalone php file.

$cat_defaults = array(
  'cat_name' => 'Religion',
  'category_description' => '',
  'category_nicename' => '',
   'category_slug' => 'Religion',
  'category_parent' => '' );

$my_cat_id = wp_insert_category( $cat_defaults );

and this comes back with

Fatal error: Call to undefined function wp_insert_category() in ....


The php file has the following on top!

<?php

error_reporting (E_ALL);

$which_wordpress = "/ic2";

$full_path_to_wp_header = "F:\inetpub\wwwroot\whatever\wp-blog-header.php";

include ($full_path_to_wp_header);

define('WP_USE_THEMES', false);

echo bloginfo();  //this DOES report the blog title! I thought this was the
proof that whole wordpress she-bang loaded! I guess I'm wrong!

?>


More information about the wp-hackers mailing list