ERALION.com Text Domain: animatedcounters Domain Path: /languages Version: 1.5 */ #---------------------------------------------------------------------------# function animatedcounter_func($atts) { if (is_numeric($atts['count'])) { $count=$atts['count']; } else { $count=100; } if (is_numeric($atts['duration'])) { $duration=$atts['duration']; } else { $duration=4000; } $css=''; if (!empty($atts['css'])) { $css=' '.$atts['css']; } $id=''; if (!empty($atts['id'])) { $id=' '.$atts['id']; } $style='style="'; if (!empty($atts['color'])) { $style.='color:'.$atts['color'].';'; } if (!empty($atts['size'])) { $style.='font-size:'.$atts['size'].';line-height:'.$atts['size'].';'; } $style.='"'; // return '0'; return ''; } add_shortcode( 'animatedcounter', 'animatedcounter_func' ); function animatedcounters_add_scripts(){ wp_register_script( 'jsanimatedcounter', plugins_url( 'js/app.js', __FILE__ ), array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'jsanimatedcounter' ); } add_action( 'wp_enqueue_scripts', 'animatedcounters_add_scripts' ); add_action( 'init', 'animatedcounters_buttons' ); function animatedcounters_buttons() { add_filter("mce_external_plugins", "animatedcounters_add_buttons"); add_filter('mce_buttons', 'animatedcounters_register_buttons'); } function animatedcounters_add_buttons($plugin_array) { $plugin_array['wptuts'] = plugins_url( 'js/animated-counters.min.js', __FILE__ ); return $plugin_array; } function animatedcounters_register_buttons($buttons) { array_push( $buttons, 'animatedcounter'); return $buttons; } function load_jquery() { if ( ! wp_script_is( 'jquery', 'enqueued' )) { wp_enqueue_script( 'jquery' ); } } add_action( 'wp_enqueue_scripts', 'load_jquery' ); ?>