Custom Fields
Re-Envisioned
Support Meta Box Group How to the video field for group type?

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 year, 3 months ago.

  • Creator
    Topic
  • #8793
    Resolved
    alisha
    Participant

    Hello,
    How are you doing?Hope doing well.Now let you know my problem.
    Simply, I cannot display video field using group type.
    I am using following code to create meta box:
    https://pastebin.com/G2wbrww4
    I am using following codes to show the video but no result:
    https://pastebin.com/AnzedNNE
    It shows following error:
    Warning: Illegal string offset ‘src’ in C:\wamp\www\wordpress\wp-content\themes\skeleton\framework\about-us\facility.php on line 41
    please help me.
    Thanks

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #8805

    Anh Tran
    Keymaster

    Hi,

    Thanks. I’m good 🙂

    Regarding the video field, when getting from the group, it’s just the IDs of the uploaded videos. To output the videos, you can do like this:

    <?php
    foreach ( $facilities_videos as $facilities_video ) {
        $facilities_video = RWMB_Video_Field::file_info( $facilities_video );
        ?>
        <video src="<?php echo $facilities_video['src']; ?>">
    <?php } ?>
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.