Change login error messages

you can do that using login_errors filter hook and here is how: add_filter(‘login_errors’,’login_error_message’); function login_error_message($error){ //check if that’s the error you are looking for $pos = strpos($error, ‘incorrect’); if (is_int($pos)) { //its the right error so you can overwrite it $error = “Wrong information”; } return $error; } update: i just tested the code and … Read more

How to catch/what to do with a WP Error Object

Assign return of the function to the variable. Check the variable with is_wp_error(). If true handle accordingly, for example trigger_error() with message from WP_Error->get_error_message() method. If false – proceed as usual. Usage: function create_custom_post() { $postarr = array(); $post = wp_insert_post($postarr); return $post; } $result = create_custom_post(); if ( is_wp_error($result) ){ echo $result->get_error_message(); }

Showing errors with $wpdb update

I would recommend running the following code right after your query to see what’s happening: exit( var_dump( $wpdb->last_query ) ); This should print the last query that hit your database. In cases like these, I usually will manually run such a query through phpMyAdmin to see if it runs without errors and to see if … Read more

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