Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter rynokins

    (@rynokins)

    Also – for

    $youtube->playlistItems->listPlaylistItems('snippet', $args);

    the videoId doesn’t need to be parsed out of the image url like so:

    $pattern = '/\/vi\/(.*)\//';
    preg_match($pattern, $newResult['thumb_url'], $matches, PREG_OFFSET_CAPTURE, 3);
    $newResult['id'] = $matches[1][0];

    – you can simply access it under

    $searchResult['snippet']['resourceId']['videoId'];

    Thread Starter rynokins

    (@rynokins)

    One more: change line #158 in script.js from

    jQuery('#loadMore, #approveAllBtn').addClass('hidden');

    to

    jQuery('#loadMore').addClass('hidden');

    so that the ‘Approve all listed videos’ button is not hidden upon loading a secondary page of videos.

    Thread Starter rynokins

    (@rynokins)

    Another useful change to the admin.php page – line #120, from

    <option value="<?php echo $user->ID; ?>" <?php if(esc_attr( get_option('yt_to_posts_author') ) === $user->ID){ echo 'selected'; } ?> ><?php echo $user->display_name; ?></option>

    to

    <option value="<?php echo $user->ID; ?>" <?php if( strval($user->ID) === get_option('yt_to_posts_author')){ echo 'selected="selected"'; } ?> ><?php echo $user->display_name; ?></option>

    Reason for this change: the selected WordPress user was not showing up in the select box after save, even though the yt_to_posts_author value was correctly changed and saved.

Viewing 3 replies - 1 through 3 (of 3 total)