Skip to content
Snippets Groups Projects
Commit 332e689a authored by dyszczo's avatar dyszczo
Browse files

requirement class can render or disable

parent 57d76f5a
No related branches found
No related tags found
2 merge requests!8Devel,!7requirement class can render or disable
Pipeline #8234 failed
...@@ -340,18 +340,51 @@ class WPDesk_Basic_Requirement_Checker implements WPDesk_Translable { ...@@ -340,18 +340,51 @@ class WPDesk_Basic_Requirement_Checker implements WPDesk_Translable {
* @return bool * @return bool
*/ */
public static function is_setting_set( $name, $value ) { public static function is_setting_set( $name, $value ) {
return ini_get( $name ) === strval( $value ); return ini_get( $name ) === (string) $value;
} }
/** /**
* @return void * @return void
*
* @deprecated use render_notices or disable_plugin
*/ */
public function disable_plugin_render_notice() { public function disable_plugin_render_notice() {
add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'render_notices_action' ) ); add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'render_notices_action' ) );
} }
/** /**
* Shoud be called as WordPress action * Renders requirement notices in admin panel
*
* @return void
*/
public function render_notices() {
add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'render_notices_action' ) );
}
/**
* Renders requirement notices in admin panel
*
* @return void
*/
public function disable_plugin() {
add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'deactivate_action' ) );
}
/**
* @internal Do not use as public. Public only for wp action.
*
* @return void
*/
public function deactivate_action() {
if ( isset( $this->plugin_file ) ) {
deactivate_plugins( plugin_basename( $this->plugin_file ) );
}
}
/**
* Should be called as WordPress action
*
* @internal Do not use as public. Public only for wp action.
* *
* @return void * @return void
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment