0, ), $_atts, $tag ); // get selected style $anit_current = $anit_options[ $atts['style'] ]; // get terms for current style $current_terms = array(); foreach($anit_current['taxonomies'] as $row){ $terms = get_terms( array( 'taxonomy' => $row, 'get' => 'all', )); foreach($terms as $term){ $current_terms[] = array( 'id' => $term->term_id, 'name' => $term->name, 'link' => get_term_link( $term->term_id ), ); } } // Set ID and script parameters array $actus_anit_id = "ANIT-" . time() . rand( 10,99 ); $actus_anit_params = array( 'id' => $actus_anit_id, 'current' => $anit_current, 'opts' => $anit_options, 'terms' => $current_terms, 'style' => $atts['style'], 'site_url'=> site_url(), 'plugin_dir' => ACTUS_ANIT_URL, ); // Call the animation script. wp_enqueue_script( 'actus_animated_tags_script', ACTUS_ANIT_URL . 'js/actus-animated-tags.js', array('jquery'), '2.0.1', true ); // // Send parameters to the animation script. wp_localize_script( 'actus_animated_tags_script', 'actusAnitParams', $actus_anit_params ); return actus_anit_html( $actus_anit_id ); } function actus_anit_html( $id ){ // Set Plugin Main HTML Container. $actus_anit_html = ""; $actus_anit_html .= '
'; $actus_anit_html .= '
'; $actus_anit_html .= '
'; $actus_anit_html .= '
'; $actus_anit_html .= '
'; return $actus_anit_html; } /** * Plugin Widget */ class actus_anit extends WP_Widget { // constructor function actus_anit() { parent::WP_Widget( false, $name = __('ACTUS Animated Tags Widget', 'wp_widget_actus_anit') ); } // widget form creation function form($instance) { // Check values if( $instance) { $title = esc_attr($instance['title']); } else { $title = ''; } ?>