Tag cloud highlighting

<?php

function wco_current_term_highlight($cloud){
if(!is_tax('wco_category')) return $cloud;
$wco_categories = get_terms('wco_category');
if($wco_categories === false) return $cloud;
foreach($wco_categories as $category) if(is_tax('wco_category',$category->slug)) $cloud = str_replace("tag-link-$category->term_id", "current-term tag-link-$category->term_id",$cloud);
return $cloud;
}
add_filter('wp_tag_cloud','wco_current_term_highlight');

?>

Role Worksheet

//Update user role
$u = new WP_User( 26 );
$u->remove_role( 'editor' );
$u->add_role( 'customrole' );

//Add new custom role
add_role('customrole', 'Customrole',array('read' => 1,'level_0' => 1,'access_level_0' => 1,'access_level_1' => 1));

//Remove Role
remove_role('customrole');

//Add capability
global $wp_roles;
$wp_roles->add_cap('customrole','access_level_1');

url shortener function

<?php
function url_shortener($url){
//url shortener from metiny.com
//this function can take any url and shorten it
$metiny_url="http://metiny.com/api.php?make_metiny=$url";//metiny.com api url
$file = file_get_contents($metiny_url);
echo $file;}
url_shortener('PUT-URL-HERE');//url shortener function
?>

simple profilecrib connect api WORKING

<a href="http://www.profilecrib.com/api/api_plugins/index.php?url=<?php //url to redirect back to
echo $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>"><img src="http://profilecrib.com/images/pc33.png" border="0">Syncronze with Profilecrib</a>

<?php
//simple profilecrib connect code can be easily modified
if(isset($_POST['profilecrib_userid'])){
$profilecrib_username=$_POST['profilecrib_username'];
$profilecrib_friend_count=$_POST['profilecrib_friend_count'];
$profilecrib_userid=$_POST['profilecrib_userid'];
$profilecrib_user_email=$_POST['profilecrib_user_email'];
$profilepic=$_POST['profilecrib_user_pic'];
echo "$profilecrib_username.<img src='$profilepic' /> has $profilecrib_friend_count Friends" ;
}

?>

simple profilecrib connect with php

<a href="http://www.profilecrib.com/api/api_plugins/index.php?url=<?php //url to redirect back to
echo $host.$_SERVER['REQUEST_URI'];?>"><img src="images/pc33.png" border="0">Syncronze with Profilecrib</a>

<?php
//simple profilecrib connect code can be easily modified
if(isset($_POST['profilecrib_userid'])){

$profilecrib_friend_count=$_POST['profilecrib_friend_count'];
$profilecrib_userid=$_POST['profilecrib_userid'];
$profilecrib_user_email=$_POST['profilecrib_user_email'];
$profilepic=$_POST['profilecrib_user_pic'];
echo "$profilecrib_username.<img src='$profilepic' /> has $profilecrib_friend_count Friends ;
}

?>

?>

profilecrib crib-it button

<iframe src="http://www.profilecrib.com/addthis/index.php?share=YOUR-URL-HERE"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>

Self comment template

<?php

/* Template Comment */
function wco_template_comment($file){
$replace = '/var/www/adam/weddingcolorado.org/wp-content/';
$template_loc = str_replace($replace,'',$file);
echo "<!-- Template: $template_loc -->";
}

//Add to the top of your template
wco_template_comment(__FILE__);

?>

Enqueue js conditional

<?php

define('WCO_MOO_ARRAY','/,/my-page/');

//Register Moo
function wco_register_moo(){ wp_register_script('wco_moo','mootools-core-1.3.2-full-compat-yc.js'); }

//Enqueue Moo
function wco_enqueue_moo(){
$moo_array = explode(',',WCO_MOO_ARRAY);
if(in_array($_SERVER['REQUEST_URI'],$moo_array)) wp_enqueue_script('wco_moo');
}

add_action('init','wco_register_moo');
add_action('wp_print_scripts','wco_enqueue_moo');

?>