Ejemplo n.º 1
0
 /**
  * load our CSS and JS files for the new user creation page
  *
  * @param  string  $hook      the page hook for the admin
  *
  * @return null
  */
 public function scripts_styles($hook)
 {
     // bail if we aren't on our page
     if (empty($hook) || !empty($hook) && $hook !== 'users_page_temporary-admin-user') {
         return;
     }
     // set our file suffixes
     $css_fx = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.css' : '.min.css';
     $js_fx = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.js' : '.min.js';
     // and our version
     $vers = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? time() : TMP_ADMIN_USER_VER;
     // load te CSS file
     wp_enqueue_style('tempadmin-user', plugins_url('css/tmpadmin' . $css_fx, __FILE__), array(), $vers, 'all');
     // load and localize
     wp_enqueue_script('tempadmin-user', plugins_url('js/tmpadmin' . $js_fx, __FILE__), array('jquery'), $vers, true);
     wp_localize_script('tempadmin-user', 'tempAdminData', array('ajaxUrl' => admin_url('admin-ajax.php'), 'makeNonce' => wp_create_nonce('tempadmin_make_js'), 'deltNonce' => wp_create_nonce('tempadmin_delete_js'), 'demtNonce' => wp_create_nonce('tempadmin_demote_js'), 'noEmail' => TempAdminUser_Utilities::get_admin_messages('noemail'), 'emptyRow' => TempAdminUser_Layout::empty_user_row()));
 }