Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Need help enabling post thumbnails for a custom post type in my plugin

  1. #11
    Otto's Avatar
    Otto is offline On The Rocks
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    865

    Default

    This seems simpler to me:
    PHP Code:
    $thumbs get_theme_support'post-thumbnails' );
    if (
    $thumbs === false$thumbs = array ();
    if (
    is_array($thumbs)) {
      
    $thumbs[] = 'slice';
      
    add_theme_support'post-thumbnails'$thumbs);

    You'd want to hook this to after_setup_theme.

    Edit: Okay, so get_theme_support is a 3.1 thing, possibly.
    Last edited by Otto; 11-16-2010 at 02:43 PM.

  2. #12
    JLeuze's Avatar
    JLeuze is offline Here For The Peanuts
    Join Date
    Jan 2009
    Location
    Minnesota
    Posts
    135

    Default

    Even less code, better yet!

    Thanks Otto, I'll look into updating this for 3.1.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •