Alphanumeric usernames and error message for it

Check for alphanumeric For more details, look at the regex Q on SO. $name=”input string 123″; // Doesn”t allow: // Pre-/Appending white space // Not more than one space in between // Non-alphanumeric characters (lower case) if( ! preg_match( “/^[a-z0-9]+([\\s]{1}[a-z0-9]|[a-z0-9])+$/i”, $name ) ) { // Output Error Message } // Or: Does only allow // … Read more

Random HTTP 500 error in WordPress

If the problem is easily reproducible (i.e. you can make it happen again and again by following a set of steps), do this: Step 1: Document the steps required to cause the problem. Step 2: Document all of the plugins you have running Step 3: Deactivate all of your plugins! Step 4: Perform the steps … Read more

Post show up as post and pages

I just wanted to post the solution here instead of deleting just in case this ever helps anyone else. The problem was this 1 small function I had tucked away in a setting file… /** * change number of posts shown per page in admin area */ function admin_pagination(){ global $wp_query; $per_page = 5; $wp_query->query(‘showposts=”. … Read more

Form validation on user profile edit

I worked it out. add_action( ‘user_profile_update_errors’, ‘validate_steamid_field’ ); function validate_steamid_field(&$errors, $update = null, &$user = null) { if (!preg_match(“/^STEAM_[0-5]:[01]:\d+$/”, $_POST[‘_bbp_steamid’])) { $errors->add(’empty_steamid’, “<strong>ERROR</strong>: Please Enter a valid SteamID”); } }

warnings & errors after MAMP to live (hosteurope)

These are warnings, not errors ( edited original question to reflect this ). You have two options: The easy way – Turn off displaying errors and warnings, log them to a file instead The proper way – Fix the warnings, and log them to a file instead of outputting If you need help fixing the … Read more

WP_Error message

One of the variables you’re trying to pass into wpdb::prepare is a WP_Error object. WP_Error‘s are like exceptions mixed with return codes: some functions in the WordPress API return WP_Error objects to tell you something went wrong (like get_terms). We’ll need to see more of your code to be more specific, but you can test … Read more