WordPress -Allow contributor to upload media

Simple solution to the problem, no plugins required

if ( current_user_can('contributor') && !current_user_can('upload_files') )
	add_action('admin_init', 'allow_contributor_uploads');

function allow_contributor_uploads() {
	$contributor = get_role('contributor');
	$contributor->add_cap('upload_files');
}

this is courtesy of:

SoulSizzle

full list of capabilities that can be modified in this manner
http://codex.wordpress.org/Roles_and_Capabilities

Posted in wordpress | Comments closed

PHP date compare

Best method I found was converting each date via strtotime and then comparing the integer results.

$today = strtotime("Monday this week", strtotime(date("Y-m-d")));
$past_date = strtotime("Monday this week", strtotime('2011-08-29'));

if($today > $past_date){
    // current week
} else {
    // past week
}
Posted in php | Tagged , , | Comments closed

Unsubscribe Landing Page Examples

Was searching for good examples of unsubscribe landing page language, which was proving to be difficult, but, like any google search it’s just a matter of hitting on the right keywords:

unsubscribe sorry to see you go

Posted in google search | Tagged , , | Comments closed