Skip to content

Instantly share code, notes, and snippets.

@spencejs
spencejs / Right Now Box
Created March 22, 2013 03:27
Add all custom post types and taxonomies to the "Right Now" box on the Wordpress Dashboard
// Add all custom post types and taxonomies to the "Right Now" box on the Dashboard
add_action( 'right_now_content_table_end' , 'ucc_right_now_content_table_end' );
function ucc_right_now_content_table_end() {
$args = array(
'public' => true ,
'_builtin' => false
);
$output = 'object';
$operator = 'and';
@spencejs
spencejs / Admin Alert
Created March 22, 2013 03:23
Add Alert to Wordpress Admin
//New User Alert
add_action( 'admin_notices', 'custom_error_notice' );
function custom_error_notice(){
global $current_user;
get_currentuserinfo();
$author_info = get_userdata($current_user->ID);
if($author_info->title == '')
echo '<div class="error"><p><strong>New User:</strong> Please visit your <a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php" title="Your Profile">Profile</a> to Fill in your Job Title and set your Display Name. This alert will go away when you Job Title is set.</p></div>';
}