Problems with included files when using WordPress functions
-
I’m trying to write a script that uses the following WordPress functions:
wp_insert_post()
,wp_create_user()
andusername_exists()
.The script is located outside the WordPress root directory, so I need to manually include the files where these functions are defined. Using trial and error and looking up the source file for each function on the Codex, I came up with this:
include("../wp-includes/plugin.php"); include("../wp-includes/pluggable.php"); include("../wp-includes/post.php"); include("../wp-includes/user.php"); include("../wp-includes/registration.php"); include("../wp-includes/formatting.php");
But even this isn’t enough. I still get a weird cache class error.
Is there a better way to do what I’m doing? This way just seems very hacky.
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problems with included files when using WordPress functions’ is closed to new replies.