Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible simplification of activation/install/deactivation actions #11

Open
JeffMatson opened this issue Jul 24, 2018 · 0 comments
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JeffMatson
Copy link
Contributor

switch ( $active['needs'] ) {
case 'install':
$class = 'install-now button';
if ( ! empty( $this->config['recommended_actions']['install_label'] ) ) {
$label = $this->config['recommended_actions']['install_label'];
}
break;
case 'activate':
$class = 'activate-now button button-primary';
if ( ! empty( $this->config['recommended_actions']['activate_label'] ) ) {
$label = $this->config['recommended_actions']['activate_label'];
}
break;
case 'deactivate':
$class = 'deactivate-now button';
if ( ! empty( $this->config['recommended_actions']['deactivate_label'] ) ) {
$label = $this->config['recommended_actions']['deactivate_label'];
}
break;
}

This could probably be simplified a bit by detecting the action and setting it based on the name.

@FrankM1 FrankM1 added the enhancement New feature or request label Jul 25, 2018
@FrankM1 FrankM1 added this to the 1.1.0 milestone Jul 25, 2018
@FrankM1 FrankM1 self-assigned this Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants