Guest User

Adding Thesis meta and extra options to a custom post type.

a guest
Feb 18th, 2011
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Product Metadata - This is used for custom post types. This version of the code has been adapted to work with WPEC 3.8 RC1 for the add product page.
  2.  
  3. add_action('admin_init', 'thesis_for_custom_post_types');
  4.  
  5. function thesis_for_custom_post_types() {
  6.    
  7.     $post_options = new thesis_post_options;
  8.     $post_options->meta_boxes();
  9.  
  10.     foreach ($post_options->meta_boxes as $meta_name => $meta_box)
  11.     {
  12.         add_meta_box($meta_box['id'], $meta_box['title'], array('thesis_post_options', 'output_' . $meta_name . '_box'), 'wpsc-product', 'normal', 'high'); #wp
  13.    }
  14.        
  15.     add_action('save_post', array('thesis_post_options', 'save_meta'));
  16. }
  17.  
  18. // Add SEO to Tax's
  19.  
  20. function custom_SEO() {
  21.     if (is_tax()) :
  22.         $description = strip_tags(term_description('', get_query_var( 'taxonomy' )));
  23.         echo '<meta name="description" content="' . $description . '">';
  24.     endif;
  25. }
  26. add_action('wp_head','custom_SEO',1);
RAW Paste Data