The MU forums have moved to WordPress.org

which files to include (API) (5 posts)

  1. BlackMB
    Member
    Posted 16 years ago #

    Hi there,
    I'm trying to access the WPMU API from an other web application, but I'm not sure which files I have to include() to access the wpmu functions (namely get_most_active_blogs())

    thanks in advance,
    BlackMB

  2. tdjcbe
    Member
    Posted 16 years ago #

    You need to include the file /wp-blog-header.php to gain access to the other wordpress multiuser functions. Please note that I say that having never tried doing what you are doing.

  3. BlackMB
    Member
    Posted 16 years ago #

    If I include or require this file, I get redirected to blogdomain.de/wp-signup.php?new=test.php
    test.php being the name of the file which includes wp-blog-header.php.
    This file doesn't contain anything else, just

    <?php
    require('/location/wp-blog-header.php');
    ?>

    thanks in advance,
    BlackMB

  4. rfrovarp
    Member
    Posted 16 years ago #

    I have found this to work. Note that I am using HyperDB and I am just in the first testing phase.

    <?php

    require_once('/location/wp-config.php');
    require_once('/location/db-settings.php');
    require_once('/location/wp-includes/plugin.php');
    require_once('/location/wp-content/db.php');
    require_once('/location/wp-includes/wpmu-functions.php');

    print_r(get_most_active_blogs());

    ?>

  5. rfrovarp
    Member
    Posted 16 years ago #

    Actually, this appears to work and be all you need to get most everything included, including plugins:

    <?php

    require_once('/location/wp-config.php');

    get_most_active_blogs();
    ?>

    To see everything that is being included:

    <?php
    require_once('/location/wp-config.php');
    print_r(get_included_files());
    ?>

About this Topic

  • Started 16 years ago by BlackMB
  • Latest reply from rfrovarp