Need to review the code
-
I got a notices when I activate your plugin. you need to change some code in sp-news-and-widget.php
1. Notice: Undefined variable: default in C:\Program Files (x86)\Apach…
2. Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.
I have a solution:
remove 336 to 340 line and add these code
function register_news(){
wp_register_style( 'cssnews', plugin_dir_url( __FILE__ ) . 'css/stylenews.css' );
wp_enqueue_style( 'cssnews' );
wp_register_script( 'vticker', plugin_dir_url( __FILE__ ) . 'js/jcarousellite.js', array( 'jquery' ) );
wp_enqueue_script( 'vticker' );
}
add_action( 'wp_enqueue_scripts', 'register_news' );
It will take care your number 2 notice problem.Thank you
- The topic ‘Need to review the code’ is closed to new replies.