• Hello!

    I have this function in a plugin, which transform automatically an embed youtube video into a custom field :

    function find_ytid($postID, $post) {
    if($parent_id = wp_is_post_revision($postID))
    {
    $postID = $parent_id;
    }
    $content = $_POST['content'];
    if (preg_match(‘/http:\/\/www.youtube\.com\/v\/([a-zA-Z0-9\-\_]{11})/’, $content, $yturl) !=”) {
    $ytid = substr($yturl[0], 25, 31);
    $custom = ‘https://img.youtube.com/vi/’.$ytid.’/hqdefault.jpg’;
    update_custom_meta($postID, $custom ,’ytthumb_url’);
    }

    This function runs perfectly in wordpress, but doesn’t run when a user posts an article via TDO Mini Forms (I’m obliged to edit the article in order to create automatically the custom field).

    Anyone can help me to hack this code, in order the custom field can be created automatically when a user submits content via TDO Mini Forms ?

    Thanks and sorry for my bad english.

  • The topic ‘Conditionnal function for TDO Mini Forms’ is closed to new replies.