How to Change the Width of the Reading List Sidebar in Safari

For the record, I know this is a silly hack.

Add a new item to the `~/Library/Preferences/com.apple.Safari.plist` file:

Key: `SidebarSplitViewDividerPosition`
Type: "Number"
Value: `400`

For the value, use whatever width you want in the number of pixels. I think I like 400.

Generate a Link to Activate a Plugin in WordPress

Here’s another specialized plugin development tip!

If you want to create a link to activate a plugin, you need to know the path of the plugin file. Let’s use Akismet for this example.

$path = 'akismet/akismet.php';
$link = wp_nonce_url(admin_url('plugins.php?action=activate&plugin='.$path), 'activate-plugin_'.$path);

The `$link` URL will be something like http://yoursite.com/wp-admin/plugins.php?action=activate&plugin=akismet%2Fakismet.php&_wpnonce=f97dabdf9

How to Hard-Code a UA String for the Google Analytics for WordPress Plugin

If you want to define a Google Analytics “UA String” while using Yoast Google Analytics┬áplugin for WordPress.

Add the following to your theme’s `functions.php` file:

add_filter( 'option_Yoast_Google_Analytics', 'custom_ua_string_filter');

function custom_ua_string_filter($options = array()) {
	$options['uastring'] = 'UA-########-#';
	$options['manual_uastring'] = true;
	return $options;
}

For users of WordPress Multisite, this will allow you to pre-configure new blogs with the same UA string.

Merge Settings Into an Array in WordPress

Arrays Merging

I found people are coming to this site (to an unrelated article) looking for a way to merge settings into an array.

You’re looking for `wp_parse_args()`

The main function for WordPress to do this is `wp_parse_args()`. You likely want this function.

Learn more about `wp_parse_args()`

Also consider `shortcode_atts()`

This is used for parsing shortcode options. It only supports defined arguments.

Learn more about `shortcode_atts()`

Easy Content Deployment for WordPress: RAMP

RAMP allows you to make all the changes you need in your staging environment, then selectively push these changes to your production site. You can set up a new section of your site, upload some images to fill out a nice carousel for it, and add a link to it on your home page. Once this content has been reviewed and approved, you can go to your RAMP page, select these content changes, and push them to your production site.

via Easy Content Deployment for WordPress: RAMP.

This would be really handy for larger WordPress sites.