Skip to content

Instantly share code, notes, and snippets.

@d1rk
Forked from anonymous/gist:1731344
Created February 3, 2012 17:45
Show Gist options
  • Save d1rk/1731351 to your computer and use it in GitHub Desktop.
Save d1rk/1731351 to your computer and use it in GitHub Desktop.
Wordpress in Li3
public function load()
{
global $PHP_SELF;
global $wp_embed;
global $wpdb;
$db = Connections::get('default', array('config'=>true));
//set connection to inboundink database just so it has a valid connection for now
//when actually doing something, it will connect to the appropriate db
define('DB_HOST', $db['host'] );
define('DB_NAME', $db['database'] );
define('DB_USER', $db['login'] );
define('DB_PASSWORD', $db['password'] );
define ( 'WP_INSTALLING', true );//to trick wordpress
define ( 'WP_POST_REVISIONS', false );
define ( 'SHORTINIT' , true );
require_once Libraries::get('wp', 'path') . "/wp-load.php" ;
require_once Libraries::get('wp', 'path') . "/wp-includes/wp-db.php";
require_once Libraries::get('wp', 'path') . "/wp-includes/registration.php";
require_once Libraries::get('wp', 'path') . "/wp-admin/includes/taxonomy.php";
require_once Libraries::get('wp', 'path') . "/wp-admin/includes/bookmark.php";
require_once Libraries::get('wp', 'path') . "/wp-admin/includes/theme.php";
require_once Libraries::get('wp', 'path') . "/wp-includes/kses.php";
kses_init_filters();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment