• Resolved cnaughton

    (@cnaughton)


    How do I control what information is imported from YouTube? The plugin works great I just want to modify it so that the only thing that imports into the post description is this text:

    Source: channel name here
    video url link here

    How would I do this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author tubegtld

    (@tubegtld)

    This should do the trick…

    add_action( 'updated_post_meta' , 'my_custom_tube_import_post', 10, 4 );
    
    function my_custom_tube_import_post( $meta_id, $object_id, $meta_key, $_meta_value ) {
    
      if ( 'tube_video_creator_name' != $meta_key ) return;
    
      $url = get_post_meta( $object_id, 'tube_video_oembed_url', true );
    
      $my_post = array(
        'ID'           => $object_id,
        'post_content' => 'Source: ' . $_meta_value . '<br /><a href="'.$url.'">' . $url. '</a>',
      );
    
      wp_update_post( $my_post );
    
    }

    Please mark as resolved if so.

    Thread Starter cnaughton

    (@cnaughton)

    Thank you so much. Just one quick question…where do I post this information? Which file and what is the path?

    Plugin Author tubegtld

    (@tubegtld)

    You can put it either (a) in the functions.php file of a child theme or (b) in a plugin.

    Plugin Author tubegtld

    (@tubegtld)

    Hey, have you tried this out yet?

    Plugin Author tubegtld

    (@tubegtld)

    Marking resolved due to lack of reply.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Customize Import Settings’ is closed to new replies.