Blog

Delete all transients from your WordPress multisite

Someone asked how he could delete all the transients from a WordPress multisite, as I wrote the code for him, thought to share it here for everyone 🙂 [php] if ( is_multisite() ) { global $wpdb; $all_sites = $wpdb->get_results( "SELECT * FROM $wpdb->blogs" ); if ( $all_sites ) { foreach ($all_sites as $site) { $wpdb->set_blog_id( … Continue reading Delete all transients from your WordPress multisite

Blocking user registration by country level domain in WordPress

Spammers are everywhere and in weDevs, every single day a lots of spammers are registering. Among of them “.pl” domains are mostly used. Enough is enough, so why not block them? Thats why wrote a function that will check the users email address and will find the country level domain (only the last part of … Continue reading Blocking user registration by country level domain in WordPress

Get attachment ID from “Insert into Post|Page” button

We always use this nifty “Insert into Post” button when uploading image in any types of field, including uploading a image for some meta field or anything else. Then we attach a JavaScript listener on window.send_to_editor and insert the attachment/image URL to the input field. Today I needed a way to get the attachment ID … Continue reading Get attachment ID from “Insert into Post|Page” button