-
Notifications
You must be signed in to change notification settings - Fork 0
/
todaysmeet.php
59 lines (48 loc) · 1.83 KB
/
todaysmeet.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Plugin Name: TodaysMeet
* Plugin URI: * https://todaysmeet.com/help/faq/14
* Description: Embed TodaysMeet rooms in your posts and pages.
* Version: 1.0.4
* Author: TodaysMeet
* Author URI: https://todaysmeet.com/
* License: GPL2
*/
/* Copyright 2014 TodaysMeet, LLC (email: [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
defined("ABSPATH") or die("No script kiddies please!");
function todaysmeet_embed($atts) {
$options = shortcode_atts(array(
"id" => "none",
"type" => "transcript",
"participate" => "no",
"height" => 400,
"width" => "100%",
), $atts);
if (!ctype_digit($options["id"])) {
return "[ERROR: You must specify a room ID.]";
}
$url = "https://todaysmeet.com/room/{$options['id']}/embed?";
$params = array();
if ($options["type"] == "live") {
$params["type"] = "live";
} else {
$params["type"] = "transcript";
}
if ($options["participate"] != "yes") {
$params["hide_ui"] = 1;
}
$url .= http_build_query($params);
return "<iframe src=\"$url\" height=\"{$options["height"]}\" width=\"{$options["width"]}\"></iframe>";
}
add_shortcode("todaysmeet", "todaysmeet_embed");