Making WordPress.org

Ticket #1183: 1183.diff

File 1183.diff, 2.2 KB (added by hlashbrooke, 7 years ago)

Adding 'Contributor Day' metabox to the wordcamp CPT

  • wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
    index 2cbb0e5..6da1a97 100644
    class WordCamp_Admin { 
    9393                );
    9494
    9595                add_meta_box(
     96                        'wcpt_contributor_info',
     97                        __( 'Contributor Day Information', 'wcpt' ),
     98                        'wcpt_contributor_metabox',
     99                        WCPT_POST_TYPE_ID,
     100                        'advanced',
     101                        'high'
     102                );
     103
     104                add_meta_box(
    96105                        'wcpt_original_application',
    97106                        'Original Application',
    98107                        array( $this, 'original_application_metabox' ),
    class WordCamp_Admin { 
    441450                                );
    442451                                break;
    443452
     453                        case 'contributor':
     454                                // These fields names need to be unique, hence the 'Contributor' prefix on each one
     455                                $retval = array (
     456                                        'Contributor Day/Session/Track'   => 'checkbox',
     457                                        'Contributor Date (YYYY-mm-dd)'   => 'date',
     458                                        'Contributor Venue Name'          => 'text',
     459                                        'Contributor Venue Address'       => 'textarea',
     460                                        'Contributor Venue Capacity'      => 'text',
     461                                        'Contributor Venue Website URL'   => 'text',
     462                                        'Contributor Venue Contact Info'  => 'textarea',
     463                                );
     464                                break;
     465
    444466                        case 'wordcamp':
    445467                                $retval = array (
    446468                                        'Start Date (YYYY-mm-dd)'           => 'date',
    class WordCamp_Admin { 
    521543                                        'Website URL'                     => 'text',
    522544                                        'Contact Information'             => 'textarea',
    523545                                        'Exhibition Space Available'      => 'checkbox',
     546
     547                                        'Contributor Day/Session/Track'   => 'checkbox',
     548                                        'Contributor Date (YYYY-mm-dd)'   => 'date',
     549                                        'Contributor Venue Name'          => 'text',
     550                                        'Contributor Venue Address'       => 'textarea',
     551                                        'Contributor Venue Capacity'      => 'text',
     552                                        'Contributor Venue Website URL'   => 'text',
     553                                        'Contributor Venue Contact Info'  => 'textarea',
    524554                                );
    525555                                break;
    526556
    function wcpt_venue_metabox() { 
    11491179        wcpt_metabox( $meta_keys );
    11501180}
    11511181
     1182function wcpt_contributor_metabox() {
     1183        $meta_keys = $GLOBALS['wordcamp_admin']->meta_keys( 'contributor' );
     1184        wcpt_metabox( $meta_keys );
     1185}
     1186
    11521187/**
    11531188 * wcpt_metabox ()
    11541189 *