aboutsummaryrefslogtreecommitdiffstats
path: root/GWP_bs3_panel_shortcode.php
diff options
context:
space:
mode:
Diffstat (limited to 'GWP_bs3_panel_shortcode.php')
-rw-r--r--GWP_bs3_panel_shortcode.php50
1 files changed, 3 insertions, 47 deletions
diff --git a/GWP_bs3_panel_shortcode.php b/GWP_bs3_panel_shortcode.php
index 8acc164..01ac7e9 100644
--- a/GWP_bs3_panel_shortcode.php
+++ b/GWP_bs3_panel_shortcode.php
@@ -5,7 +5,7 @@ class GWP_bs3_panel_shortcode{
* holds the name of the shortcode tag
* @var string
*/
- public $shortcode_tag = 'bs3_panel';
+ public $shortcode_tag = 'librevideojs';
/**
* __construct
@@ -14,9 +14,6 @@ class GWP_bs3_panel_shortcode{
* @param array $args
*/
function __construct($args = array()){
- //add shortcode
- add_shortcode($this->shortcode_tag, array($this, 'shortcode_handler'));
-
if (is_admin()){
add_action('admin_head', array($this, 'admin_head'));
add_action('admin_enqueue_scripts', array($this , 'admin_enqueue_scripts'));
@@ -24,47 +21,6 @@ class GWP_bs3_panel_shortcode{
}
/**
- * shortcode_handler
- * @param array $atts shortcode attributes
- * @param string $content shortcode content
- * @return string
- */
- function shortcode_handler($atts , $content = null){
- // Attributes
- extract( shortcode_atts(
- array(
- 'url' => 'no',
- 'footer' => 'no',
- 'code' => 'webm',
- ), $atts )
- );
-
- //make sure the panel type is a valid styled type if not revert to webm
- $panel_types = array('ogv','webm','mp4');
- $type = in_array($type, $panel_types)? $type: 'webm';
-
- //start panel markup
- $output = '<div class="panel panel-'.$type.'">';
-
- //check if panel has a header
- if ('no' != $header)
- $output .= '<div class="panel-heading">'.$header.'</div>';
-
- //add panel body content and allow shortcode in it
- $output .= '<div class="panel-body">'.trim(do_shortcode($content)).'</div>';
-
- //check if panel has a footer
- if ('no' != $footer)
- $output .= '<div class="panel-footer">'.$footer.'</div>';
-
- //add closing div tag
- $output .= '</div>';
-
- //return shortcode output
- return $output;
- }
-
- /**
* admin_head
* calls your functions into the correct filters
* @return void
@@ -89,7 +45,7 @@ class GWP_bs3_panel_shortcode{
* @return array
*/
function mce_external_plugins($plugin_array) {
- $plugin_array[$this->shortcode_tag] = plugins_url('librevideojs/js/mce-button.js' , __FILE__ );
+ $plugin_array[$this->shortcode_tag] = plugins_url('librevideojs/js/mce-button.js', __FILE__);
return $plugin_array;
}
@@ -110,7 +66,7 @@ class GWP_bs3_panel_shortcode{
* @return void
*/
function admin_enqueue_scripts() {
- wp_enqueue_style('bs3_panel_shortcode', plugins_url('librevideojs/css/mce-button.css' , __FILE__));
+ wp_enqueue_style('librevideojs_shortcode', plugins_url('librevideojs/css/mce-button.css', __FILE__));
}
}