Multi site error when registering users

By Aaron / February 3, 2016 /

I was getting this message on a multi site install that I was working on: Usernames can only contain lowercase letters (a-z) and numbers. I haven’t dug into this yet, it seems like this popped up in WP 4.4. Here is how I have gotten around it: function amr_wpmu_validate_user_signup( $userinfo ) { if ( array_key_exists(…

Read More

How to limit the access of the content based on user’s registration date

By Aaron / August 10, 2015 /

A friend of mine has a paid and subscription based site. He wanted the site to limit access to content based on a user’s registration date. For example, if a user registered in August, he didn’t want him to be able to see the content from July and past content. This is one way to…

Read More

Adding code to allow an iframe in WordPress

By Aaron / July 27, 2015 /

I know there are security risks, a bad implementation, bad user experience, etc, but sometimes the client insists on it. Here is how allow iframes in posts and pages: add_filter( ‘wp_kses_allowed_html’, ‘ar_allowed_tags_filter’, 1, 1 ); function ar_allowed_tags_filter( $allowed_tags ) { if ( ! current_user_can( ‘publish_posts’ ) ) { return $allowedposttags; } $allowed_tags[‘iframe’] = array( ‘align’…

Read More

Quick and Dirty way to add code some Javascript to a footer

By Aaron / May 20, 2015 /

I every once and a while a client needs me to add some kind of Javascript code to the site. Most time it is a Google snippet or something for Facebook. It is always for tracking purposes. Just open functions.php and add this in the file. function ar_add_facebook_snippet() { ?>

Read More

Follow me on Twitter