How To Prevent WordPress from Applying wpautop to a Page or Post

Author: , November 19th, 2019

All credit to Graham Walters for this excellent plugin and post, upon which this post is based – thank you, sir! https://grahamwalters.me/lab/disable-wpautop-on-specific-postspages/ Recently, a client was having problems using a plugin called by a shortcode. As it turned out, the JavaScript embedded in the returned content was being broken by the WordPress auto-paragraph feature known […]

How To Enable the WordPress Custom Fields Option Under the Screen Options Menu

Author: , November 19th, 2019

Normally, there is an option in the Screen Options menu to show or hide the Custom Fields tool. If this option is missing, you may have the plugin Advanced Custom Fields (ACF) version 5.5.13 or greater installed and active because ACF removes the Custom Fields tool to improve page load speed. If you do have […]

How To Dual-Sort Query Results In WordPress Using get_posts

Author: , September 12th, 2019

Needed to build a feature for a Bookstore tool to have an optional sequence number for the Custom Post Type “books” that would allow items with a seq number to float to the top of the list and be sorted by seq #. The rest of the books would show underneath, sorted alphabetically.

How To rsync Only Specific File Extensions

Author: , February 5th, 2017

rsync -avzn –progress –include=’*.png’ –include=’*/’ –exclude=’*’ /the/source/path/ user@theServer:/the/target/path/

How To Block an Entire TLD in Postfix

Author: , September 13th, 2016

Step 1. Execute the following two commands: postconf -e smtpd_sender_restrictions=pcre:/etc/postfix/rejected_domains postconf -e reject_unauth_destinations=pcre:/etc/postfix/rejected_domains If that doesn’t work, you may hand-edit main.cf and add/edit these lines:

Step 2. Create the regex filter file: vim /etc/postfix/rejected_domains

Step 3. Signal Postfix to reread the config: postfix reload NOTE: Do NOT use the postmap command for the […]

How To Export Apple Email Rules

Author: , November 10th, 2015

Quit Mail. Look for a file called MessageRules.plist under ~/Library/Mail. Depending on your Mail version it could be under ~/Library/Mail/V2/Maildata as well. Copy that file. It can be edited with vim or the PList editor. I find it much easier to work with as text in vim.

How To Select the Max Numeric in a Varchar Column in MySQL

Author: , October 2nd, 2015

I needed to automate the addition of new users with a sequential member’s ID in WordPress. Additionally, there were non-numeric entries in that column that had to be ignored. The wp_users.user_login column is a varchar(60) and so does not naturally handle numeric operations well at all. The solution is a combination of REGEXP and cast(): […]

How To Filter Blank Lines With GREP

Author: , May 23rd, 2010

[code] # filter blank lines grep -hv "^$" * # filter blank lines and comments grep -hv ‘^#’ * | grep -hv "^$" # filter blank lines, and comments, then count number of lines grep -hv ‘^#’ * | grep -hv "^$" | wc -l [/code] Note – using FreeBSD’s version of grep. The “-h” […]