Home Forums Backend Issues (wp-admin) Jquery oEmbed value event Reply To: Jquery oEmbed value event

  • Oh, now i got it. the problem seem to be with my rows that are added by jquery.

    If i use your code with a row already exists it works, but on my code i add rows with jquery this way (to pull videos from youtube channel into those rows…):

    	var ycLink = $('[data-name="yt_channel_url"] input').val();
    	var channelID = ycLink.split("/")[4];
    	// If has youtube channel
    			part : 'snippet', 
    			channelId : 'UCtGv4fb0btvvi9pGOt0UrEA',
    			type : 'video',
    			key: 'AIzaSyB_VnQhWmlxX0Z9kH_s3bejItXt04lYb6w'},
    			function(data) {
    			  $.each( data.items, function( i, item ) {
    				  $('[data-key="field_602ea4a8fe1ab"] a[data-event="add-row"]').last().trigger('click');
    				  var addedRow = $('[data-key="field_602ea4a8fe1ab"] .acf-clone').prev();
    				  addedRow.find('[data-name="yt_title"] input').val(item.snippet.title);
    				  addedRow.find('[data-name="yt_url"] input').val('';
    	// If doesn't have youtube channel - alert Error
    	else {
    		alert('You don't have a youtube channel url defined');

    And when added like that the preview won’t load even i then type it manually into to the ‘.input-search’.

    Any idea why?