'Book author', 'desc' => 'Name of the book author', 'id' => $prefix.'author', 'type' => 'text' ), array( 'label' => 'Book rating score', 'desc' => 'Give a rating between 0 to 5.', 'id' => $prefix.'slider', 'type' => 'slider', 'min' => '0', 'max' => '5', 'step' => '1' ) ); // enqueue scripts and styles, but only if is_admin if(is_admin()) { wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('custom-js', get_template_directory_uri().'/js/custom-js.js'); wp_enqueue_style('jquery-ui-custom', get_template_directory_uri().'/css/jquery-ui-custom.css'); } // add some custom js to the head of the page add_action('admin_head','add_custom_scripts'); function add_custom_scripts() { global $custom_meta_fields, $post; $output = ''; echo $output; } // The Callback function show_custom_meta_box() { global $custom_meta_fields, $post; // Use nonce for verification echo ''; // Begin the field table and loop echo ''; foreach ($custom_meta_fields as $field) { // get value of this field if it exists for this post $meta = get_post_meta($post->ID, $field['id'], true); // begin a table row with echo ''; } // end foreach echo '
'; switch($field['type']) { // text case 'text': echo '
'.$field['desc'].''; break; // textarea case 'textarea': echo '
'.$field['desc'].''; break; // checkbox case 'checkbox': echo ' '; break; // select case 'select': echo '
'.$field['desc'].''; break; // radio case 'radio': foreach ( $field['options'] as $option ) { echo '
'; } echo ''.$field['desc'].''; break; // checkbox_group case 'checkbox_group': foreach ($field['options'] as $option) { echo '
'; } echo ''.$field['desc'].''; break; // tax_select case 'tax_select': echo '
Manage '.$taxonomy->label.''; break; // post_list case 'post_list': $items = get_posts( array ( 'post_type' => $field['post_type'], 'posts_per_page' => -1 )); echo '
'.$field['desc'].''; break; // date case 'date': echo '
'.$field['desc'].''; break; // slider case 'slider': $value = $meta != '' ? $meta : '0'; echo '

'.$field['desc'].''; break; // image case 'image': $image = get_template_directory_uri().'/images/image.png'; echo ''; if ($meta) { $image = wp_get_attachment_image_src($meta, 'medium'); $image = $image[0]; } echo '
 Remove Image
'.$field['desc'].''; break; // repeatable case 'repeatable': echo '+
    '; $i = 0; if ($meta) { foreach($meta as $row) { echo '
  • ||| -
  • '; $i++; } } else { echo '
  • ||| -
  • '; } echo '
'.$field['desc'].''; break; } //end switch echo '
'; // end table } /* function remove_taxonomy_boxes() { remove_meta_box('categorydiv', 'post', 'side'); } add_action( 'admin_menu' , 'remove_taxonomy_boxes' ); */ // Save the Data function save_custom_meta($post_id) { global $custom_meta_fields; // verify nonce if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], basename(__FILE__))) return $post_id; // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id; // check permissions if ('page' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) return $post_id; } elseif (!current_user_can('edit_post', $post_id)) { return $post_id; } // loop through fields and save the data foreach ($custom_meta_fields as $field) { if($field['type'] == 'tax_select') continue; $old = get_post_meta($post_id, $field['id'], true); $new = $_POST[$field['id']]; if ($new && $new != $old) { update_post_meta($post_id, $field['id'], $new); } elseif ('' == $new && $old) { delete_post_meta($post_id, $field['id'], $old); } } // enf foreach // save taxonomies $post = get_post($post_id); $category = $_POST['category']; wp_set_object_terms( $post_id, $category, 'category' ); } add_action('save_post', 'save_custom_meta'); ?> Red Harvest - Ureeka : Ureeka
Author: Dashiell Hammett Genre:
Rating

Donec fringilla dui at turpis rutrum posuere. Integer gravida libero sit amet est dignissim pellentesque. Mauris nec erat ut velit dignissim imperdiet non sed ipsum. Pellentesque sollicitudin posuere nisl et eleifend. Morbi rhoncus mauris eget purus suscipit tincidunt. Duis quis orci at sem varius porttitor? Fusce scelerisque neque eu sem varius molestie! Etiam purus est, interdum eu sagittis pretium, hendrerit ac eros. Sed nunc lectus, vulputate at egestas sed, ultrices ut ipsum! Aenean ac justo diam, in blandit arcu. Sed mattis aliquam dictum. Aliquam congue nisl in tortor mattis iaculis. Nullam accumsan; dui ac tempor laoreet; mauris libero vestibulum quam, eu elementum turpis tellus at sem. Curabitur ac lorem ligula, ac fermentum quam. Vestibulum in lobortis leo.

Nunc pharetra, ligula vel rhoncus consectetur, mauris orci tristique sapien, quis sagittis sem tellus eget nulla. Duis congue metus in arcu vulputate mattis a ac dui. Quisque felis dui, aliquam congue rhoncus quis, tempus ornare quam! Sed hendrerit, nisi quis interdum tempor, eros ligula hendrerit felis, sit amet auctor orci sapien ac magna. Donec tempor metus nisi, eget blandit risus. In facilisis pulvinar pretium! Mauris et nisi purus. Vivamus elementum dictum dolor, vitae consequat felis eleifend vitae. Proin fermentum, diam eget elementum eleifend, ligula mi condimentum lacus, in aliquam lectus metus in ante. Nullam non nunc ligula. Aliquam erat volutpat. Pellentesque a erat quis nisl tincidunt gravida id vitae lacus! Donec a molestie lacus. Ut in nisl sit amet orci tempus rhoncus.

Maecenas pellentesque lacus ac diam vulputate ac posuere arcu cursus. Pellentesque cursus, justo tristique euismod ullamcorper, odio felis molestie leo; et egestas leo magna eu nunc. Vestibulum imperdiet nibh et massa mollis ut dapibus turpis sollicitudin. Integer molestie placerat hendrerit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut dui lorem, pellentesque sit amet tristique vel, iaculis ut augue. Maecenas tristique justo at augue sodales tristique. Nunc nisi felis, tempor id accumsan sagittis, condimentum in massa! Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam erat volutpat. Vestibulum tellus libero, fringilla quis sollicitudin in, ornare pellentesque urna. Integer blandit felis vitae ipsum tincidunt vel dignissim erat suscipit. Maecenas massa lectus, convallis id rhoncus non, auctor vitae sapien.

Leave a Reply