Changeset 1724 for sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php
- Timestamp:
- 07/10/2015 08:32:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php
r1650 r1724 48 48 $text_fields = array( 49 49 'wptv_video_title', 50 'wptv_ video_producer',50 'wptv_producer_username', 51 51 'wptv_speakers', 52 52 'wptv_event', … … 61 61 62 62 return $this->error( 13 ); 63 } 64 65 if ( ! empty( $_POST['wptv_producer_username'] ) && ! wporg_username_exists( $_POST['wptv_producer_username'] ) ) { 66 return $this->error( 14 ); 63 67 } 64 68 … … 260 264 261 265 $video_title = $this->sanitize_text( $_posted['wptv_video_title'] ); 262 $ video_producer = $this->sanitize_text( $_posted['wptv_video_producer'] );266 $producer_username = $this->sanitize_text( $_posted['wptv_producer_username'] ); 263 267 $speakers = $this->sanitize_text( $_posted['wptv_speakers'] ); 264 268 $event = $this->sanitize_text( $_posted['wptv_event'] ); … … 267 271 $slides = $this->sanitize_text( $_posted['wptv_slides_url'] ); 268 272 $ip = $_SERVER['REMOTE_ADDR']; 273 // todo realign in separate commit 269 274 270 275 $categories = ''; … … 283 288 'submitted_email' => $anon_author_email, 284 289 'title' => $video_title, 285 'producer ' => $video_producer,290 'producer_username' => $producer_username, 286 291 'speakers' => $speakers, 287 292 'event' => $event, … … 291 296 'slides' => $slides, 292 297 'ip' => $ip, 298 // todo realign in separate commit 293 299 ); 294 300 … … 325 331 $embed_args['post_id'] = $meta['attachment_id']; 326 332 327 // Add slides index to meta (necessary for posts that were uploaded before the field was added) 328 if ( ! array_key_exists( 'slides', $meta ) ) { 329 $meta['slides'] = ''; 333 // Add missing indexes to $meta (necessary for posts that were uploaded before the fields were added) 334 $new_fields = array( 'slides', 'producer_username' ); 335 foreach ( $new_fields as $field ) { 336 if ( ! array_key_exists( $field, $meta ) ) { 337 $meta[ $field ] = ''; 338 } 330 339 } 331 340 … … 461 470 462 471 <div class="row"> 463 <p class="label">Producer:</p> 464 <p class="data"> 465 <input type="text" value="<?php echo esc_attr( $meta['producer'] ); ?>"/> 466 <a class="button-secondary anon-approve" href="#new-tag-producer">Approve</a> 472 <p class="label">Producer WordPress.org Username:</p> 473 474 <p class="data"> 475 <input type="text" value="<?php echo esc_attr( $meta['producer_username'] ); ?>"/> 476 <a class="button-secondary anon-approve" href="#new-tag-producer-username">Approve</a> 467 477 </p> 468 478 </div>
Note: See TracChangeset
for help on using the changeset viewer.