以下是optiontree 2.4的正确答案+
https://github.com/valendesigns/option-tree/issues/112
Note
\'class\'       => \'ot-upload-attachment-id\',
Example:
array(
  \'id\'          => \'demo_upload_attachment_id\',
  \'label\'       => __( \'Upload Attachment ID\', \'option-tree-theme\' ),
  \'desc\'        => sprintf( __( \'The Upload option type can also be saved as an attachment ID by adding %s to the class attribute.\', \'option-tree-theme\' ), \'<code>ot-upload-attachment-id</code>\' ),
  \'std\'         => \'\',
  \'type\'        => \'upload\',
  \'section\'     => \'option_types\',
  \'rows\'        => \'\',
  \'post_type\'   => \'\',
  \'taxonomy\'    => \'\',
  \'min_max_step\'=> \'\',
  \'class\'       => \'ot-upload-attachment-id\',
  \'condition\'   => \'\',
  \'operator\'    => \'and\'
)