Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions includes/wpum-admin/class-wpum-options-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function init() {
// Add a logo to the options panel.
$this->panel->add_image( WPUM_PLUGIN_URL . 'assets/images/logo.svg' );

// Register action buttons for the header.
$this->register_action_buttons();
// Register action buttons for the header on admin init to wait for the addons to load.
add_action( 'admin_init', array( $this, 'register_action_buttons' ) );

// Setup the options panel menu.
add_filter( 'wpum_menu', [ $this, 'setup_menu' ] );
Expand All @@ -54,7 +54,7 @@ public function init() {
/**
* Register action buttons for the options panel.
*/
private function register_action_buttons() {
public function register_action_buttons() {
$this->panel->add_action_button(
array(
'title' => __( 'View Addons', 'wp-user-manager' ),
Expand All @@ -68,6 +68,16 @@ private function register_action_buttons() {
'url' => 'https://docs.wpusermanager.com/?utm_source=WP%20User%20Manager&utm_medium=insideplugin&utm_campaign=WP%20User%20Manager&utm_content=settings-header',
)
);

// Check for the extension activation class; if present, one of the WPUM addon is installed.
if ( class_exists( 'WPUM_Extension_Activation' ) ) {
$this->panel->add_action_button(
array(
'title' => __( 'Licenses', 'wp-user-manager' ),
'url' => admin_url( 'options-general.php?page=wpum-licenses' ),
)
);
}
}

/**
Expand Down