Changeset 1044
- Timestamp:
- 12/15/2014 09:32:58 PM (10 years ago)
- Location:
- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php
r1024 r1044 331 331 </p> 332 332 <p> 333 <label for="wptv_slides_url"><?php esc_html_e( 'Slides URL' ); ?></label> 334 <input type="text" name="wptv_slides_url" id="wptv_slides_url" value="" /> 335 </p> 336 <p> 333 337 <label for="wptv_file"><?php esc_html_e( 'Video file' ); ?><span class="required"> * </span></label> 334 338 <input type="file" name="wptv_file" id="wptv_file" /> -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php
r1029 r1044 28 28 add_action( 'init', array( $this, 'improve_search' ) ); 29 29 add_action( 'publish_post', array( $this, 'publish_post' ), 10, 1 ); 30 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); 31 add_action( 'save_post', array( $this, 'save_meta_box_fields' ), 10, 2); 30 32 add_action( 'wp_footer', array( $this, 'videopress_flash_params' ) ); 31 33 add_action( 'transition_post_status', array( $this, 'transition_post_status' ), 10, 2 ); … … 150 152 151 153 /** 154 * Register meta boxes 155 */ 156 function add_meta_boxes() { 157 add_meta_box( 'video-info', 'Video Info', array( $this, 'render_video_info_metabox' ), 'post', 'normal', 'high' ); 158 } 159 160 /** 161 * Render the Video Info box 162 */ 163 function render_video_info_metabox() { 164 global $post; 165 166 $slides_url = get_post_meta( $post->ID, '_wptv_slides_url', true ); 167 wp_nonce_field( 'edit-video-info', 'video_info_metabox_nonce' ); 168 169 ?> 170 171 <p> 172 <label for="wptv-slides-url">Slides URL</label> 173 <input type="text" class="widefat" id="wptv-slides-url" name="_wptv_slides_url" value="<?php echo esc_url( $slides_url ); ?>" /> 174 </p> 175 176 <?php 177 } 178 179 /** 180 * Save the values of meta box fields 181 * 182 * @param int $post_id 183 * @param WP_Post $post 184 */ 185 function save_meta_box_fields( $post_id, $post ) { 186 if ( wp_is_post_revision( $post_id ) || defined( 'DOING_AUTOSAVE' ) || ! current_user_can( 'edit_post', $post_id ) ) { 187 return; 188 } 189 190 if ( ! isset( $_POST['video_info_metabox_nonce'] ) || ! wp_verify_nonce( $_POST['video_info_metabox_nonce'], 'edit-video-info' ) ) { 191 return; 192 } 193 194 $slides_url = esc_url_raw( $_POST['_wptv_slides_url'] ); 195 196 if ( $slides_url ) { 197 update_post_meta( $post_id, '_wptv_slides_url', $slides_url ); 198 } else { 199 delete_post_meta( $post_id, '_wptv_slides_url' ); 200 } 201 } 202 203 /** 152 204 * Activates the improved search, but not in admin. 153 205 */ … … 176 228 177 229 /** 178 * Improved Se rach: posts_search filter230 * Improved Search: posts_search filter 179 231 * 180 232 * Recreates the search SQL by including a taxonomy search. … … 751 803 } 752 804 add_filter( 'wp_title', 'wptv_wp_title', 10, 2 ); 805 806 /** 807 * Append the slide URL to the excerpt 808 * 809 * @param string $excerpt 810 * 811 * @return string 812 */ 813 function wptv_excerpt_slides( $excerpt ) { 814 $slides = get_post_meta( get_the_ID(), '_wptv_slides_url', true ); 815 816 if ( ! empty( $slides ) ) { 817 $excerpt .= '<p><a href="' . esc_url( $slides ) . '">Presentation Slides »</a></p>'; 818 } 819 820 return $excerpt; 821 } 822 add_filter( 'get_the_excerpt', 'wptv_excerpt_slides' ); -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php
r1030 r1044 51 51 'wptv_speakers', 52 52 'wptv_event', 53 'wptv_slides_url' 53 54 ); 54 55 … … 275 276 $description = $this->sanitize_text( $_posted['wptv_video_description'], false ); 276 277 $language = $this->sanitize_text( $_posted['wptv_language'] ); 278 $slides = $this->sanitize_text( $_posted['wptv_slides_url'] ); 277 279 $ip = $_SERVER['REMOTE_ADDR']; 278 280 … … 298 300 'categories' => $categories, 299 301 'description' => $description, 302 'slides' => $slides, 300 303 'ip' => $ip, 301 304 ); … … 332 335 $embed_args['blog_id'] = get_current_blog_id(); 333 336 $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 } 334 342 335 343 ?> … … 488 496 489 497 <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"> 490 506 <p class="label">Edit attachment:</p> 491 507 <p class="data"> … … 524 540 el.val(target.siblings('input[type="text"]').val()); 525 541 el.siblings('.tagadd').click(); 526 } else if ( id == '#title') {542 } else if ('#title' == id || '#wptv-slides-url' == id) { 527 543 el.val(target.siblings('input[type="text"]').val()); 528 544 } else if (id == '#excerpt') { -
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/sidebar-single.php
r1024 r1044 5 5 <p class="video-date"><?php echo get_the_date(); ?></p> 6 6 7 <?php if ( $post->post_excerpt) : ?>7 <?php if ( get_the_excerpt() ) : ?> 8 8 <div class="video-description"><?php the_excerpt(); ?></div> 9 9 <?php
Note: See TracChangeset
for help on using the changeset viewer.