Austin Passy Los Angeles WordPress developer

WordPress developer.

  • About
  • WordPress
    • Plugins
      • SEO Media File Renamer
      • Camera+ Widget
      • YouTube White Label Shortcode
      • Featured Image Column
      • @Anywhere
      • Custom Login
      • Comment Validation Reloaded
      • Eventbrite Shortcode
      • Announcement Bar
      • Hide and Catch Email
    • Themes
      • Rock N’ Rolla
    • Code Snippets
  • Presentations
    • WordCamp
      • Miami
      • Phoenix
      • Los Angeles
      • Portland
      • Orange County
  • Portfolio
  • Contact
  • Categories
    • General
    • WordPress
    • Tutorials
    • jQuery
    • Galleries
    • asides
    • Photos
    • Stuff
    • Uncategorized

Announcement

  • Announcing: Custom Login PRO – Pro version of Custom Login by yours truly.
  • Announcing: Frosty Themes ☃ – Custom built WordPress themes by yours truly.
  • Photographer? Checkout Photography Blog Sites WordPress portfolio made easy
  • I use Dropbox everyday!
  • This site is faster thanks to MAX CDN.
  • NEW: Camera+ WordPress widget get the plugin.

Extending the WordPress admin_body_class

Pulished May 18, 2010 | 2 Responses
WordPress admin

I’m working on a new WordPress theme for release with 3.0 that includes many new post_types. One problem I found was that if I wanted to not include the editor but allow for photo uploads, the Insert into Post button would no longer appear. But I didn’t want the end user to have access to the editor. So I thought I would remove or hide the editor with CSS or DOM manipulation. One problem I noticed is the admin classes are pretty weak, so I thought to beef it up with a custom class on my post_types.

Here is the snippet to extend the WordPress admin_body_class.

function wpwag_admin_body_class( $classes ) {
	global $wpdb, $post;
	$post_type = get_post_type( $post->ID );
	if ( is_admin() && ( $post_type == 'photo' ) ) {
        $classes .= 'post_type-' . $post_type;
	}
	return $classes;
}

This will then output on my post_type Photo: post_type-photo. Sweet!

Don’t forget to add the correct filter:

add_filter( 'admin_body_class', 'wpwag_admin_body_class' );
Posted in Snippets Tagged admin_body_class, Custom Post Types, functions.php

Custom post type "jokes" plus my code snippet

Pulished May 12, 2010 | 1 Response
Custom Post Types

My PHP code snippet for creating a Custom Post Type in WordPress 3.x or greater →

Continue reading →

Capturing the URL anchor with jQuery & flashing an element

Pulished May 10, 2010 | 6 Responses
jQuery Logo

Learn how to use the jQuery URL parser to capture an anchor tag in the URL, and then animate an element if that anchor is present. →

Continue reading →

Rock N' Rolla

Adding a custom default gravatar to your site

Pulished May 7, 2010
Gravatar Logo

Looking to get rid of that “Mystery Man”? Don’t like the Identicon or Wavatar? Learn how to add your own custom @Gravatar.. →

Continue reading →

Add a twitter field to your comments in Hybrid Framework

Pulished May 6, 2010 | 4 Responses
Theme Hybrid v0.8

Learn how to add a twitter field to your comments form in the Hybrid Framework, version 0.8 and WordPress 3.0. →

Continue reading →

Auto change "WP" and incorrect WordPress spellings

Pulished May 6, 2010
Wrong WordPress spelling

For the WordPress noobs, they are unfamiliar with the correct and proper spelling of WordPress, which is capital W and a capital P, all one word. →

Continue reading →

Starting a blog with WordPress 3 point oh

Pulished May 5, 2010 | 1 Response

In this post I am going to walk you through on how to download and install WordPress 3.x for the first time. →

Continue reading →
← Previous 1 … 9 10 11 … 35 Next →

Random photo

  • IMG_6993

Most Viewed

  • Custom Login - 54,367 views
  • Capturing the URL anchor w... - 18,581 views
  • Creating custom metaboxes ... - 15,398 views
  • Add a twitter field to you... - 11,939 views
  • Custom post type "jokes" p... - 9,337 views
  • Starting a blog with WordP... - 8,707 views
  • Adding a custom default gr... - 8,515 views
  • Auto change "WP" and incor... - 7,807 views
  • St Pattys day at the Roxy - 4,434 views
  • Camping at the Eagles Nest... - 4,021 views

Recommendations

Ad Sanity
InMotionHosting
MaxCDN
Namecheap

Recent Tweet

  • End of the Custom Login Pro, start of ShareYourCart sale frosty.me/2560 35 minutes ago
  • RT @WombatSoftball: Great win last night! 21 - 3 over the Twice Disbarred Lawyers. 1 hour ago

RSS My baseball photo blog

  • Jerry Sands wearing number 30
  • Hershiser 55 bobble head
  • Orel Hershiser bobble head
  • 4 DDGERS: A license plate’s story

Copyright © 1983-2012 Austin Passy.

Powered by WordPress hosted by Inmotion Hosting.

Follow @TheFrosty

    • Login
    • WordPress.org
    • Documentation
    • Support Forums
    • Feedback