Skip to content

Commit

Permalink
feat(generator): actdeact generator support on removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Apr 22, 2024
1 parent 4e51fa4 commit dd17a9f
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions plugin-name/plugin-name.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,6 @@ static function () {
);

// {{/if}}
if ( version_compare( PHP_VERSION, PN_MIN_PHP_VERSION, '<=' ) ) {
add_action(
'admin_init',
static function() {
deactivate_plugins( plugin_basename( __FILE__ ) );
}
);
add_action(
'admin_notices',
static function() {
echo wp_kses_post(
sprintf(
'<div class="notice notice-error"><p>%s</p></div>',
__( '"{{plugin_name}}" requires PHP 5.6 or newer.', PN_TEXTDOMAIN )
)
);
}
);

// Return early to prevent loading the plugin.
return;
}

$plugin_name_libraries = require PN_PLUGIN_ROOT . 'vendor/autoload.php'; //phpcs:ignore

Expand Down Expand Up @@ -145,8 +123,10 @@ static function ( $wp_org_support_forum_url ) { //phpcs:ignore
// {{/if}}

if ( ! wp_installing() ) {
// WPBPGen{{#if act-deact_actdeact}}
register_activation_hook( PN_TEXTDOMAIN . '/' . PN_TEXTDOMAIN . '.php', array( new \Plugin_Name\Backend\ActDeact, 'activate' ) );
register_deactivation_hook( PN_TEXTDOMAIN . '/' . PN_TEXTDOMAIN . '.php', array( new \Plugin_Name\Backend\ActDeact, 'deactivate' ) );
// {{/if}}
add_action(
'plugins_loaded',
static function () use ( $plugin_name_libraries ) {
Expand Down

0 comments on commit dd17a9f

Please sign in to comment.