Plugin Directory

Changeset 2651426


Ignore:
Timestamp:
12/31/2021 05:05:09 PM (4 years ago)
Author:
ankittiwaari
Message:

Return URL instead of attachment ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • video-metabox-aoc/trunk/video-metabox-aoc.php

    r1880474 r2651426  
    33/**
    44 * Author: Ankit Tiwari
    5  * Author uri: http://artofcoding.in
    6  * Plugin uri: http://artofcoding.in/video-metabox
     5 * Author uri: https://artofcoding.in
     6 * Plugin uri: https://artofcoding.in/video-metabox
    77 * Plugin name: Video Metabox AOC
    88 * Description: This plugin allows you to upload video as a custom field for a post/page.
    9  * Version: 0.1
     9 * Version: 1.0
    1010 */
    1111function aoc_vid_register_meta_boxes()
     
    3131                    Your browser does not support the video tag.
    3232                </video><input type="hidden" name="aoc_vid_video" id="aoc_vid_vid_input" value="<?= intval($aoc_vid_video) ?>"><button data-vid-id="<?= intval($aoc_vid_video) ?>" class="aoc-del-vid" type="button">X</button></div>
    33             <?php
     33        <?php
    3434        endif;
    3535        ?>
     
    4444{
    4545    // if (!wp_verify_nonce($_POST['aoc_vid_save_vid_nonce'], 'aoc_vid_save_video')) {
    46        
     46
    4747    //     return;
    4848    // }
     
    6969
    7070    $vid = get_post_meta($post_id, 'aoc_vid_video', true);
    71     return $vid;
     71    return wp_get_attachment_url($vid);
    7272}
Note: See TracChangeset for help on using the changeset viewer.