Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LKJLKJ_resource_meta_boxes( $meta_boxes ) {
- $meta_boxes[] = array (
- 'title' => 'Resource Fields <strong>(These fields MUST be filled in or the resource will not display)</strong>',
- 'id' => 'resource-fields',
- 'post_types' => array(
- 0 => 'resources',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array(
- 'id' => 'resource_file',
- 'name' => 'Resource File',
- 'type' => 'file',
- 'desc' => 'Upload the file associated with the resource. <br />
- <strong>Note:</strong> If you delete the file here, it <strong>will be deleted from the server</strong>',
- // Delete file from Media Library when remove it from post meta?
- // Note: it might affect other posts if you use same file for multiple posts
- 'required' => true,
- 'force_delete' => true,
- 'upload_dir' => WP_CONTENT_DIR . '/resources/',
- // Maximum file uploads.
- 'max_file_uploads' => 1,
- ),
- array (
- 'id' => 'resource_description',
- 'type' => 'textarea',
- 'required' => true,
- 'name' => 'Resource Description',
- 'desc' => 'Enter a brief description for the Resource listing page',
- 'required' => 1,
- 'limit' => 200,
- ),
- ),
- );
- $meta_boxes[] = array (
- 'title' => 'Extra Information',
- 'id' => 'resource-info',
- 'post_types' => array(
- 0 => 'resources',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array (
- 'id' => 'description_extra',
- 'type' => 'wysiwyg',
- 'name' => 'Resource Full Description',
- 'desc' => 'Enter a fuller description for single Resource page',
- ),
- ),
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement