Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 1st, 2010  |  syntax: PHP  |  size: 0.48 KB  |  views: 189  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Eerst file als WP media attachment zetten
  2.  
  3. // Nu als post thumbnail zetten
  4.         if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
  5.                 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
  6.                 if ( !empty( $thumbnail_html ) ) {
  7.                         update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id );
  8.                         die( _wp_post_thumbnail_html( $thumbnail_id ) );
  9.                 }
  10.         }
  11.  
  12. // TODO: zet postmeta voor je bericht het file id of iets dergelijks dat je dit niet dubbel of vaker gaat doen
clone this paste RAW Paste Data