Plugin Directory

Changeset 1220553


Ignore:
Timestamp:
08/14/2015 04:20:45 AM (11 years ago)
Author:
Blrt
Message:

UPDATE VIA SCRIPT, VERSION 1.0.1

Location:
blrt-wp-embed
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • blrt-wp-embed/trunk/blrt-wp-embed.php

    r1073065 r1220553  
    44* Plugin URI: http://www.blrt.com/wordpress-plugin
    55* Description: Enable embedding Blrts in your pages and posts by simply pasting in the URL of a public or private Blrt - just like YouTube videos are embedded utilising oEmbed.
    6 * Version: 1.0.0
     6* Version: 1.0.1
    77* Author: Blrt
    88* Author URI: http://www.blrt.com
     
    3939    private function add_oembed_providers() {
    4040        $convertible_servers = $this->get_convertible_servers();
     41        $convertible_short_servers = $this->get_convertible_short_servers();
    4142        $oembed_server = $this->get_oembed_server();
    4243       
    43         if(!($convertible_servers && $oembed_server)) return false;
     44        if(!($convertible_servers && $convertible_short_servers && $oembed_server)) return false;
    4445       
    4546        $preg_convertible_servers = '(' . implode( '|', array_map( 'preg_quote', $convertible_servers ) ) . ')';
    46         wp_oembed_add_provider( "#https?://$preg_convertible_servers/(conv/.*?/)?blrt/.*#i", "https://$oembed_server/oembed", true );
    47        
     47        $preg_convertible_short_servers = '(' . implode( '|', array_map( 'preg_quote', $convertible_short_servers ) ) . ')';
     48        wp_oembed_add_provider( "#https?://$preg_convertible_servers/(embed/?/)?(conv/.*?/)?blrt/.*#i", "https://$oembed_server/oembed", true );
     49        wp_oembed_add_provider( "#https?://$preg_convertible_short_servers/.*#i", "https://$oembed_server/oembed", true );
    4850        return true;
    4951    }
     
    5557        ) );
    5658    }
     59
     60    private function get_convertible_short_servers() {
     61        return apply_filters( 'blrt_wp_embed_convertible_short_servers' , array(
     62            'r.blrt.com'
     63        ) );
     64    }
    5765   
    5866    private function get_oembed_server() {
  • blrt-wp-embed/trunk/readme.txt

    r1073085 r1220553  
    33Tags: Blrt,Embed,oembed
    44Requires at least: 2.9
    5 Stable tag: 1.0.0
    6 Tested up to: 4.1
     5Stable tag: 1.0.1
     6Tested up to: 4.2
    77License: GPL2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.