I am making a plugin which is called directly, from AJAX or similar. I’m using the SHORTINIT constant to speed up the load.
I need to use the function get_posts, which is declared in one of WordPress’s include files, which again depends on more include-files. How can I include and use this function effectively, without including a lot of other things I might not need, and that will slow down the page load?
It can easily be fixed by including the
wp-load.php-file.To avoid loading in all of the files, do something similar to this:
That’s all the files you’ll need, and can be a pretty effective solution if you know the precise path of the file.