Skip to content

Daniel Auener

Daniel Auener Daniel Auener

Check out my blog and what I’m working on right now

  • New Side Project – Re:Do Workouts App. Plan, train and track your routines March 17, 2026
  • The WordPresser’s Guide to the Fediverse December 17, 2022
  • 10 Reasons a Mastodon Migration Makes Sense for the WordPress Community (and others) December 8, 2022
  • Mastodon WordPress Instance November 19, 2022
  • Mastodon Instance for Kalmar started November 13, 2022

Links

Northosts AB – Small WordPress Agency in Kalmar

Re:Do Workouts App – for people who already know what they train

Northemes – WordPress Website Leasing 

wptoots.social – WordPress Community Mastodon Instance

wp-community-on-mastodon.wptoots.social – Curated list of the WordPress community on Mastodon

Author: daniel

Use echo inside a PHP one-line if statement

danielDecember 3, 2013December 3, 2013

I got some great answers on my latest Stack Overflow question on why echo doesn’t work inside a one-line if statement in PHP.

http://stackoverflow.com/questions/20346451/use-echo-inside-php-one-line-if-statement

PHP 00

WordPress history

danielNovember 21, 2013November 21, 2013

Can’t wait to read the rest: great preview of an upcoming book about the history of WordPress.
http://wordpress.org/about/history/chapter3.pdf
#wordpress #history

Misc 00

Shaun Andrews on improving WordPress Widgets

danielNovember 12, 2013November 12, 2013

Some great thoughts on improving WordPress Widgets. The admin-UI changes are totally convincing. I’d like to see some thoughts on how to solve the “How do I install widgets” problem. The comments, too, on widgets per post are absolutely worth reading.

http://www.shaunandrews.com/wordpress-widgets-initial-thoughts/

Misc 00

Great Grunt, goodbye CodeKit.

danielNovember 7, 2013January 16, 2014

I’m into Grunt now. Goodbye, CodeKit. #grunt #codekit

Misc, Workflow 00

WordPress register with email only, using Gravity Forms and User Registration add-on

danielNovember 7, 2013November 7, 2013
<?php

/**
 * WordPress register with email only, make it possible to register with email 
 * as username in a multisite installation
 * @param  Array $result Result array of the wpmu_validate_user_signup-function
 * @return Array         Altered result array
 */
function custom_register_with_email($result) {

	if ( $result['user_name'] != '' && is_email( $result['user_name'] ) ) {

		unset( $result['errors']->errors['user_name'] );

	}

	return $result;
}
add_filter('wpmu_validate_user_signup','custom_register_with_email');

?>

The snippet’s story

A few days ago, I implemented a custom user registration with WordPress. I used Gravity Forms with the User Registration add-on, which worked fine when the user had to choose a username manually. But we also wanted a quick-registration option on the homepage, which we wanted to work with only one form-field asking for an email-address. So I built a Gravity Form with just an email field and added a User Registration with the email-field linked both as the required user’s email and username.

This works fine with a single install, but with a multi-site installation the wpmu_validate_user_signup-function is used and we got an “Only lowercase letters (a-z) and numbers are allowed.” error-message. The above filter fixes this issue by undoing this validation error and forcing WordPress to accept an email address as username.

Snippets, Wordpress 022

Posts navigation

  • ←
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • …
  • 11
  • →
Daniel Auener Solutions AB
Org-nr: 559101-4575

ask@danielauener.com
+46 (0) 48 010 626