Making WordPress.org


Ignore:
Timestamp:
12/15/2014 09:32:58 PM (12 years ago)
Author:
iandunn
Message:

WordPress.tv: Add meta field for presentation slides.

Fixes #774
props BrashRebel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php

    r1030 r1044  
    5151                        'wptv_speakers',
    5252                        'wptv_event',
     53                        'wptv_slides_url'
    5354                );
    5455
    … …  
    275276                $description    = $this->sanitize_text( $_posted['wptv_video_description'], false );
    276277                $language       = $this->sanitize_text( $_posted['wptv_language'] );
     278                $slides         = $this->sanitize_text( $_posted['wptv_slides_url'] );
    277279                $ip             = $_SERVER['REMOTE_ADDR'];
    278280
    … …  
    298300                        'categories'      => $categories,
    299301                        'description'     => $description,
     302                        'slides'          => $slides,
    300303                        'ip'              => $ip,
    301304                );
    … …  
    332335                $embed_args['blog_id'] = get_current_blog_id();
    333336                $embed_args['post_id'] = $meta['attachment_id'];
     337
     338                // Add slides index to meta (necessary for posts that were uploaded before the field was added)
     339                if ( ! array_key_exists( 'slides', $meta ) ) {
     340                        $meta['slides'] = '';
     341                }
    334342
    335343                ?>
    … …  
    488496
    489497                                        <div class="row">
     498                                                <p class="label">Slides:</p>
     499                                                <p class="data">
     500                                                        <input type="text" value="<?php echo esc_attr( $meta['slides'] ); ?>"/>
     501                                                        <a class="button-secondary anon-approve" href="#wptv-slides-url">Approve</a>
     502                                                </p>
     503                                        </div>
     504
     505                                        <div class="row">
    490506                                                <p class="label">Edit attachment:</p>
    491507                                                <p class="data">
    … …  
    524540                                                        el.val(target.siblings('input[type="text"]').val());
    525541                                                        el.siblings('.tagadd').click();
    526                                                 } else if (id == '#title') {
     542                                                } else if ('#title' == id  || '#wptv-slides-url' == id) {
    527543                                                        el.val(target.siblings('input[type="text"]').val());
    528544                                                } else if (id == '#excerpt') {
Note: See TracChangeset for help on using the changeset viewer.