Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Change this block in cardozawppoll.php
- <?php
- /*
- Plugin Name: Cardoza Wordpress Poll
- Plugin URI: http://fingerfish.com/cardoza-wordpress-poll
- Description: Cardoza Wordpress Poll is completely ajax powered polling system. This poll plugin supports both single and multiple selection of answers.
- Version: 1.0
- Author: Vinoj Cardoza
- Author URI: http://fingerfish.com/about-me/
- License: GPL2
- */
- define('CWP_PGN_DIR', plugin_dir_url(__FILE__));
- require_once 'app/CWPController.class.php';
- /* To include the stylesheets */
- wp_enqueue_style('cwpcss', CWP_PGN_DIR.'public/css/CWPPoll.css');
- /* To include the javascripts */
- wp_enqueue_script('cwp-main', CWP_PGN_DIR.'public/js/CWPPoll.js', array('jquery'));
- add_action('wp_head','cwppoll_ajaxurl');
- add_action('plugins_loaded', 'trigger_init');
- register_activation_hook ( __FILE__, 'CWP_Install' );
- function cwppoll_ajaxurl() {
- ?>
- <script type="text/javascript">
- var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
- </script>
- <?php
- }
- function trigger_init(){
- if(is_admin){
- $cwp = new CWPController();
- $cwp->init();
- }
- register_sidebar_widget(__('Cardoza Wordpress Poll'), 'widget_cardoza_wp_poll');
- }
- ========================================================
- to
- ========================================================
- <?php
- /*
- Plugin Name: Cardoza Wordpress Poll
- Plugin URI: http://fingerfish.com/cardoza-wordpress-poll
- Description: Cardoza Wordpress Poll is completely ajax powered polling system. This poll plugin supports both single and multiple selection of answers.
- Version: 1.0
- Author: Vinoj Cardoza
- Author URI: http://fingerfish.com/about-me/
- License: GPL2
- */
- define('CWP_PGN_DIR', plugin_dir_url(__FILE__));
- require_once 'app/CWPController.class.php';
- // add a function to load scripts
- add_action( 'admin_init', 'cwppol_scripts');
- // add_action('wp_print_styles', 'cwppol_styles');
- add_action('admin_head', 'cwppol_styles');
- function cwppol_styles(){
- /* To include the stylesheets */
- wp_register_style('cwpcss', CWP_PGN_DIR.'public/css/CWPPoll.css');
- wp_enqueue_style( 'cwpcss');
- }
- function cwppol_scripts(){
- /* To include the javascripts */
- wp_register_script(
- 'cwp-main',
- CWP_PGN_DIR.'public/js/CWPPoll.js',
- array( 'jquery'),
- false,
- true
- );
- // add the script to fill the box
- wp_enqueue_script('cwp-main');
- }
- add_action('wp_head','cwppoll_ajaxurl');
- add_action('plugins_loaded', 'trigger_init');
- register_activation_hook ( __FILE__, 'CWP_Install' );
- function cwppoll_ajaxurl() {
- ?>
- <script type="text/javascript">
- var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
- </script>
- <?php
- }
- function trigger_init(){
- if(is_admin()){
- $cwp = new CWPController();
- $cwp->init();
- }
- wp_register_sidebar_widget('cwppoll', __('Cardoza Wordpress Poll'), 'widget_cardoza_wp_poll');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement