Advertisement
Guest User

Untitled

a guest
Oct 10th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. class IBLikeable {
  2.  
  3.     //constructor and other setup functions
  4.  
  5.     function register_admin_menus() {
  6.  
  7.         $hook = add_options_page('ibLikeable Settings', 'ibLikeable', 'manage_options', $this->prefix, array( $this, 'render_settings_page' ) );
  8.         $this->settings_hook = $hook;
  9.  
  10.         add_action( 'admin_print_scripts-' . $hook, array( $this, 'enqueue_admin') );
  11.  
  12.     }
  13.     // ... more code ...
  14.  
  15.     function enqueue_admin() {
  16.         $screen = get_current_screen();
  17.  
  18.         if( $screen->id == $this->settings_hook ) {
  19.             wp_register_style($this->prefix . '-settings', $this->url . 'css/settings_page.css' );
  20.             wp_enqueue_style( $this->prefix . '-settings');
  21.             wp_register_script( $this->prefix . '-settings-js', $this->url . 'js/settings_page.js', array('jQuery') );
  22.             wp_enqueue_script($this->prefix . '-settings-js');
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement