LLMS_Admin_Tool_Wipe_Legacy_Account_Options::should_load()
Conditionally load the tool
Description Description
This tool should only load if there are legacy options (we only check ‘lifterlms_registration_generate_username’).
Return Return
(boolean) Return true to load the tool and false to not load it.
Source Source
File: includes/admin/tools/class-llms-admin-tool-wipe-legacy-account-options.php
protected function should_load() {
if ( $this->skip_cache ) {
global $wpdb;
return ! empty(
$wpdb->get_var(
"SELECT COUNT(*) FROM {$wpdb->options}
WHERE option_name='lifterlms_registration_generate_username'"
)
); // no-cache ok.
}
return ( 'not-set' !== get_option( 'lifterlms_registration_generate_username', 'not-set' ) );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |