Making WordPress.org

Changeset 1232


Ignore:
Timestamp:
02/06/2015 09:24:50 PM (12 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Add a field to track if venues have exhibition space.

Props bansod_deven
See #720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r1230 r1232  
    119119                                        case 'textarea' :
    120120                                                update_post_meta( $post_id, $key, $values[$key] );
     121                                                break;
     122                                       
     123                                        case 'checkbox' :
     124                                                if ( ! empty( $values[ $key ] ) && 'on' == $values[ $key ] ) {
     125                                                        update_post_meta( $post_id, $key, true );
     126                                                } else {
     127                                                        update_post_meta( $post_id, $key, false );
     128                                                }
    121129                                                break;
    122130
    … …  
    175183                                        'Available Rooms'                 => 'text',
    176184                                        'Website URL'                     => 'text',
    177                                         'Contact Information'             => 'textarea'
     185                                        'Contact Information'             => 'textarea',
     186                                        'Exhibition Space Available'      => 'checkbox',
    178187                                );
    179188                                break;
    … …  
    223232                                        'Available Rooms'                 => 'text',
    224233                                        'Website URL'                     => 'text',
    225                                         'Contact Information'             => 'textarea'
     234                                        'Contact Information'             => 'textarea',
     235                                        'Exhibition Space Available'      => 'checkbox',
    226236                                );
    227237                                break;
    … …  
    675685
    676686                <div class="inside">
     687                        <?php if ( 'checkbox' == $value ) : ?>
     688
     689                                <p>
     690                                        <strong><?php echo $key; ?></strong>:
     691                                        <input type="checkbox" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" <?php checked( get_post_meta( $post_id, $key, true ) ); ?> />
     692                                </p>
     693
     694                        <?php else : ?>
     695                        <?php // todo indent the contents (and do other whitespace cleanup) in the next commit. avoid doing here because of diff noise. ?>
    677696                        <p>
    678697                                <strong><?php echo $key; ?></strong>
    … …  
    714733                        </p>
    715734                </div>
     735                <?php endif; ?>
    716736
    717737<?php
Note: See TracChangeset for help on using the changeset viewer.