* * @uses $codes_globals['sizes']['values'] * * @param string class * @param string color * @param string icon * @param string size * @param string url * @param string ... You can actually set up a custom attributes for this shortcode. They will be outputted as HTML attributes. */ //Shortcode attributes $defaults = apply_filters('wmhook_shortcode_' . '_defaults', array('class' => '', 'color' => '', 'icon' => '', 'size' => '', 'url' => '#'), $shortcode); $atts = apply_filters('wmhook_shortcode_' . '_attributes', $atts, $shortcode); //get the custom attributes in $atts['attributes'] //parameters: $defaults, $atts, $remove, $aside, $shortcode $atts = wma_shortcode_custom_atts($defaults, $atts, array('href'), array('class'), $prefix_shortcode . $shortcode); //Validation //class $atts['class'] = trim('wm-button ' . trim($atts['class'])); //content $atts['content'] = apply_filters('wmhook_shortcode_' . '_content', $content, $shortcode, $atts); $atts['content'] = apply_filters('wmhook_shortcode_' . $shortcode . '_content', $atts['content'], $atts); //color $atts['color'] = trim($atts['color']); if ($atts['color']) { $atts['class'] .= ' color-' . $atts['color']; } //size $atts['size'] = trim($atts['size']); if ($atts['size']) { if (in_array($atts['size'], array_keys($codes_globals['sizes']['values']))) {
* This file is being included into "../class-shortcodes.php" file's shortcode_render() method. * * @since 1.0 * @version 1.1.6 * * @param string class * @param string poster @link http://codex.wordpress.org/Video_Shortcode * @param string src * @param string ... For attributes please see @link http://codex.wordpress.org/Video_Shortcode. */ //Shortcode attributes $defaults = apply_filters('wmhook_shortcode_' . '_defaults', array('autoplay' => false, 'class' => '', 'loop' => false, 'poster' => '', 'src' => ''), $shortcode); $atts = apply_filters('wmhook_shortcode_' . '_attributes', $atts, $shortcode); //get the custom attributes in $atts['attributes'] //parameters: $defaults, $atts, $remove, $aside, $shortcode $atts = wma_shortcode_custom_atts($defaults, $atts, array('autoplay', 'loop', 'poster', 'src'), array(), $prefix_shortcode . $shortcode); //Validation //content $atts['content'] = ''; //src $atts['src'] = trim($atts['src']); if ($atts['src']) { if (stripos($atts['src'], 'mp4') || stripos($atts['src'], 'm4v') || stripos($atts['src'], 'webm') || stripos($atts['src'], 'ogv') || stripos($atts['src'], 'wmv') || stripos($atts['src'], 'flv')) { $atts['content'] = do_shortcode('[video src="' . esc_url($atts['src']) . '" poster="' . esc_url($atts['poster']) . '" autoplay="' . esc_attr($atts['autoplay']) . '" loop="' . esc_attr($atts['loop']) . '" ' . $atts['attributes'] . ' /]'); } else { $atts['content'] = wp_oembed_get(esc_url($atts['src'])); //Helper viariables $url_addons = ''; /** * Preparing output for YouTube and Vimeo *