plugin_name = $plugin_name; $this->version = $version; $this->getCurrentBackground(); } /** * The current background color. * * @since 1.0.0 * @access private * @var string $activeBackgroundColor The current background color. */ private $activeBackgroundColor; /** * The current user id. * * @since 1.0.0 * @access private * @var string $currentUserId The current user id. */ private $currentUserId; /** * Register the JavaScript for the admin area. * * @since 1.0.0 * @access public */ public function enqueueScripts() { // Register the script wp_register_script($this->plugin_name, plugins_url() . '/admin-panel-background-color/admin/js/admin.js', array('jquery', 'colorpicker/js'), $this->version, false); // Localize the script with new data $varArray = array( 'activeBackground' => __($this->$activeBackgroundColor, 'abcolor'), 'pluginsUrl' => plugins_url() ); wp_localize_script($this->plugin_name, 'phpVars', $varArray); // Enqueued script with localized data. wp_enqueue_script($this->plugin_name); wp_enqueue_script('colorpicker/js', plugins_url() . '/admin-panel-background-color/admin/js/HSV-HEX-Color-Picker-jQuery/jquery.colorpicker.js', array( 'jquery' ), $this->version, false); } /** * Create options for adding new color scheme. * * @since 1.0.0 * @access public * @todo use template */ public function addUserExtraFields($user_id) { ?>
|
|