WordPress config snippet for dynamic domains

Quite why this isn’t how WordPress works by default, I’ll probably never know. $domain = ‘http’ . (false ? ‘s’ : ”) . ‘://’ . $_SERVER[‘HTTP_HOST’]; define( ‘WP_SITEURL’, $domain ); define( ‘WP_HOME’, $domain ); If anything, this snippet is for my own reference. Prevents redirects on development / staging sites without changing the wp-config.php

CSS3: Rounded Table Corners (No images)

You cannot give a whole table (<table>) rounded corners using CSS, browsers will ignore it, you must round the corners of the cells (<td>) inside. The following uses CSS2 selectors (:first-child etc) and CSS3’s corner-rounding border-radius to selectively round the outer corners of the cells in the corners. This will work for any size table. … Read moreCSS3: Rounded Table Corners (No images)

PHP Bug: json_encode() misleading warning on object with private properties

I have found a peculiar issue with PHP’s json_encode() function. If you have an instance object with private properties and use json_encode() it will give you a very misleading warning. class ExampleObject { private $privateProperty; … } $obj = new ExampleObject(); json_encode($obj); results in Warning: json_encode() … recursion detected … There are two workarounds in … Read morePHP Bug: json_encode() misleading warning on object with private properties