• Resolved aunpric

    (@aunpric)


    Im testing Your code in my site i put the in function.php here is The code

    add_filter( 'tube_vc_filter_import_term', 'mytube_custom_import_terms' );
    
    function mytube_custom_import_terms( $import_term_ids, $source_site, $creator_name ){
     
      // custom terms per channel
      $custom_terms = array(
        'youtube-rihannavevo' => array( 2 ),
       );
      
      // create a slug from source site and creator name
      $key = $source_site.'-'.sanitize_title($creator_name);
    
      // if no custom terms, send back original value
      if ( ! array_key_exists( $key, $term_map ) ):
        return $import_term_ids;
      endif;
    
      // return the custom terms for this channel
      return $custom_terms[ $key ];
    
    }

    i import one video But didnt workout What is the problem

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

    (@tubegtld)

    DELETED

    • This reply was modified 7 years, 3 months ago by tubegtld. Reason: better answer below
    Plugin Author tubegtld

    (@tubegtld)

    I believe that code is from an earlier message in the thread.

    Below is the correct sample code, updated with your example channel and term ID.

    —————

    add_filter( 'tube_vc_filter_import_term', 'mytube_custom_import_terms', 10, 3 );
    
    function mytube_custom_import_terms( $import_term_ids, $source_site, $creator_name ){
    
      // custom terms per channel
      $custom_terms = array(
       'youtube-rihannavevo' => array( 2 ),
      );
    
      // create a slug from source site and creator name
      $key = $source_site.'-'.sanitize_title($creator_name);
    
      // if no custom terms, send back original value
      if ( ! array_key_exists( $key, $custom_terms ) ):
        return $import_term_ids;
      endif;
    
      // return the custom terms for this channel
      return $custom_terms[ $key ];
    
    }

    Please test and mark as resolved if it’s working for you.

    Thread Starter aunpric

    (@aunpric)

    Yeah Working Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem With Import In Particular Category’ is closed to new replies.