Austin Passy Los Angeles WordPress developer

WordPress developer.

  • About
  • WordPress
    • Plugins
      • 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.

Remove a meta_box in the WordPress post/page screen

Pulished April 30, 2011 | 1 Response

Yesterday I had a friend write me on Twitter asking about remove_mata_box. He was having issues getting the function to fire properly (or at at for that matter).

I was out last night and just got a chance to open up my computer and test out some code. While the WordPress codex is intact and had example code. It simply wasn’t working.

Codex Example

function remove_featured_image_field() {
	remove_meta_box( 'postimagediv' , 'page' , 'normal' );
}
add_action( 'admin_menu' , 'remove_featured_image_field' );
?>

I added the above function, but like mentioned before had no luck. So I wrote up a quick plugin to handle the task and came up with this (which still didn’t work):

$remove = new Frosty_Remove_Meta_Box();

class Frosty_Remove_Meta_Box {

	function Frosty_Remove_Meta_Box() {
		$this->__construct();
	}

	/* To infinity and beyond */
	function __construct() {
		add_action( 'admin_init, array( __CLASS__, 'remove_meta_box' ) );
		add_action( 'admin_menu, array( __CLASS__, 'remove_meta_box' ) );
	}

	function remove_meta_box() {
		remove_meta_box( 'postimagediv', 'post', 'side' );
	}

}

After trying both admin_init & admin_menu I scowered Google and came across a fix my buddy Michael suggested on a WordPress forum. Use admin_head. And so I did, and it worked!

The final code

$remove = new Frosty_Remove_Meta_Box();

class Frosty_Remove_Meta_Box {

	function Frosty_Remove_Meta_Box() {
		$this->__construct();
	}

	/* To infinity and beyond */
	function __construct() {
		add_action( 'admin_head', array( __CLASS__, 'remove_meta_box' ) );
	}

	function remove_meta_box() {
                // Remove the meta box for all post types. (post,page,custom_post)
		$post_types = get_post_types( array( 'public' => true ), 'objects' );

		foreach ( $post_types as $type ) {
			remove_meta_box( 'postimagediv', $type->name, 'side' );
		}
	}

}

Thoughts? Care to add on to this?

Posted in WordPress Tagged function, remove_meta_box

Modifying Tweetable plugin to work with PrettyLinkPro & Twitter Friendly Links

Pulished April 20, 2011 | Leave a response

A new version of Tweetable (A WordPress URL shrink-er and auto tweet-er) was released, and I thought I’d add some modifications to the plugin. →

Continue reading →

Photos: It’s time for Dodger Baseball

Gallery

This gallery contains 5 photos.

Top Deck at Dodger Stadium
Top Deck
Dodgers
Dodgers Opening Series
Dodger Stadium
Dodgers Panorama
Panorama

Last Pre-Season game at Dodger Stadium before the four game opener with the Giants. A small collection of photos. →

Rock N' Rolla

Change the height in Twenty Ten’s custom header

Pulished March 22, 2011 | Leave a response

Add this to your child theme that is running Twenty Ten: function my_twenty_ten_height() { return ’328′; // change the number to what you desire, default is ’198′. } add_filter( ‘twentyten_header_image_height’, ‘my_twenty_ten_height’ );

Continue reading →

Photos: The Supermoon

Gallery

This gallery contains 6 photos.

Super Moon 2011
Super Moon 2011
Super Moon 2011
Super Moon 2011
Super Moon 2011
Super Moon 2011

Well, the supermoon has officially past, and like most on the west coast I was only able to get a sneak peek at the moon before it slipped behind the coming storm clouds. I grabbed these shots off a pedestrian … →

Photos: Wine tasting in SLO

Image

Three pf my favorite photo’s taken from a recent weekend getaway to San Luis Obispo for some wine tasting. →

Pulished March 20, 2011 | Leave a response
Posted in Photos Tagged Photo, Wine

Introducing “Hide and Catch Email” Version 0.3

Pulished March 11, 2011 | Leave a response
screenshot-3

It’s been some time, but I’ve finally updated my Hide and Catch Email WordPress plugin. It’s been rewritten from the ground up, including my first OOP development. Some files have been removed and some have been added. Grab the plugin … →

Continue reading →
← Previous 1 … 3 4 5 … 33 Next →

Random photo

  • IMG_4801

Recommendations

Ad Sanity
InMotionHosting
MaxCDN
Namecheap

Most Viewed

  • Custom Login - 50,183 views
  • Capturing the URL anchor w... - 17,676 views
  • Creating custom metaboxes ... - 12,874 views
  • Add a twitter field to you... - 11,901 views
  • Custom post type "jokes" p... - 9,275 views
  • Starting a blog with WordP... - 8,650 views
  • Adding a custom default gr... - 8,479 views
  • Auto change "WP" and incor... - 7,777 views
  • St Pattys day at the Roxy - 4,427 views
  • Camping at the Eagles Nest... - 4,003 views

Recent Tweet

  • Corona-Rita http://t.co/R763YeL7 10 hours ago
  • Shrimmmmp. (@ Bubba Gump Shrimp Co. w/ 4 others) http://t.co/wo8sBI7T 10 hours ago

Copyright © 1983-2012 Austin Passy.

Powered by WordPress hosted by Inmotion Hosting.

Follow @TheFrosty

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