Browse files

Fixes enqueue script and style issues.

* Fixes add_action for plugin styles.
* Fixes registering styles as scripts instead of styles.
* Fixes enqueued id for plugin styles.
* Fixes spelling error.
  • Loading branch information...
1 parent abf0b19 commit 16665e40f395a231c5270a7f9bc9cc3f34cf9b05 @manovotny manovotny committed Jun 11, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 plugin.php
View
12 plugin.php
@@ -26,7 +26,7 @@
*/
-// TODO: rename this class to a proper name for yuour plugin
+// TODO: rename this class to a proper name for your plugin
class PluginName {
/*--------------------------------------------*
@@ -46,7 +46,7 @@ function __construct() {
add_action( 'admin_enqueue_scripts', array( &$this, 'register_admin_scripts' ) );
// Register site styles and scripts
- add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_styles' ) );
+ add_action( 'wp_print_styles', array( &$this, 'register_plugin_styles' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_scripts' ) );
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
@@ -92,8 +92,8 @@ function deactivate( $network_wide ) {
public function register_admin_styles() {
// TODO change 'plugin-name' to the name of your plugin
- wp_register_script( 'plugin-name-admin-styles', plugins_url( 'plugin-name/css/admin.css' ) );
- wp_enqueue_script( 'plugin-name-admin-styles' );
+ wp_register_style( 'plugin-name-admin-styles', plugins_url( 'plugin-name/css/admin.css' ) );
+ wp_enqueue_style( 'plugin-name-admin-styles' );
} // end register_admin_styles
@@ -114,8 +114,8 @@ public function register_admin_scripts() {
public function register_plugin_styles() {
// TODO change 'plugin-name' to the name of your plugin
- wp_register_script( 'plugin-name-admin-styles', plugins_url( 'plugin-name/css/display.css' ) );
- wp_enqueue_script( 'plugin-name-admin-styles' );
+ wp_register_style( 'plugin-name-plugin-styles', plugins_url( 'plugin-name/css/display.css' ) );
+ wp_enqueue_style( 'plugin-name-plugin-styles' );
} // end register_plugin_styles

0 comments on commit 16665e4

Please sign in to comment.