Web Dev Snippets

A collection of (mostly) WordPress/ClassicPress-related snippets and references I’ve found useful and worth keeping where I can find them. Feel free to use what you like, and point me to some other snippets or references.

CSS3 Multiple Columns

Unfortunately, this is buggy with uneven column lengths. There may be some javascript that does this better.
CSS3 | Type: CSS

Custom TinyMCE Styles

Consider replacing current approach with this plugin (still need to remove h1, blockquote, etc from formats)
Custom Admin, TinyMCE, Users | Type: PHP

Date/Time Cheat Sheet

format description value z day of the year 01 to 365 N day of the week from Monday to Sunday 1 to 7 j day of [...]
Date/Time | Type: PHP

Date/Time Examples

$today = date('Ymd'); //string $testdate = get_field( 'test_date' ); //string $testerdate = DateTime::createFromFormat( 'Ymd', $testdate ); //convert string to object echo '<p>Today: '.$today.'</p> //string echo '<p>Test [...]
ACF, Date/Time, PHP | Type: PHP

Disable Gutenberg for selected Custom Post Types

function my_disable_gutenberg( $current_status, $post_type ) { // Disabled post types $disabled_post_types = array( 'book', 'movie' ); // Change $can_edit to false for any post types in [...]
CPT, PHP, WP/CP | Type: PHP

Disable WordPress Default Image Link

Disable annoying default image link in theme functions file. You can still make a link, but it won't be the default.
Custom Admin, Users | Type: PHP

Disable XML-RPC

In the functions file: add_filter('xmlrpc_enabled', '__return_false');
Security | Type: PHP

Disallow File Edit

Disable theme and plugin editor in admin.
Custom Admin, Users, wp-config | Type: PHP