/** * Enqueue the admin stylesheet when needed. */ function enqueue_admin_stylesheet($hook) { $this->slplus->debugMP('slp.main', 'msg', 'SLPlus_AdminUI::' . __FUNCTION__); if ($this->slplus->check_isOurAdminPage()) { wp_enqueue_style($this->styleHandle); } }
/** * method: admin_init() * * Called when the WordPress admin_init action is processed. * * Builds the interface elements used by WPCSL-generic for the admin interface. * */ function admin_init() { // Already been here? Get out. if ($this->initialized) { return; } $this->initialized = true; // Update system hook // Premium add-ons can use the admin_init hook to utilize this. // require_once SLPLUS_PLUGINDIR . '/include/class.updates.php'; // If we are on an SLP controlled admin page // if ($this->slplus->check_isOurAdminPage()) { // Admin UI Helpers // $this->attachAdminUI(); add_action('admin_enqueue_scripts', array($this->slplus->AdminUI, 'enqueue_admin_stylesheet')); $this->slplus->AdminUI->build_basic_admin_settings(); // Admin WPML Helper // $this->attachAdminWPML(); $this->slplus->AdminWPML->setParent(); // Action hook for 3rd party plugins // do_action('slp_admin_init_complete'); } }
/** * Instantiate a settings object. * * @param mixed[] $params */ function __construct($params) { // Default Params // $this->render_csl_blocks = true; // Display the CSL info blocks $this->form_action = 'options.php'; // The form action for this page $this->save_text = __('Save Changes', 'csa-slplus'); // Passed Params // foreach ($params as $name => $value) { $this->{$name} = $value; } // Set helper for help on settings panel items. // $this->helper = isset($this->parent) && isset($this->parent->helper) ? $this->parent->helper : new wpCSL_helper__slplus(array('slplus' => $this)); if (isset($this->parent) && $this->parent->check_isOurAdminPage() && isset($_REQUEST['page']) && $_REQUEST['page'] === 'slp_info') { add_action('admin_init', array($this, 'create_InfoSection'), 99); } }
/** * method: admin_init() * * Called when the WordPress admin_init action is processed. * * Builds the interface elements used by WPCSL-generic for the admin interface. * */ function admin_init() { if (!$this->set_Plugin()) { return; } // Already been here? Get out. if ($this->initialized) { return; } $this->initialized = true; // Update system hook // Premium add-ons can use the admin_init hook to utilize this. // require_once SLPLUS_PLUGINDIR . '/include/class.updates.php'; // Activation Helpers // Updates are handled via WPCSL via namespace style call // require_once SLPLUS_PLUGINDIR . '/include/class.activation.php'; $this->plugin->Activate = new SLPlus_Activate(); register_activation_hook(__FILE__, array($this->plugin->Activate, 'update')); // WP built-in activation call // If we are on an SLP controlled admin page // if ($this->plugin->check_isOurAdminPage()) { // Update the broadcast URL with the registered plugins // registered plugins are expected to tell us they are here using // slp_init_complete // $this->plugin->broadcast_url = $this->plugin->broadcast_url . '&' . $this->plugin->AdminUI->create_addon_query(); $this->plugin->settings->broadcast_url = $this->plugin->broadcast_url; // Admin UI Helpers // $this->attachAdminUI(); add_action('admin_enqueue_scripts', array($this->plugin->AdminUI, 'enqueue_admin_stylesheet')); $this->plugin->AdminUI->build_basic_admin_settings(); // Admin WPML Helper // $this->attachAdminWPML(); $this->plugin->AdminWPML->setParent(); // Action hook for 3rd party plugins // do_action('slp_admin_init_complete'); } }
/** * Enqueue the admin stylesheet when needed. */ function enqueue_admin_stylesheet($hook) { if ($this->slplus->check_isOurAdminPage()) { wp_enqueue_style($this->styleHandle); } }