• Plugin Author nimmolo

    (@nimmolo)


    Hi Sylvia,
    My error log is returning “Undefined Offset” for the following lines near the end of external-videos.php:

    The undefined offset seems to be the offset for the $host, $duration and $thumbnail, maybe the stored values are not arrays?

    add_action('manage_posts_custom_column', 'sp_external_videos_custom_columns');
    function sp_external_videos_custom_columns($column_name)
    {
        global $post;
        $duration  = get_post_meta($post->ID, 'duration');
        $host      = get_post_meta($post->ID, 'host_id');
        $thumbnail = get_post_meta($post->ID, 'thumbnail_url');
    
        switch($column_name) {
        case 'ID':
            echo $post->ID;
            break;
    
        case 'thumbnail':
            echo "<img src='".$thumbnail[0]."' width='120px' height='90px'/>";
            break;
    
        case 'duration':
            echo $duration[0];
            break;
    
        case 'published':
            echo $post->post_date;
            break;
    
        case 'host':
            echo $host[0];
            break;

    It’s just those three variables with the [0] offset producing the errors.

    https://wordpress.org/plugins/external-videos/

  • The topic ‘Error log report for 3.9’ is closed to new replies.