Error: Call to a member function get_error_code() on a non-object

Your function must return the variable $errors – even when there is no new error in your logic. ‘registration_errors’ is a filter, and filters always expect a return value. Without that your function returns NULL, and that is what var_dump() found. So the basic function body should be: function add_user_to_SF($errors, $sanitized_user_login, $user_email ) { try … Read more

Fatal error: Cannot redeclare admin_notice() [closed]

Ok, solved my own issue… This might be very specific, but in case anyone ever finds a similar issue: to catch unexpected output errors I had another function: add_action(‘activated_plugin’,’save_error’); function save_error(){ $file = “unexpected-output.txt”; $fh = fopen($file, ‘w’) or die(“can’t open file”); $error = ob_get_contents(); fclose($fh); } there was a typo in the fopen(), which … Read more

Error with function in functions.php?

These two lines are wrong: add_action(‘wp_ajax_get_data’, mm_get_all_informations); add_action(‘wp_ajax_nopriv_get_data’, mm_get_all_informations); You need to quote the function name: add_action(‘wp_ajax_get_data’, ‘mm_get_all_informations’); add_action(‘wp_ajax_nopriv_get_data’, ‘mm_get_all_informations’); If you had debugging enabled, as you should when you are working, you would have spotted the problem immediately.

Syntax error in a shortcode function

You need to escape your quotes, or use doubles, or use heredoc: // Escaped return ‘<div id=”xxxx-xxxxxx”></div> <script type=”text/javascript”> window._taboola = window._taboola || []; _taboola.push({ mode: \’xxxxxxx-xxxxx\’, container: \’xxxxxx-xxxxxxx\’, placement: \’one word word\’, target_type: \’mix\’ }); </script>’; // Doubles return ‘<div id=”xxxx-xxxxxx”></div> <script type=”text/javascript”> window._taboola = window._taboola || []; _taboola.push({ mode: “xxxxxxx-xxxxx”, container: “xxxxxx-xxxxxxx”, placement: … Read more

WordPress crashed during update

Some files were not copied during update. You need to copy again wp-includes/functions.php to define wp_raise_memory_limit(), but it’s better to upload again all files and folders of wp-includes and wp-admin, as soon as you correct this error, another one will certainly appears, and until all required WordPress files will not be there…

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)