Skip to content

Commit c7d53fd

Browse files
committed
Add ableplayer prefix to function names
1 parent e97f947 commit c7d53fd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ableplayer.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ function ableplayer_enqueue_scripts(){
6464

6565
/*
6666
*
67-
* Add support for [able-player] shortcode
67+
* Add support for [ableplayer] shortcode
6868
*
6969
*
7070
*/
7171

72-
function able_player_shortcode( $atts,$content=null ) {
72+
function ableplayer_shortcode( $atts,$content=null ) {
7373

7474
// Each of the following attributes can be passed with the [able-player] shortcode
7575
// 'id' and 'type' (video or audio) is required
@@ -79,7 +79,7 @@ function able_player_shortcode( $atts,$content=null ) {
7979

8080
// build complete array of all attributes; defaults will be overridden with user values
8181
$all_atts = shortcode_atts([
82-
'id' => get_unique_id(),
82+
'id' => ableplayer_get_unique_id(),
8383
'youtube-id' => '',
8484
'youtube-desc-id' => '',
8585
'youtube-nocookie' => '',
@@ -112,16 +112,16 @@ function able_player_shortcode( $atts,$content=null ) {
112112
$o = '<video ';
113113
$o .= ' id="'.$all_atts['id'].'"';
114114
$o .= ' data-able-player';
115-
if (is_true($all_atts['autoplay'])) {
115+
if (ableplayer_is_true($all_atts['autoplay'])) {
116116
$o .= ' autoplay';
117117
}
118-
if (is_true($all_atts['loop'])) {
118+
if (ableplayer_is_true($all_atts['loop'])) {
119119
$o .= ' loop';
120120
}
121-
if (is_true($all_atts['playsinline'])) {
121+
if (ableplayer_is_true($all_atts['playsinline'])) {
122122
$o .= ' playsinline';
123123
}
124-
if (is_true($all_atts['hidecontrols'])) {
124+
if (ableplayer_is_true($all_atts['hidecontrols'])) {
125125
$o .= ' data-hide-controls';
126126
}
127127
if (!empty($all_atts['preload'])) {
@@ -193,15 +193,15 @@ function able_player_shortcode( $atts,$content=null ) {
193193
return $o;
194194
}
195195
}
196-
add_shortcode('able-player', 'able_player_shortcode');
196+
add_shortcode('able-player', 'ableplayer_shortcode');
197197

198198
/*
199199
*
200200
* Supporting functions
201201
*
202202
*/
203203

204-
function get_unique_id() {
204+
function ableplayer_get_unique_id() {
205205

206206
// use add_option(), get_option(), update_option(), & delete_option()
207207
// to track the number of Able Player instances on the current page
@@ -221,7 +221,7 @@ function get_unique_id() {
221221
}
222222
}
223223

224-
function is_true($var) {
224+
function ableplayer_is_true($var) {
225225

226226
// $var is a Boolean parameter
227227
// check for all variations that might be considered 'true'

0 commit comments

Comments
 (0)