Click to See Complete Forum and Search --> : PHP Need help using Wordpress Plugin in PHP script


meriad
November 10th, 2010, 01:15 PM
Hello:

I am trying to create a PHP script to import new posts into wordpress. All new posts come from a csv file. Unfortunately the csv file does not contain and keywords that I can use for tags in my wordpress post. I found a wordpress plugin that works to create tags in wordpress here: http://wordpress.org/extend/plugins/auto-tag/

What I would like to do is 'run' the plugin, right after a mysql statement(s) to load a new post into wordpress.

so far I have created this script:

<?
//echo "Here";
include './wp-content/plugins/auto-tag/auto-tag.php';
include './wp-includes/plugin.php';
include './wp-includes/post.php';
include './wp-includes/functions.php';
include './wp-includes/cache.php';
auto_tag::tag_posts(11);//------adding tags to post 11
?>

but I am getting this error

Fatal error: Call to a member function get() on a non-object in /home/soldquic/public_html/payabill/wp-includes/cache.php on line 93

The way I figure, I have not modified any of the core files for Wordpress, so there should not be an error in those files. How can I correct the error??

PeejAvery
November 10th, 2010, 05:52 PM
Have you changed the order of calling the included files? That can also make a difference. Either way, on line 93 of cache.php, there is a variable being treated as an object, that has either not yet been created, or is not an object.