Skip to content

Commit

Permalink
Start work on moving JS to static file instead of inline. Also some s…
Browse files Browse the repository at this point in the history
…mall various fixes including a wrong nonce name.
  • Loading branch information
Viper007Bond committed Sep 16, 2015
1 parent 45a2fe9 commit aad0f1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions regenerate-thumbnails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jQuery(document).ready(function ($) {

});
11 changes: 6 additions & 5 deletions regenerate-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Author URI: http://www.viper007bond.com/
Text Domain: regenerate-thumbnails
Domain Path: /localization/
Domain Path: /localization
**************************************************************************
Expand Down Expand Up @@ -99,11 +99,11 @@ public static function instance() {
}

/**
* Does the inital setup of the instance of this class including loading the localization
* Does the initial setup of the instance of this class including loading the localization
* file, registering the various actions and filters, and filtering the plugin's capability.
*/
public function setup() {
load_plugin_textdomain( 'regenerate-thumbnails', false, '/regenerate-thumbnails/localization' );
load_plugin_textdomain( 'regenerate-thumbnails', false, dirname( plugin_basename( __FILE__ ) ) . '/localization/' );

// Add a new item to the Tools menu in the admin menu
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
Expand Down Expand Up @@ -150,8 +150,9 @@ public function admin_enqueues( $hook_suffix ) {
return;
}

wp_enqueue_script( 'jquery-ui-progressbar' );
wp_enqueue_script( 'regenerate-thumbnails', plugins_url( 'regenerate-thumbnails.js', __FILE__ ), array( 'jquery', 'jquery-ui-progressbar' ), $this->version );

// This will be removed as soon as https://core.trac.wordpress.org/ticket/18909 is eventually addressed
wp_enqueue_style( 'jquery-ui-regenthumbs', plugins_url( 'jquery-ui/redmond/jquery-ui-1.7.2.custom.css', __FILE__ ), array(), $this->version );
}

Expand Down Expand Up @@ -308,7 +309,7 @@ public function regenerate_interface() {
// Form nonce check
check_admin_referer( $this->create_nonce_name( $images ) );
} else {
check_admin_referer( 'regenerate_thumbnails' );
check_admin_referer( 'regenerate-thumbnails' );

// Directly querying the database is normally frowned upon, but all
// of the API functions will return the full post objects which will
Expand Down

0 comments on commit aad0f1f

Please sign in to comment.