', ' ', '', '' ) ); } return $links; } // ============================================== // Register and Enqueue popup script // ============================================== function cc_popup_script() { wp_register_script( 'popup', plugins_url() . "/" . basename(dirname(__FILE__)) . '/js/popup.js', array('jquery'), cc_popup_plugin_version(), false ); wp_enqueue_script( 'popup' ); } add_action('wp_enqueue_scripts', 'cc_popup_script'); // ============================================== // shortcode to add a link with the 'popup' class with data attributes for height, width and scrollbars // ============================================== function cc_popup_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'url' => '#', 'width' => '400', 'height' => '400', 'scrollbars' => 'yes', 'alt' => '' ), $atts ) ); $showscrollbars = esc_attr( $scrollbars ); if (strtolower( $showscrollbars ) == 'no') { $showscrollbars = '0'; } if ($showscrollbars != '0') { $showscrollbars = '1'; } return '' . $content . ''; } add_shortcode( 'popup', 'cc_popup_shortcode' );