Advertisement
Guest User

Untitled

a guest
Oct 6th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.15 KB | None | 0 0
  1. function LKJLKJ_resource_meta_boxes( $meta_boxes ) {
  2.     $meta_boxes[] = array (
  3.         'title' => 'Resource Fields <strong>(These fields MUST be filled in or the resource will not display)</strong>',
  4.         'id' => 'resource-fields',
  5.         'post_types' => array(
  6.             0 => 'resources',
  7.         ),
  8.         'context' => 'normal',
  9.         'priority' => 'high',
  10.         'fields' => array(
  11.             array(
  12.                 'id'               => 'resource_file',
  13.                 'name'             => 'Resource File',
  14.                 'type'             => 'file',
  15.                 'desc' => 'Upload the file associated with the resource. <br />
  16.                <strong>Note:</strong> If you delete the file here, it <strong>will be deleted from the server</strong>',
  17.            
  18.                 // Delete file from Media Library when remove it from post meta?
  19.                 // Note: it might affect other posts if you use same file for multiple posts
  20.                 'required' => true,
  21.                 'force_delete'     => true,
  22.                 'upload_dir' => WP_CONTENT_DIR . '/resources/',
  23.                 // Maximum file uploads.
  24.                 'max_file_uploads' => 1,
  25.             ),
  26.             array (
  27.                 'id' => 'resource_description',
  28.                 'type' => 'textarea',
  29.                 'required' => true,
  30.                 'name' => 'Resource Description',
  31.                 'desc' => 'Enter a brief description for the Resource listing page',
  32.                 'required' => 1,
  33.                 'limit' => 200,
  34.             ),      
  35.         ),
  36.     );
  37.     $meta_boxes[] = array (
  38.         'title' => 'Extra Information',
  39.         'id' => 'resource-info',
  40.         'post_types' => array(
  41.             0 => 'resources',
  42.         ),
  43.         'context' => 'normal',
  44.         'priority' => 'high',
  45.         'fields' => array(
  46.             array (
  47.                 'id' => 'description_extra',
  48.                 'type' => 'wysiwyg',
  49.                 'name' => 'Resource Full Description',
  50.                 'desc' => 'Enter a fuller description for single Resource page',
  51.             ),          
  52.         ),
  53.     );  
  54.     return $meta_boxes;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement