Explanation of Use', 'More Plugins', 'Elegant Themes' ); $links = array_merge( $links, $new_links ); } return $links; } add_filter( 'plugin_row_meta', 'alobaidi_slider_plugin_row_meta', 10, 2 ); include( plugin_dir_path(__FILE__).'/shortcodes-page.php' ); // Include shortcodes page include( plugin_dir_path(__FILE__).'/widget.php' ); // Include alobaidi slider widget // Include javascript and style function alobaidi_slider__js_css(){ wp_enqueue_style( 'alobaidi-slider-style', plugins_url( '/css/alobaidi-slider-style.css', __FILE__ ), false, false); wp_enqueue_script( 'alobaidi-slider-script', plugins_url( '/js/alobaidi-slider-script.js', __FILE__ ), array('jquery'), false, false); } add_action('wp_enqueue_scripts', 'alobaidi_slider__js_css'); // Add alobaidi slider shortcode function alobaidi_slider_( $atts, $content = null ) { Extract( shortcode_atts( array( "width" => "", "height" => "", "margin_bottom" => "", "auto" => "false", "time" => "3", "move" => "Right" ),$atts ) ); if( !empty($width) and !empty($margin_bottom) ){ $wrap_style = ' style="max-width:'.$width.'px; margin-bottom:'.$margin_bottom.'px;"'; }elseif( !empty($width) and empty($margin_bottom) ){ $wrap_style = ' style="max-width:'.$width.'px;"'; }elseif( empty($width) and !empty($margin_bottom) ){ $wrap_style = ' style="margin-bottom:'.$margin_bottom.'px;"'; }else{ $wrap_style = null; } if( !empty($height) ){ $height_style = ' style="height:'.$height.'px;padding-bottom:0;"'; }else{ $height_style = null; } if( $auto == "true" ){ $slider_control = null; $id = rand().'-autoslider'; }else{ $slider_control = ''; $id = 'alobaidi-slider-standard-slider'; } if( $move == "left" or $move == "Left" ){ $move = "Left"; }else{ $move = "Right"; } $clean_content = strip_tags($content); ob_start(); ?>
>
>
"", "img" => "", "before_img" => "", "cap" => "", "before_cap" => "", "video" => "" ),$atts ) ); $the_list = null; $img_before_o = null; $img_before_c = null; $the_cap = null; $vimeo_regex = '/(https?:\/\/vimeo.com\/)|(www.vimeo.com\/)|(vimeo.com\/)|(https?:\/\/www.vimeo.com\/)/'; $youtube_regex = '/(https?:\/\/youtube.com\/watch)|(www.youtube.com\/watch)|(youtube.com\/watch)|(https?:\/\/www.youtube.com\/watch)|(https?:\/\/youtu.be)|(www.youtu.be)|(youtu.be)|(https?:\/\/www.youtu.be)/'; $instagram_regex = '/(https?:\/\/instagram.com\/p)|(www.instagram.com\/p)|(instagram.com\/p)|(https?:\/\/www.instagram.com\/p)|(https?:\/\/instagr.am\/p)|(www.instagr.am\/p)|(instagr.am\/p)|(https?:\/\/www.instagr.am\/p)/'; if( !empty($url) or !empty($img) or !empty($video) ){ if( !empty($img) ){ $url = $img; } if( !empty($video) ){ $url = $video; } if( preg_match($vimeo_regex, $url) ){ $protocol = array('http://', 'https://', 'www.', 'vimeo.com', '/'); $str_replace = str_replace($protocol, '', $url); $video_link = preg_replace('/[a-zA-Z]/', '', $str_replace); $the_list = ''; } elseif( preg_match($youtube_regex, $url) ){ $protocol = array('http://', 'https://', 'www.', 'youtube.com', 'youtu.be', 'embed', 'watch?v=', '/'); $str_replace = str_replace($protocol, '', $url); $video_link = preg_replace( array('/[^&?]*?=[^&?]*/', '/[(&)]/'), '', $str_replace ); $the_list = ''; } elseif( preg_match("/(keek.com)+/", $url) ){ $regex = array("/.*\\/(?=[^\\/]*\\/)|\\//m"); $preg_replace = preg_replace($regex, "", $url); $str_replace = str_replace("keek", "", $preg_replace); $embed_link = "https://www.keek.com/keek/$str_replace/embed?autoplay=0&mute=0&controls=1&loop=0"; $the_list = ''; } elseif( preg_match($instagram_regex, $url) ){ $regex = array("/[^&?]*?=[^&?]*/", "/[(?)]/", "/(\/p\/)/"); $preg_replace = preg_replace($regex, "", $url); $protocol = array('http://', 'https://', 'www.', 'instagram.com', 'instagr.am', '/'); $str_replace = str_replace($protocol, "", $preg_replace); $instagram_image_link = 'https://instagram.com/p/'.$str_replace.'/media?size=l'; $the_list = ''; } else{ $img = $url; $the_list = ''; if( !empty($before_img) ){ $img_before_o = ''; $img_before_c = ''; }else{ $img_before_o = null; $img_before_c = null; } if( !empty($cap) ){ $the_cap = '

'.$cap.'

'; }elseif( !empty($before_cap) and !empty($cap) ){ $the_cap = '

'.$cap.'

'; }else{ $the_cap = null; } } $result = $img_before_o.$the_list.$img_before_c.$the_cap; return '
  • '.$result.'
  • '; } } add_shortcode("alobaidislider_c", "alobaidi_slider__content"); ?>