• Resolved aceone999

    (@aceone999)


    When you upload an video whit an custom field, the video extension in the custom field is not changed when the video gets converted.
    Example:
    I convert every video to an .mp4 file.
    And I use the custom field ‘video’ to upload an video. The field saves just the path to the actual file, like this:
    ‘example.com//wp-content/uploads/video.mkv’
    After conversion the file is still named video.mkv instead of video.mp4 and can’t be displayed on the website.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    I can see how that would be a problem, but I’m not sure how my plugin could know that your custom field exists and needs to be modified. That’s kind of the nature of custom fields, they are custom. Are you using a plugin to generate the field?

    Thread Starter aceone999

    (@aceone999)

    Yes. i have front end form where user can submit videos.
    I would guess you could search for the uploaded video name in custom fields?

    Thread Starter aceone999

    (@aceone999)

    I used regex in single.php to solve this.

     if ( get_post_meta($post->ID, 'video', true) !== '' ) {
                                                    echo '<center><video controls> <source src="'; $video = ( get_post_meta($post->ID, 'video', true)); $newname = preg_replace('/\.[^.]+$/', '.mp4', $video); echo ($newname); echo '"video/mp4"></video></center>';
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Name not updated when custom field’ is closed to new replies.