Plugin Directory

Changeset 1856861


Ignore:
Timestamp:
04/12/2018 02:56:55 AM (8 years ago)
Author:
mathewemoore
Message:

1.0.3 (11 April 2018)

*Changes:*

  • Added new column to the YouTube Video Posts Screen showing last update time and date for use with the update videos bulk action.
Location:
import-youtube-by-northwoods-digital/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • import-youtube-by-northwoods-digital/trunk/import-youtube-nwdigital.php

    r1854704 r1856861  
    66* Author URI: https://northwoodsdigital.com
    77* Description: Import YouTube videos as posts with ease! An advanced plugin to create posts by importing YouTube videos as posts or video post type via the YouTube API v3.
    8 *   Version: 1.0.2
     8*   Version: 1.0.3
    99* Text Domain: import-youtube-nwdigital
    1010* License: GPLv2 or later
     
    154154    }
    155155
    156 // Add Featured Image URL to Rest API Json Response
     156/**
     157 * Add Custom Columns to the custom post type screen
     158 **/
     159add_filter( 'manage_edit-yih4-video_columns', 'edit_yih4_video_columns' ) ;
     160function edit_yih4_video_columns( $columns ) {
     161  $columns = array(
     162    'cb' => '<input type="checkbox" />',
     163    'title' => __( 'Video' ),
     164    'author' => __( 'Author' ),
     165    'categories' => __( 'Categories' ),
     166    'tags' => __( 'Tags' ),
     167    'comments' => '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>',
     168    'updated' => __( 'Last Update' ),
     169    'date' => __( 'Date' )
     170  );
     171  return $columns;
     172}
     173
     174add_action( 'manage_yih4-video_posts_custom_column', 'yih4_video_column_content', 10, 2 );
     175function yih4_video_column_content( $column_name, $post_id ) {
     176    if ( 'updated' != $column_name )
     177        return;
     178    //Get number of slices from post meta
     179    $yih4_updated_date = get_post_meta( $post_id, '_yih4_updated_date', true );
     180    $yih4_updated_time = get_post_meta( $post_id, '_yih4_updated_time', true );
     181    if ( empty( $yih4_updated_date ) )
     182      echo __( 'Never' );
     183    else
     184      echo esc_html($yih4_updated_date) . '<br>' . esc_html($yih4_updated_time);
     185}
     186
     187add_filter( 'manage_edit-yih4-video_sortable_columns', 'sortable_yih4_video_column' );
     188function sortable_yih4_video_column( $columns ) {
     189    $columns['updated'] = 'updated';
     190
     191    //To make a column 'un-sortable' remove it from the array
     192    //unset($columns['date']);
     193
     194    return $columns;
     195}
     196
     197/**
     198 * Add Featured Image URL to Rest API Json Response
     199 **/
    157200$options3 = get_option( 'yih4_nwd_tab_settings_3' );
    158201if(!empty($options3['yih4_tab_option_2'])){
  • import-youtube-by-northwoods-digital/trunk/includes/youtube-create-from-list.php

    r1854704 r1856861  
    195195        };
    196196    }   else /* update post if it already exists    */  {
     197
     198        date_default_timezone_set(get_option('timezone_string'));
     199      $yih4_updated_date = date('Y/m/d');
     200      $yih4_updated_time = date('h:i:s A');
     201
    197202        $update_post = array (
    198203            'ID'                        =>  $post->ID,
     
    212217                '_yih4_favoriteCount'   =>  $favoriteCount,
    213218                '_yih4_commentCount'        =>  $commentCount,
     219                '_yih4_updated_date'        => $yih4_updated_date,
     220                '_yih4_updated_time'        => $yih4_updated_time,
    214221            ),
    215222        );
  • import-youtube-by-northwoods-digital/trunk/readme.txt

    r1854707 r1856861  
    11=== Import YouTube by Northwoods Digital ===
    22Contributors: mathewemoore
    3 Tags: import youtube, import post, youtube, video, video import, youtube import, youtube import post, youtube to post, northwoodsdigital, northwoods digital, nwdigital
     3Tags: youtube, videos, import youtube, youtube importer, import video, video importer, youtube to post, google api, youtube api
    44Donate link: https://northwoodsdigital.com/donate
    55Requires at least: 4.0
    66Tested up to: 4.9
    77Requires PHP: 7.0
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4343== Changelog ==
    4444
    45 = Version 1.0.2 - 2018-4-8 =
     45= 1.0.3 (11 April 2018) =
     46
     47*Changes:*
     48
     49 * Added new column to the YouTube Video Posts Screen showing last update time and date for use with the update videos bulk action.
     50
     51= 1.0.2 (8 April 2018) =
     52
     53*Bugs:*
    4654
    4755 * Fixed duplicate thumbnail media when importing previously imported videos and using bulk updater.
    4856
    49 = Version 1.0.1 - 2018-4-6 =
     57= 1.0.1 (6 April 2018) =
     58
     59*Changes:*
    5060
    5161 * First public release
Note: See TracChangeset for help on using the changeset viewer.