Plugin Directory

Changeset 1410613


Ignore:
Timestamp:
05/04/2016 09:52:11 PM (10 years ago)
Author:
billknechtel
Message:

Remove Twig templating to resolve namespace collisions

Location:
responsive-video-light/trunk
Files:
2 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • responsive-video-light/trunk/readme.txt

    r1317605 r1410613  
    44Requires at least: 3.0
    55Tested up to: 4.4
    6 Stable tag: 1.4.0
     6Stable tag: 1.5.0
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616*    The ability to add one or more videos directly in to a page, post or any of your own custom post types using the video URL (not the embed code) or ID and a short code. Currently YouTube and Vimeo are supported, using the [responsive_youtube] and [responsive_vimeo] shortcodes, respectively.
    1717*    Fully responsive so the video's viewport will fill the width of the containing area and scale depending on screen size. No need to set a width and height, just set the width of the div your content sits in.
    18 *    YouTube videos have a shortcode attribute that lets you turn "related videos" on or off. "Related Videos" are the links that tile across the viewport when a video has completed playing. 
     18*    YouTube videos have a shortcode attribute that lets you turn "related videos" on or off. "Related Videos" are the links that tile across the viewport when a video has completed playing.
    1919*    YouTube videos also support light and dark themes, autoplaying, showinfo, and modest branding (which removes most YouTube brand imagery).
    2020*    Vimeo videos can have the video portrait, title, and byline shut off.
     
    2525For a YouTube video, you can specify either the full URL to the video or just the unique video ID, like this:
    2626
    27     [responsive_youtube http://www.youtube.com/watch?v=NbCr0UyoFJA ] 
     27    [responsive_youtube http://www.youtube.com/watch?v=NbCr0UyoFJA ]
    2828    [responsive_youtube NbCr0UyoFJA]
    2929
    3030And if you want to specify whether or not you'd like the "related videos" to display, you can use the "rel" or "norel" parameters in the shortcode syntax, like this:
    31  
     31
    3232    [responsive_youtube NbCr0UyoFJA norel]
    3333    [responsive_youtube NbCr0UyoFJA rel]
     
    3737Similarly, for a Vimeo video, you can use the full video player URL or just the video ID, like this:
    3838
    39     [responsive_vimeo https://vimeo.com/29506088 ] 
     39    [responsive_vimeo https://vimeo.com/29506088 ]
    4040    [responsive_vimeo 29506088]
    41    
     41
    4242There is a more complete treatment of the shortcode syntax in the settings screen of the plugin itself.
    4343
    4444= Requirements =
    4545
    46 * WordPress 3.0 + 
     46* WordPress 3.0 +
    4747
    4848== Installation ==
     
    7979
    8080== Changelog ==
     81
     82= 1.5.0 =
     83* Remove Twig templating altogether to resolve namespace collisions. Honestly, including the whole thing was a bit heavy-handed anyway - I didn't need but a tiny fraction of its functionality.  Replaced with "native" PHP code.
    8184
    8285= 1.4.0 =
  • responsive-video-light/trunk/responsive-video-light.php

    r1243683 r1410613  
    44 * Plugin URI: http://bitpusher.tk/responsive-video-light
    55 * Description: A plugin to add responsive videos to pages and posts
    6  * Version: 1.4.0
     6 * Version: 1.5.0
    77 * Author: Bill Knechtel
    88 * Author URI: http://bitpusher.tk
     
    2626
    2727$base_path = plugin_dir_path(__FILE__);
    28 require_once $base_path . '/twig/lib/Twig/Autoloader.php';
    29 
    30 Twig_Autoloader::register();
    31 $twig_loader = new Twig_Loader_Filesystem($base_path . '/templates');
    32 $twig = new Twig_Environment(
    33     $twig_loader,
    34     array('cache' => $base_path . '/twig_cache')
    35 );
    3628
    3729/**
     
    128120function rvl_plugin_options()
    129121{
    130     global $twig;
     122    global $base_path;
    131123    $options = get_option('rvl_options_field', array());
    132124
    133125    // Plugin options
    134     echo $twig->render('rvl_plugin_options_head.html');
     126    include $base_path . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'rvl_plugin_options_head.php';
    135127    wp_nonce_field('update-options');
    136128    settings_fields('rvl_options');
    137     echo $twig->render('rvl_plugin_options.html', $options);
     129    include $base_path . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'rvl_plugin_options.php';
    138130}
    139131
Note: See TracChangeset for help on using the changeset viewer.