Without the conditional statement:
require_once( dirname( __FILE__ ) . "/edit_info_check_password.php" );
works fine. But by simple adding:
if( substr($_SERVER["REQUEST_URI"], 18, 13) == "edit-userinfo" )
require_once( dirname( __FILE__ ) . "/edit_info_check_password.php" );
inside the functions.php file, then the functions inside the required file do not work completely. But they work partially. Why can't I keep the condition if i only want to include the file for a certain page?
EDIT - additional requested info:
basically trying to add the following actions inside the required file:
add_action( 'wp_enqueue_scripts', 'admin_ajax_setup' );
add_action( 'wp_ajax_ajax-checkpasswords', 'check_info_passwords' );
add_action("wp_ajax_nopriv_ajax-checkpasswords", "check_info_passwords");
The admin ajax setup function runs perfectly, it enqueues two javascript files and localized the admin ajax for javasscript access. That's great, but my jquery ajax function returns response 0. Whereas without the conditional statement, I get the full response. Obviously adding the condition changes the way functions.php works with required files.