Monday, 26 August 2013
What is the Object for WP_Error Class?
What is the Object for WP_Error Class? References i want to know what is the object for WP_Error Class located in wp-includes/class-wp-error.php because i used a custom registration form plugin in there for validation i used this below function function custom_validation($errors) { if (($_POST[\'birthday\']) != 1) $errors->add(\'birthday\', \"ERROR:\" . please finish birthday); return $errors; } add_filter(\'registration_errors\', array(\'customregistration\', \'custom_validation\'), 10, 3); Above function works fine with WordPress default themes(twentytwelve,twentyeleven). but if i use with other themes on registration it shows Call to a member function add() on a non-object So i searched for $errors object in WP_Error Class but i couldn\'t able to see a new keyword which is used to create an object for a class. Now what is the object for WP_Error Class? if it is $errors then why am i facing a fatal error called Call to a member function add() on a non-object? i can\'t able to see a class instance in WP_Error by using new keyword. if it not $errors how this is working in default theme? Note:Other theme registration page looks different from default registration page.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment