• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors
  • My Account

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_Admin_Tool_Wipe_Legacy_Account_Options / LLMS_Admin_Tool_Wipe_Legacy_Account_Options::should_load()

LLMS_Admin_Tool_Wipe_Legacy_Account_Options::should_load()

Conditionally load the tool

Contents

  • Description
  • Return
  • Source
  • Changelog
  • User Contributed Notes

Description #Description

This tool should only load if there are legacy options (we only check ‘lifterlms_registration_generate_username’).


Top ↑

Return #Return

(boolean) Return true to load the tool and false to not load it.


Top ↑

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


Top ↑

Changelog #Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

© 2014 - 2023 LifterLMS · Privacy Policy · Terms and Conditions

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.