CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    1

    Need help using Wordpress Plugin in PHP script

    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:

    PHP Code:
    <?
    //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??
    Last edited by PeejAvery; November 10th, 2010 at 06:51 PM. Reason: Corrected PHP tags

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Need help using Wordpress Plugin in PHP script

    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.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured