Similar Posts
Deleting emails older than 2 years
Byeminoto view: find /home/*/mail/*/*/cur -mtime +729 -type f -ls to delete: find /home/*/mail/*/*/cur -mtime +729 -type f -delete
Extending password protected posts with name and email
ByeminoIf you want to add name email or any additional fields in addition to password for protected posts, see the steps below: /****************** custom protected post form *****/ add_filter( ‘the_password_form’, ‘custom_password_form’ ); function custom_password_form() { global $post; $label = ‘pwbox-‘.( empty( $post->ID ) ? rand() : $post->ID ); $a = ‘<div class=”clearfix”><form id=”password_form” class=”protected-post-form” action=”‘…
How to get random tags in wordpress
ByeminoI 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…
Do not create accounts with these names
ByeminoCommon names are priority targets for brute force attacks. Avoid creating email and account names including words listed below. The data has been collected from a vast number of attempts, chosen the most frequent ones, plus some random sampling. Ironically, pretty sure these keywords will only attract more spam, but I hope it helps someone….
Notify user for post status change
Byemino<?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…
The server quit without updating PID file and all that jazz.
ByeminoThe story: I was getting session file write errors (write failed: No space left on device (28) ) in wp admin, i checked /tmp folder but it was not full, only 60% percent was used. So not being able to pinpoint what the problem was, i thought a reboot would be a good idea. But…