Cannot add user fields
-
Your plugin fails here, most notably fails to add user fields (status 500 Internal server error) even before I have tried to use it for real. I found the reason. My
wp-config.phpis not located where you assume it to be.A plugin cannot know where to find wp-config.php. It may be either in the root folder or the folder above it. Including
wp-config.phpis always wrong. To load WordPress from a plugin file, and axjax handler, likephp/add_field.phpyou may usewp-load.php, even if such a way to implement ajax is also bad.Please substitute
` require_once(“../../../../wp-config.php”);
with
require_once("../../../../wp-load.php");But to do it properly read this
http://solislab.com/blog/5-tips-for-using-ajax-in-wordpress/
The topic ‘Cannot add user fields’ is closed to new replies.