Making WordPress.org

Changeset 9744


Ignore:
Timestamp:
04/20/2020 02:21:57 AM (5 years ago)
Author:
dd32
Message:

WordPress.TV: Set the initial title for video files to that of the parent post.

Fixes #4667.

File:
1 edited

Legend:

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

    r8380 r9744  
    152152        $filepath = $file['file'];
    153153
     154        $parent_post = get_post( $parent_id );
     155
    154156        $attachment = array(
    155             'post_title'     => $this->sanitize_text( $name ),
     157            'post_title'     => $parent_post->post_title ?: sanitize_file_name( $name ),
     158            'post_name'      => sanitize_title_with_dashes( sanitize_file_name( $name ) ),
    156159            'guid'           => $file['url'],
    157160            'post_mime_type' => $file['type'],
Note: See TracChangeset for help on using the changeset viewer.