How to create a custom field?

Discussion in 'PHP' started by ibadullah, Mar 1, 2014.

  1. #1
    Hello,

    I'm trying to create a custom field in WordPress to add vine videos.

    I found the guide which demonstrate how to add a custom meta box for YouTube videos only.
    http://www.iamclarence.com/blog/2012/02/23/wordpress-101-adding-a-youtube-meta-box-to-pagepost-editing/

    Can anyone help me to change that metabox from YouTube Videos to Vine.co Videos?

    This is the function to OutPut the Vine
    function vine($id) { // gets the raw .mp4 url from the vine id
        $vine = file_get_contents("http://vine.co/v/{$id}");
        preg_match('/property="twitter:player:stream" content="(.*?)"/', $vine, $matches);
        return ($matches[1]) ? $matches[1] : false;
    }
    PHP:
    Another function I want to merge is to get the vine featured image and set it automatically in wordpress
    https://halgatewood.com/php-get-vine-app-video-thumbnail/
     
    ibadullah, Mar 1, 2014 IP
  2. Bahman

    Bahman Member

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    it's not that easy as it sounds ... if you want I can fix it for you ...
     
    Bahman, Mar 2, 2014 IP
  3. Bahman

    Bahman Member

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    it's not that easy as it sounds ... if you want I can fix it for you ...
     
    Bahman, Mar 2, 2014 IP
  4. ibadullah

    ibadullah Active Member

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    63
    #4
    If you can fix this for me it will be greatly appreciated.

    I've another function but it works using short code and I am trying to implement this function like this method

    Thanks in advance.
     
    ibadullah, Mar 2, 2014 IP
  5. joti5678

    joti5678 Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #5
    oww good ,it will be helpful to me .thanks man
     
    joti5678, Mar 9, 2014 IP