-
Notifications
You must be signed in to change notification settings - Fork 1
/
custom-post-types.php
executable file
·848 lines (760 loc) · 22.9 KB
/
custom-post-types.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
<?php
/**
* Abstract class for defining custom post types.
*
**/
abstract class CustomPostType{
public
$name = 'custom_post_type',
$plural_name = 'Custom Posts',
$singular_name = 'Custom Post',
$add_new_item = 'Add New Custom Post',
$edit_item = 'Edit Custom Post',
$new_item = 'New Custom Post',
$public = True, # I dunno...leave it true
$use_title = True, # Title field
$use_editor = True, # WYSIWYG editor, post content field
$use_revisions = True, # Revisions on post content and titles
$use_thumbnails = False, # Featured images
$use_order = False, # Wordpress built-in order meta data
$use_metabox = False, # Enable if you have custom fields to display in admin
$use_shortcode = False, # Auto generate a shortcode for the post type
# (see also objectsToHTML and toHTML methods)
$taxonomies = array('post_tag'),
$built_in = False,
# Optional default ordering for generic shortcode if not specified by user.
$default_orderby = null,
$default_order = null;
/**
* Wrapper for get_posts function, that predefines post_type for this
* custom post type. Any options valid in get_posts can be passed as an
* option array. Returns an array of objects.
**/
public function get_objects($options=array()){
$defaults = array(
'numberposts' => -1,
'orderby' => 'title',
'order' => 'ASC',
'post_type' => $this->options('name'),
);
$options = array_merge($defaults, $options);
$objects = get_posts($options);
return $objects;
}
/**
* Similar to get_objects, but returns array of key values mapping post
* title to id if available, otherwise it defaults to id=>id.
**/
public function get_objects_as_options($options=array()){
$objects = $this->get_objects($options);
$opt = array();
foreach($objects as $o){
switch(True){
case $this->options('use_title'):
$opt[$o->post_title] = $o->ID;
break;
default:
$opt[$o->ID] = $o->ID;
break;
}
}
return $opt;
}
/**
* Return the instances values defined by $key.
**/
public function options($key){
$vars = get_object_vars($this);
return $vars[$key];
}
/**
* Additional fields on a custom post type may be defined by overriding this
* method on an descendant object.
**/
public function fields(){
return array();
}
/**
* Using instance variables defined, returns an array defining what this
* custom post type supports.
**/
public function supports(){
#Default support array
$supports = array();
if ($this->options('use_title')){
$supports[] = 'title';
}
if ($this->options('use_order')){
$supports[] = 'page-attributes';
}
if ($this->options('use_thumbnails')){
$supports[] = 'thumbnail';
}
if ($this->options('use_editor')){
$supports[] = 'editor';
}
if ($this->options('use_revisions')){
$supports[] = 'revisions';
}
return $supports;
}
/**
* Creates labels array, defining names for admin panel.
**/
public function labels(){
return array(
'name' => __($this->options('plural_name')),
'singular_name' => __($this->options('singular_name')),
'add_new_item' => __($this->options('add_new_item')),
'edit_item' => __($this->options('edit_item')),
'new_item' => __($this->options('new_item')),
);
}
/**
* Creates metabox array for custom post type. Override method in
* descendants to add or modify metaboxes.
**/
public function metabox(){
if ($this->options('use_metabox')){
return array(
'id' => $this->options('name').'_metabox',
'title' => __($this->options('singular_name').' Fields'),
'page' => $this->options('name'),
'context' => 'normal',
'priority' => 'high',
'fields' => $this->fields(),
);
}
return null;
}
/**
* Registers metaboxes defined for custom post type.
**/
public function register_metaboxes(){
if ($this->options('use_metabox')){
$metabox = $this->metabox();
add_meta_box(
$metabox['id'],
$metabox['title'],
'show_meta_boxes',
$metabox['page'],
$metabox['context'],
$metabox['priority']
);
}
}
/**
* Registers the custom post type and any other ancillary actions that are
* required for the post to function properly.
**/
public function register(){
$registration = array(
'labels' => $this->labels(),
'supports' => $this->supports(),
'public' => $this->options('public'),
'taxonomies' => $this->options('taxonomies'),
'_builtin' => $this->options('built_in')
);
if ($this->options('use_order')){
$registration = array_merge($registration, array('hierarchical' => True,));
}
register_post_type($this->options('name'), $registration);
if ($this->options('use_shortcode')){
add_shortcode($this->options('name').'-list', array($this, 'shortcode'));
}
}
/**
* Shortcode for this custom post type. Can be overridden for descendants.
* Defaults to just outputting a list of objects outputted as defined by
* toHTML method.
**/
public function shortcode($attr){
$default = array(
'type' => $this->options('name'),
);
if (is_array($attr)){
$attr = array_merge($default, $attr);
}else{
$attr = $default;
}
return sc_object_list($attr);
}
/**
* Handles output for a list of objects, can be overridden for descendants.
* If you want to override how a list of objects are outputted, override
* this, if you just want to override how a single object is outputted, see
* the toHTML method.
**/
public function objectsToHTML($objects, $css_classes){
if (count($objects) < 1){ return '';}
$class = get_custom_post_type($objects[0]->post_type);
$class = new $class;
ob_start();
?>
<ul class="<?php if($css_classes):?><?=$css_classes?><?php else:?><?=$class->options('name')?>-list<?php endif;?>">
<?php foreach($objects as $o):?>
<li>
<?=$class->toHTML($o)?>
</li>
<?php endforeach;?>
</ul>
<?php
$html = ob_get_clean();
return $html;
}
/**
* Outputs this item in HTML. Can be overridden for descendants.
**/
public function toHTML($object){
$html = '<a href="'.get_permalink($object->ID).'">'.$object->post_title.'</a>';
return $html;
}
}
class Document extends CustomPostType{
public
$name = 'document',
$plural_name = 'Documents',
$singular_name = 'Document',
$add_new_item = 'Add New Document',
$edit_item = 'Edit Document',
$new_item = 'New Document',
$use_title = True,
$use_editor = False,
$use_shortcode = True,
$use_metabox = True,
$taxonomies = array( 'post_tag', 'document_group' );
public function fields(){
$fields = parent::fields();
$fields[] = array(
'name' => __('URL'),
'desc' => __('Associate this document with a URL. This will take precedence over any uploaded file, so leave empty if you want to use a file instead.'),
'id' => $this->options('name').'_url',
'type' => 'text',
);
$fields[] = array(
'name' => __('File'),
'desc' => __('Associate this document with an already existing file.'),
'id' => $this->options('name').'_file',
'type' => 'file',
);
$fields[] = array(
'name' => 'Tech to License',
'desc' => 'Indicates that this document will be displayed in the Technology Locator Page.',
'id' => $this->options('name').'_license',
'type' => 'checkbox',
);
$fields[] = array(
'name' => 'Featured Tech to License',
'desc' => 'Indicates that this document will be displayed in the Featured Technology section on the Home Page.',
'id' => $this->options('name').'_featured',
'type' => 'checkbox',
);
$fields[] = array(
'name' => 'Startup Primer Tech to License',
'desc' => 'Indicates that this document will be highlighted as Startup-Friendly on the Technology Locator Page.',
'id' => $this->options('name').'_startup_primer',
'type' => 'checkbox',
);
$fields[] = array(
'name' => 'Form and Document',
'desc' => 'Indicates that this document will be displayed in the Forms and Documents Page.',
'id' => $this->options('name').'_form',
'type' => 'checkbox',
);
return $fields;
}
static function get_document_application($form){
return mimetype_to_application(self::get_mimetype($form));
}
static function get_mimetype($form){
if (is_numeric($form)){
$form = get_post($form);
}
$prefix = post_type($form);
$document = get_post(get_post_meta($form->ID, $prefix.'_file', True));
$is_url = get_post_meta($form->ID, $prefix.'_url', True);
return ($is_url) ? "text/html" : $document->post_mime_type;
}
static function get_title($form){
if (is_numeric($form)){
$form = get_post($form);
}
$prefix = post_type($form);
return $form->post_title;
}
static function get_url($form){
if (is_numeric($form)){
$form = get_post($form);
}
$prefix = post_type($form);
$x = get_post_meta($form->ID, $prefix.'_url', True);
$y = wp_get_attachment_url(get_post_meta($form->ID, $prefix.'_file', True));
if (!$x and !$y){
return '#';
}
return ($x) ? $x : $y;
}
/**
* Handles output for a list of objects, can be overridden for descendants.
* If you want to override how a list of objects are outputted, override
* this, if you just want to override how a single object is outputted, see
* the toHTML method.
**/
public function objectsToHTML($objects, $css_classes){
if (count($objects) < 1){ return '';}
$class_name = get_custom_post_type($objects[0]->post_type);
$class = new $class_name;
ob_start();
?>
<ul class="nobullet <?php if($css_classes):?><?=$css_classes?><?php else:?><?=$class->options('name')?>-list<?php endif;?>">
<?php foreach($objects as $o):?>
<li class="document <?=$class_name::get_document_application($o)?>">
<?=$class->toHTML($o)?>
</li>
<?php endforeach;?>
</ul>
<?php
$html = ob_get_clean();
return $html;
}
/**
* Outputs this item in HTML. Can be overridden for descendants.
**/
public function toHTML($object){
$title = Document::get_title($object);
$url = Document::get_url($object);
$html = "<a href='{$url}'>{$title}</a>";
return $html;
}
}
class Video extends CustomPostType{
public
$name = 'video',
$plural_name = 'Videos',
$singular_name = 'Video',
$add_new_item = 'Add New Video',
$edit_item = 'Edit Video',
$new_item = 'New Video',
$public = True,
$use_editor = False,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_metabox = True;
public function get_player_html($video){
return sc_video(array('video' => $video));
}
public function metabox(){
$metabox = parent::metabox();
$metabox['title'] = 'Videos on Media Page';
$metabox['helptxt'] = 'Video icon will be resized to width 210px, height 118px.';
return $metabox;
}
public function fields(){
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'URL',
'desc' => 'YouTube URL pointing to video.<br> Example: https://www.youtube.com/watch?v=IrSeMg7iPbM',
'id' => $prefix.'url',
'type' => 'text',
'std' => ''
),
array(
'name' => 'Video Description',
'desc' => 'Short description of the video.',
'id' => $prefix.'description',
'type' => 'textarea',
'std' => ''
),
array(
'name' => 'Shortcode',
'desc' => 'To include this video in other posts, use the following shortcode:',
'id' => 'video_shortcode',
'type' => 'shortcode',
'value' => '[video name="TITLE"]',
),
);
}
}
class Publication extends CustomPostType{
public
$name = 'publication',
$plural_name = 'Publications',
$singular_name = 'Publication',
$add_new_item = 'Add New Publication',
$edit_item = 'Edit Publication',
$new_item = 'New Publication',
$public = True,
$use_editor = True,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_metabox = True;
public function toHTML($pub){
return sc_publication(array('pub' => $pub));
}
public function metabox(){
$metabox = parent::metabox();
$metabox['title'] = 'Publications on Media Page';
$metabox['helptxt'] = 'Publication cover icon will be resized to width 153px, height 198px.';
return $metabox;
}
public function fields(){
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Publication URL',
'desc' => 'Example: <span style="font-family:monospace;font-weight:bold;color:#21759B;">https://publications.ucf.edu/publications/admissions-viewbook/</span>',
'id' => $prefix.'url',
'type' => 'text',
'std' => '',
),
array(
'name' => 'Shortcode',
'desc' => 'To include this publication in other posts, use the following shortcode: <input disabled="disabled" type="text" value="[publication name=]" />',
'id' => 'publication_shortcode',
'type' => 'help',
'value' => '[publication name="TITLE"]',
),
);
}
}
class Page extends CustomPostType {
public
$name = 'page',
$plural_name = 'Pages',
$singular_name = 'Page',
$add_new_item = 'Add New Page',
$edit_item = 'Edit Page',
$new_item = 'New Page',
$public = True,
$use_editor = True,
$use_thumbnails = False,
$use_order = True,
$use_title = True,
$use_metabox = True,
$built_in = True;
public function fields() {
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Resource Buttons',
'desc' => 'Choose what set of Resource Buttons are displayed for the given page.',
'id' => $prefix.'resource',
'type' => 'select',
'options' => get_resource_groups(),
),
array(
'name' => 'Hide Lower Section',
'desc' => 'This section normally contains the Flickr, News and Events widgets. The footer will not be hidden',
'id' => $prefix.'hide_fold',
'type' => 'checkbox',
),
array(
'name' => 'Stylesheet',
'desc' => '',
'id' => $prefix.'stylesheet',
'type' => 'file',
),
);
}
}
/**
* Describes a staff member
*
* @author Chris Conover
**/
class Person extends CustomPostType
{
/*
The following query will pre-populate the person_orderby_name
meta field with a guess of the last name extracted from the post title.
>>>BE SURE TO REPLACE wp_<number>_... WITH THE APPROPRIATE SITE ID<<<
INSERT INTO wp_29_postmeta(post_id, meta_key, meta_value)
( SELECT id AS post_id,
'person_orderby_name' AS meta_key,
REVERSE(SUBSTR(REVERSE(post_title), 1, LOCATE(' ', REVERSE(post_title)))) AS meta_value
FROM wp_29_posts AS posts
WHERE post_type = 'person' AND
( SELECT meta_id
FROM wp_29_postmeta
WHERE post_id = posts.id AND
meta_key = 'person_orderby_name') IS NULL)
*/
public
$name = 'person',
$plural_name = 'People',
$singular_name = 'Person',
$add_new_item = 'Add Person',
$edit_item = 'Edit Person',
$new_item = 'New Person',
$public = True,
$use_shortcode = True,
$use_metabox = True,
$use_thumbnails = True,
$use_order = True,
$taxonomies = array('org_groups', 'category');
public function fields(){
$fields = array(
array(
'name' => __('Title Prefix'),
'desc' => '',
'id' => $this->options('name').'_title_prefix',
'type' => 'text',
),
array(
'name' => __('Title Suffix'),
'desc' => __('Be sure to include leading comma or space if necessary.'),
'id' => $this->options('name').'_title_suffix',
'type' => 'text',
),
array(
'name' => __('Job Title'),
'desc' => __(''),
'id' => $this->options('name').'_jobtitle',
'type' => 'text',
),
array(
'name' => __('Phone'),
'desc' => __('Separate multiple entries with commas.'),
'id' => $this->options('name').'_phones',
'type' => 'text',
),
array(
'name' => __('Email'),
'desc' => __(''),
'id' => $this->options('name').'_email',
'type' => 'text',
),
array(
'name' => __('Order By Name'),
'desc' => __('Name used for sorting. Leaving this field blank may lead to an unexpected sort order.'),
'id' => $this->options('name').'_orderby_name',
'type' => 'text',
),
);
return $fields;
}
public function get_objects($options=array()){
$options['order'] = 'ASC';
$options['orderby'] = 'person_orderby_name';
$options['meta_key'] = 'person_orderby_name';
return parent::get_objects($options);
}
public static function get_name($person) {
$prefix = get_post_meta($person->ID, 'person_title_prefix', True);
$suffix = get_post_meta($person->ID, 'person_title_suffix', True);
$name = $person->post_title;
return $prefix.' '.$name.' '.$suffix;
}
public static function get_phones($person) {
$phones = get_post_meta($person->ID, 'person_phones', True);
return ($phones != '') ? explode(',', $phones) : array();
}
public function objectsToHTML($people, $css_classes) {
ob_start();?>
<div class="row">
<div class="span12">
<table class="table table-striped">
<thead>
<tr>
<th scope="col" class="name">Name</th>
<th scope="col" class="job_title">Title</th>
<th scope="col" class="phones">Phone</th>
<th scope="col" class="email">Email</th>
</tr>
</thead>
<tbody>
<?php
foreach($people as $person) {
$email = get_post_meta($person->ID, 'person_email', True);
$link = ($person->post_content == '') ? False : True; ?>
<tr>
<td class="name">
<?php if($link) {?><a href="<?=get_permalink($person->ID)?>"><?php } ?>
<?=$this->get_name($person)?>
<?php if($link) {?></a><?php }?>
</td>
<td class="job_title">
<?php if($link) {?><a href="<?=get_permalink($person->ID)?>"><?php }?>
<?=get_post_meta($person->ID, 'person_jobtitle', True)?>
<?php if($link) {?></a><?php }?>
</td>
<td class="phones"><?php if(($link) && ($this->get_phones($person))) {?><a href="<?=get_permalink($person->ID)?>">
<?php } if($this->get_phones($person)) {?>
<ul class="unstyled"><?php foreach($this->get_phones($person) as $phone) { ?><li><?=$phone?></li><?php } ?></ul>
<?php } if(($link) && ($this->get_phones($person))) {?></a><?php }?></td>
<td class="email"><?=(($email != '') ? '<a href="mailto:'.$email.'">'.$email.'</a>' : '')?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div><?php
return ob_get_clean();
}
} // END class
/**
* Extend the default post type: "Post"
*
* @author Chris Conover
* @author Jonathan Villadolid
**/
class Post extends CustomPostType {
public
$name = 'post',
$plural_name = 'Posts',
$singular_name = 'Post',
$add_new_item = 'Add New Post',
$edit_item = 'Edit Post',
$new_item = 'New Post',
$public = True,
$use_editor = True,
$use_thumbnails = False,
$use_order = True,
$use_title = True,
$use_metabox = True,
$taxonomies = array('post_tag', 'category'),
$built_in = True;
public function fields() {
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Shortened Description',
'desc' => 'This section is to display a shortened description on most of the pages. If nothing is entered then the main content is used.',
'id' => $prefix.'short_description',
'type' => 'text',
),
array(
'name' => 'Hide Lower Section',
'desc' => 'This section normally contains the Flickr, News and Events widgets. The footer will not be hidden',
'id' => $prefix.'hide_fold',
'type' => 'checkbox',
),
array(
'name' => 'Stylesheet',
'desc' => '',
'id' => $prefix.'stylesheet',
'type' => 'file',
),
);
}
}
/**
* About Post Type
*
* @author Brandon Groves
**/
class About extends CustomPostType{
public
$name = 'about',
$plural_name = 'About Page',
$singular_name = 'About Page',
$add_new_item = 'Add New Topic',
$edit_item = 'Edit Topic',
$new_item = 'New Topic',
$public = True,
$use_editor = True,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_metabox = True;
}
/**
* Faculty Feature post type (renamed "News" post type as of v1.1.5)
*
* @author Brandon Groves
**/
class FacultyFeature extends CustomPostType{
public
$name = 'news',
$plural_name = 'Faculty Features',
$singular_name = 'Faculty Feature',
$add_new_item = 'Add New Faculty Feature',
$edit_item = 'Edit Faculty Feature',
$new_item = 'New Faculty Feature',
$public = True,
$use_editor = True,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_shortcode = True,
$use_metabox = True;
public function fields() {
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Shortened Description',
'desc' => 'This section is to display a shortened description on most of the pages. If nothing is entered then the main content is used.',
'id' => $prefix.'short_description',
'type' => 'text',
),
);
}
}
/**
* Technology News post type (renamed "Success Story" post type as of v1.1.5)
*
* @author Jonathan Villadolid
**/
class TechnologyNews extends CustomPostType{
public
$name = 'success_story',
$plural_name = 'Technology News',
$singular_name = 'Technology News',
$add_new_item = 'Add New Technology News',
$edit_item = 'Edit Technology News',
$new_item = 'New Technology News',
$public = True,
$use_editor = True,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_shortcode = True,
$use_metabox = True;
public function fields() {
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Shortened Description',
'desc' => 'This section is to display a shortened description on most of the pages. If nothing is entered then the main content is used.',
'id' => $prefix.'short_description',
'type' => 'text',
),
);
}
}
/**
* Footer Resources Post Type
*
* @author Brandon Groves
**/
class FooterResource extends CustomPostType{
public
$name = 'footerresource',
$plural_name = 'Resource Buttons',
$singular_name = 'Resource Button',
$add_new_item = 'Add New Resource Button',
$edit_item = 'Edit Resource Button',
$new_item = 'New Resource Button',
$public = True,
$use_editor = True,
$use_thumbnails = True,
$use_order = True,
$use_title = True,
$use_metabox = True,
$taxonomies = array('resource_groups');
public function fields() {
$prefix = $this->options('name').'_';
return array(
array(
'name' => 'Shortened Description',
'desc' => 'This section is to display a shortened description on most of the pages. If nothing is entered then the main content is used.',
'id' => $prefix.'short_description',
'type' => 'text',
),
);
}
}
?>