Plugin Directory

Changeset 1477637


Ignore:
Timestamp:
08/18/2016 08:36:46 AM (10 years ago)
Author:
KOPATHEME Support
Message:

Release version 1.0.3 plugins nictitate-toolkit.

Location:
nictitate-toolkit
Files:
105 added
6 edited

Legend:

Unmodified
Added
Removed
  • nictitate-toolkit/trunk/Changelog.txt

    r1457319 r1477637  
    11Change log
     2
     3=== Aug 18 2016 ===
     41.0.3
     5    - Added function "nictitate_toolkit_get_video_thumbnails_url"
    26
    37=== Jul 20 2016 ===
  • nictitate-toolkit/trunk/nictitate-toolkit.php

    r1457319 r1477637  
    44Plugin URI: http://kopatheme.com
    55Description: A specific plugin use in Nictitate Theme to help you register post types and shortcodes.
    6 Version: 1.0.2
     6Version: 1.0.3
    77Author: kopatheme
    88Author URI: http://kopatheme.com
  • nictitate-toolkit/trunk/readme.txt

    r1457319 r1477637  
    44Requires at least: 3.8
    55Tested up to: 4.3
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.3
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1212
    1313A specific plugin use in Nictitate Theme to help you register post types and shortcodes.
     14
     15=== Aug 18 2016 ===
     161.0.3
     17    - Added function "nictitate_toolkit_get_video_thumbnails_url"
    1418
    1519== Changelog ==
  • nictitate-toolkit/trunk/util.php

    r1457319 r1477637  
    44   
    55    $all_cats = get_terms('portfolio_project');
    6     $categories = array('' => __('-- none --', 'friday-toolkit'));
     6    $categories = array('' => __('-- none --', 'nictitate-toolkit'));
    77    foreach ( $all_cats as $cat ) {
    88        $categories[ $cat->slug ] = $cat->name;
     
    1010
    1111    $all_tags = get_terms('portfolio_tag');
    12     $tags = array('' => __('-- none --', 'friday-toolkit'));
     12    $tags = array('' => __('-- none --', 'nictitate-toolkit'));
    1313    foreach( $all_tags as $tag ) {
    1414        $tags[ $tag->slug ] = $tag->name;
     
    1919            'type'  => 'text',
    2020            'std'   => '',
    21             'label' => __( 'Title:', 'friday-toolkit' ),
     21            'label' => __( 'Title:', 'nictitate-toolkit' ),
    2222        ),
    2323        'categories' => array(
    2424            'type'    => 'multiselect',
    2525            'std'     => '',
    26             'label'   => __( 'Categories:', 'friday-toolkit' ),
     26            'label'   => __( 'Categories:', 'nictitate-toolkit' ),
    2727            'options' => $categories,
    2828            'size'    => '5',
     
    3030        'relation'    => array(
    3131            'type'    => 'select',
    32             'label'   => __( 'Relation:', 'friday-toolkit' ),
     32            'label'   => __( 'Relation:', 'nictitate-toolkit' ),
    3333            'std'     => 'OR',
    3434            'options' => array(
    35                 'AND' => __( 'AND', 'friday-toolkit' ),
    36                 'OR'  => __( 'OR', 'friday-toolkit' ),
     35                'AND' => __( 'AND', 'nictitate-toolkit' ),
     36                'OR'  => __( 'OR', 'nictitate-toolkit' ),
    3737            ),
    3838        ),
     
    4040            'type'    => 'multiselect',
    4141            'std'     => '',
    42             'label'   => __( 'Tags:', 'friday-toolkit' ),
     42            'label'   => __( 'Tags:', 'nictitate-toolkit' ),
    4343            'options' => $tags,
    4444            'size'    => '5',
     
    4747            'type'  => 'select',
    4848            'std'   => 'DESC',
    49             'label' => __( 'Order:', 'friday-toolkit' ),
     49            'label' => __( 'Order:', 'nictitate-toolkit' ),
    5050            'options' => array(
    51                 'ASC'  => __( 'ASC', 'friday-toolkit' ),
    52                 'DESC' => __( 'DESC', 'friday-toolkit' ),
     51                'ASC'  => __( 'ASC', 'nictitate-toolkit' ),
     52                'DESC' => __( 'DESC', 'nictitate-toolkit' ),
    5353            ),
    5454        ),
     
    5656            'type'  => 'select',
    5757            'std'   => 'date',
    58             'label' => __( 'Orderby:', 'friday-toolkit' ),
     58            'label' => __( 'Orderby:', 'nictitate-toolkit' ),
    5959            'options' => array(
    60                 'date'          => __( 'Date', 'friday-toolkit' ),
    61                 'rand'          => __( 'Random', 'friday-toolkit' ),
    62                 'comment_count' => __( 'Number of comments', 'friday-toolkit' ),
     60                'date'          => __( 'Date', 'nictitate-toolkit' ),
     61                'rand'          => __( 'Random', 'nictitate-toolkit' ),
     62                'comment_count' => __( 'Number of comments', 'nictitate-toolkit' ),
    6363            ),
    6464        ),
     
    6666            'type'    => 'number',
    6767            'std'     => '5',
    68             'label'   => __( 'Number of posts:', 'friday-toolkit' ),
     68            'label'   => __( 'Number of posts:', 'nictitate-toolkit' ),
    6969            'min'     => '1',
    7070        )
     
    187187    return new WP_Query( $args );
    188188}
     189
     190function nictitate_toolkit_get_video_thumbnails_url($type, $url) {
     191    $thubnails = '';
     192    $matches = array();
     193    if ('youtube' === $type) {
     194        preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $url, $matches);
     195        $file_url = "http://gdata.youtube.com/feeds/api/videos/" . $matches[0] . "?v=2&alt=jsonc";
     196        $results = wp_remote_get($file_url);
     197
     198        if (!is_wp_error($results)) {
     199            $json = json_decode($results['body']);
     200            $thubnails = $json->data->thumbnail->hqDefault;
     201        }
     202    } else if ('vimeo' === $type) {
     203        preg_match_all('#(http://vimeo.com)/([0-9]+)#i', $url, $matches);
     204        $imgid = $matches[2][0];
     205
     206        $results = wp_remote_get("http://vimeo.com/api/v2/video/$imgid.php");
     207
     208        if (!is_wp_error($results)) {
     209            $hash = unserialize($results['body']);
     210            $thubnails = $hash[0]['thumbnail_large'];
     211        }
     212    }
     213    return $thubnails;
     214}
  • nictitate-toolkit/trunk/widgets/widget_posts_carousel.php

    r1457319 r1477637  
    164164
    165165                            if ( isset($video['type']) && isset($video['url']) ) {
    166                                 $video_thumbnail = nictitate_lite_get_video_thumbnails_url( $video['type'], $video['url'] );
     166                                $video_thumbnail = nictitate_toolkit_get_video_thumbnails_url( $video['type'], $video['url'] );
    167167                            }
    168168                        }
  • nictitate-toolkit/trunk/widgets/widget_posts_list.php

    r1457319 r1477637  
    150150
    151151                            if ( isset($video['type']) && isset($video['url']) ) {
    152                                 $video_thumbnail = nictitate_lite_get_video_thumbnails_url( $video['type'], $video['url'] );
     152                                $video_thumbnail = nictitate_toolkit_get_video_thumbnails_url( $video['type'], $video['url'] );
    153153                            }
    154154                        }
Note: See TracChangeset for help on using the changeset viewer.