Deleting emails older than 2 years
to view:
find /home/*/mail/*/*/cur -mtime +729 -type f -ls
to delete:
find /home/*/mail/*/*/cur -mtime +729 -type f -delete
Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.
<?php function notify_post_status( $post_id = NULL, $user = ” ) { if ( ! isset($_POST[“post_id”]) ) { $post_id = $_POST[“post_id”]; } else { return $post_id; } $post = get_post($post_id); $status = $post->post_status; $type = $post->post_type; $author_id = intval($post->post_author); $user = get_userdata( $author_id ); //ignore admin if( $author_id == 1 ) return; // Which statuses should…
There are various ways to get user_ID in WP. But which one is the fastest ? I’ve compared 3 ways function get_uid_from_global() { global $current_user; return $current_user->ID; } function get_uid_by_gcuid() { return get_current_user_id(); } function get_uid_by_wpgcu_id() { return wp_get_current_user()->ID; } Without a doubt, global method was fastest. With multiple 100,000 runs, global method took 0.9~…
I needed a placeholder for tags input but it’s boring to display the same tags every time. But unlike posts, WP doesnt have “rand” orderby paramater. So what you can do; is to get a #no of tags and shuffle them. So basically what we do is: Check if we have a recent transient If…
I ve searched low and high for this came across a lot of tips but none of them worked. Changing the “default beep” to (none) did nothing for me, it simply delegated to “exclamation” sound which was even worse. Best I could come up with was changing the “exclamation” sound to feed discovered 🙁 it…
As you know, 3-4 letter domains are hard to come by these days, even with not so popular .tlds. “So”, I had a 3 letter a .so domain to use mainly as an url shortener. FYI: .so is the tld for Somalia, the source of inspiration for the dankest memes of the internetz. Apart from…